1 // Scintilla source code edit control
2 /** @file ContractionState.h
3 ** Manages visibility of lines for folding and wrapping.
5 // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
8 #ifndef CONTRACTIONSTATE_H
9 #define CONTRACTIONSTATE_H
11 namespace Scintilla::Internal
{
15 class IContractionState
{
17 virtual ~IContractionState() {};
19 virtual void Clear()=0;
21 virtual Sci::Line
LinesInDoc() const noexcept
=0;
22 virtual Sci::Line
LinesDisplayed() const noexcept
=0;
23 virtual Sci::Line
DisplayFromDoc(Sci::Line lineDoc
) const noexcept
=0;
24 virtual Sci::Line
DisplayLastFromDoc(Sci::Line lineDoc
) const noexcept
=0;
25 virtual Sci::Line
DocFromDisplay(Sci::Line lineDisplay
) const noexcept
=0;
27 virtual void InsertLines(Sci::Line lineDoc
, Sci::Line lineCount
)=0;
28 virtual void DeleteLines(Sci::Line lineDoc
, Sci::Line lineCount
)=0;
30 virtual bool GetVisible(Sci::Line lineDoc
) const noexcept
=0;
31 virtual bool SetVisible(Sci::Line lineDocStart
, Sci::Line lineDocEnd
, bool isVisible
)=0;
32 virtual bool HiddenLines() const noexcept
=0;
34 virtual const char *GetFoldDisplayText(Sci::Line lineDoc
) const noexcept
=0;
35 virtual bool SetFoldDisplayText(Sci::Line lineDoc
, const char *text
)=0;
37 virtual bool GetExpanded(Sci::Line lineDoc
) const noexcept
=0;
38 virtual bool SetExpanded(Sci::Line lineDoc
, bool isExpanded
)=0;
39 virtual bool ExpandAll()=0;
40 virtual Sci::Line
ContractedNext(Sci::Line lineDocStart
) const noexcept
=0;
42 virtual int GetHeight(Sci::Line lineDoc
) const noexcept
=0;
43 virtual bool SetHeight(Sci::Line lineDoc
, int height
)=0;
45 virtual void ShowAll() noexcept
=0;
48 std::unique_ptr
<IContractionState
> ContractionStateCreate(bool largeDocument
);