OSDN Git Service

Add SCI Edit to GitBlameView
[tortoisegit/TortoiseGitJp.git] / ext / scintilla / src / ContractionState.h
1 // Scintilla source code edit control\r
2 /** @file ContractionState.h\r
3  ** Manages visibility of lines for folding and wrapping.\r
4  **/\r
5 // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>\r
6 // The License.txt file describes the conditions under which this software may be distributed.\r
7 \r
8 #ifndef CONTRACTIONSTATE_H\r
9 #define CONTRACTIONSTATE_H\r
10 \r
11 #ifdef SCI_NAMESPACE\r
12 namespace Scintilla {\r
13 #endif\r
14 \r
15 /**\r
16  */\r
17 class ContractionState {\r
18         // These contain 1 element for every document line.\r
19         RunStyles *visible;\r
20         RunStyles *expanded;\r
21         RunStyles *heights;\r
22         Partitioning *displayLines;\r
23         int linesInDocument;\r
24 \r
25         void EnsureData();\r
26 \r
27         bool OneToOne() const {\r
28                 // True when each document line is exactly one display line so need for\r
29                 // complex data structures.\r
30                 return visible == 0;\r
31         }\r
32 \r
33 public:\r
34         ContractionState();\r
35         virtual ~ContractionState();\r
36 \r
37         void Clear();\r
38 \r
39         int LinesInDoc() const;\r
40         int LinesDisplayed() const;\r
41         int DisplayFromDoc(int lineDoc) const;\r
42         int DocFromDisplay(int lineDisplay) const;\r
43 \r
44         void InsertLine(int lineDoc);\r
45         void InsertLines(int lineDoc, int lineCount);\r
46         void DeleteLine(int lineDoc);\r
47         void DeleteLines(int lineDoc, int lineCount);\r
48 \r
49         bool GetVisible(int lineDoc) const;\r
50         bool SetVisible(int lineDocStart, int lineDocEnd, bool visible);\r
51 \r
52         bool GetExpanded(int lineDoc) const;\r
53         bool SetExpanded(int lineDoc, bool expanded);\r
54 \r
55         int GetHeight(int lineDoc) const;\r
56         bool SetHeight(int lineDoc, int height);\r
57 \r
58         void ShowAll();\r
59         void Check() const;\r
60 };\r
61 \r
62 #ifdef SCI_NAMESPACE\r
63 }\r
64 #endif\r
65 \r
66 #endif\r