.. index:: pair: class; EE::UI::Doc::DocumentView .. _doxid-class_e_e_1_1_u_i_1_1_doc_1_1_document_view: class EE::UI::Doc::DocumentView =============================== .. toctree:: :hidden: struct_EE_UI_Doc_DocumentView_Config.rst struct_EE_UI_Doc_DocumentView_LineWrapInfo.rst struct_EE_UI_Doc_DocumentView_VisibleLineInfo.rst struct_EE_UI_Doc_DocumentView_VisibleLineRange.rst .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class DocumentView { public: // structs struct :ref:`Config`; struct :ref:`LineWrapInfo`; struct :ref:`VisibleLineInfo`; struct :ref:`VisibleLineRange`; // construction :target:`DocumentView`(std::shared_ptr<:ref:`TextDocument`> doc, :ref:`FontStyleConfig` fontStyle, :ref:`Config` config); // methods static :ref:`LineWrapMode` :target:`toLineWrapMode`(std::string mode); static std::string :target:`fromLineWrapMode`(:ref:`LineWrapMode` mode); static :ref:`LineWrapType` :target:`toLineWrapType`(std::string type); static std::string :target:`fromLineWrapType`(:ref:`LineWrapType` type); static :ref:`LineWrapInfo` :target:`computeLineBreaks`( const :ref:`String::View`& string, const :ref:`FontStyleConfig`& fontStyle, :ref:`Float` maxWidth, :ref:`LineWrapMode` mode, bool keepIndentation, :ref:`Uint32` tabWidth = 4, :ref:`Float` whiteSpaceWidth = 0.f, :ref:`Uint32` textHints = :ref:`TextHints::None`, bool tabStops = false, :ref:`Float` initialXOffset = 0.f ); static :ref:`LineWrapInfo` :target:`computeLineBreaks`( const :ref:`String`& string, const :ref:`FontStyleConfig`& fontStyle, :ref:`Float` maxWidth, :ref:`LineWrapMode` mode, bool keepIndentation, :ref:`Uint32` tabWidth = 4, :ref:`Float` whiteSpaceWidth = 0.f, :ref:`Uint32` textHints = :ref:`TextHints::None`, bool tabStops = false, :ref:`Float` initialXOffset = 0.f ); static :ref:`LineWrapInfo` :target:`computeLineBreaks`( const :ref:`TextDocument`& doc, size_t line, const :ref:`FontStyleConfig`& fontStyle, :ref:`Float` maxWidth, :ref:`LineWrapMode` mode, bool keepIndentation, :ref:`Uint32` tabWidth = 4, :ref:`Float` whiteSpaceWidth = 0.f, bool tabStops = false, :ref:`Float` initialXOffset = 0.f ); static :ref:`Float` :target:`computeOffsets`(const :ref:`String::View`& string, const :ref:`FontStyleConfig`& fontStyle, :ref:`Uint32` tabWidth, :ref:`Float` maxWidth = 0.f, bool tabStops = false); bool :target:`isWrapEnabled`() const; size_t :target:`getVisibleLinesCount`() const; const :ref:`Config`& :target:`config`() const; void :target:`invalidateCache`(); void :target:`updateCache`(:ref:`Int64` fromLine, :ref:`Int64` toLine, :ref:`Int64` numLines); :ref:`Config` :target:`getConfig`() const; void :target:`setConfig`(:ref:`Config` config); void :target:`setMaxWidth`(:ref:`Float` maxWidth, bool forceReconstructBreaks = false); void :target:`setFontStyle`(:ref:`FontStyleConfig` fontStyle); void :target:`setLineWrapMode`(:ref:`LineWrapMode` mode); :ref:`TextPosition` :target:`getVisibleIndexPosition`(:ref:`VisibleIndex` visibleIndex) const; :ref:`Float` :target:`getLinePadding`(:ref:`Int64` docIdx) const; :ref:`VisibleIndex` :target:`toVisibleIndex`(:ref:`Int64` docIdx, bool retLast = false) const; bool :target:`isWrappedLine`(:ref:`Int64` docIdx) const; :ref:`VisibleLineInfo` :target:`getVisibleLineInfo`(:ref:`Int64` docIdx) const; :ref:`VisibleLineRange` :target:`getVisibleLineRange`(const :ref:`TextPosition`& pos, bool allowVisualLineEnd = false) const; :ref:`TextRange` :target:`getVisibleIndexRange`(:ref:`VisibleIndex` visibleIndex) const; std::shared_ptr<:ref:`TextDocument`> :target:`getDocument`() const; void :target:`setDocument`(const std::shared_ptr<:ref:`TextDocument`>& doc); bool :target:`isPendingReconstruction`() const; void :target:`setPendingReconstruction`(bool pendingReconstruction); void :target:`clear`(); void :target:`clearCache`(); double :target:`getLineYOffset`(:ref:`VisibleIndex` visibleIndex, :ref:`Float` lineHeight) const; double :target:`getLineYOffset`(:ref:`Int64` docIdx, :ref:`Float` lineHeight) const; bool :target:`isLineVisible`(:ref:`Int64` docIdx) const; bool :target:`isFolded`(:ref:`Int64` docIdx, bool andNotFirstLine = false) const; std::optional<:ref:`TextRange`> :target:`isInFoldedRange`(:ref:`TextRange` range, bool andNotFirstLine) const; void :target:`foldRegion`(:ref:`Int64` foldDocIdx); void :target:`unfoldRegion`(:ref:`Int64` foldDocIdx); bool :target:`isOneToOne`() const; std::vector<:ref:`TextRange`> :target:`intersectsFoldedRegions`(const :ref:`TextRange`& range) const; :ref:`Float` :target:`getWhiteSpaceWidth`() const; void :target:`ensureCursorVisibility`(); const std::vector<:ref:`TextRange`> :target:`getFoldedRegions`() const; void :target:`onFoldRegionsUpdated`(); void :target:`setOnVisibleLineCountChange`(std::function onVisibleLinesCountChangeCb); void :target:`setOnFoldUnfoldCb`(std::function` docIdx, bool unfolded)> onFoldUnfoldCb); void :target:`setTabStops`(bool enabled); bool :target:`usesTabStops`() const; };