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
17 class ContractionState
{
18 // These contain 1 element for every document line.
22 Partitioning
*displayLines
;
27 bool OneToOne() const {
28 // True when each document line is exactly one display line so need for
29 // complex data structures.
35 virtual ~ContractionState();
39 int LinesInDoc() const;
40 int LinesDisplayed() const;
41 int DisplayFromDoc(int lineDoc
) const;
42 int DisplayLastFromDoc(int lineDoc
) const;
43 int DocFromDisplay(int lineDisplay
) const;
45 void InsertLine(int lineDoc
);
46 void InsertLines(int lineDoc
, int lineCount
);
47 void DeleteLine(int lineDoc
);
48 void DeleteLines(int lineDoc
, int lineCount
);
50 bool GetVisible(int lineDoc
) const;
51 bool SetVisible(int lineDocStart
, int lineDocEnd
, bool visible
);
52 bool HiddenLines() const;
54 bool GetExpanded(int lineDoc
) const;
55 bool SetExpanded(int lineDoc
, bool expanded
);
56 int ContractedNext(int lineDocStart
) const;
58 int GetHeight(int lineDoc
) const;
59 bool SetHeight(int lineDoc
, int height
);