Update Scintilla to version 3.4.4
[TortoiseGit.git] / ext / scintilla / src / ContractionState.h
blob9f111915f93742842df53504932ea813f24f472d
1 // Scintilla source code edit control
2 /** @file ContractionState.h
3 ** Manages visibility of lines for folding and wrapping.
4 **/
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 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
15 /**
17 class ContractionState {
18 // These contain 1 element for every document line.
19 RunStyles *visible;
20 RunStyles *expanded;
21 RunStyles *heights;
22 Partitioning *displayLines;
23 int linesInDocument;
25 void EnsureData();
27 bool OneToOne() const {
28 // True when each document line is exactly one display line so need for
29 // complex data structures.
30 return visible == 0;
33 public:
34 ContractionState();
35 virtual ~ContractionState();
37 void Clear();
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);
61 void ShowAll();
62 void Check() const;
65 #ifdef SCI_NAMESPACE
67 #endif
69 #endif