OSDN Git Service

Enable X64 Build
[tortoisegit/TortoiseGitJp.git] / ext / scintilla / include / WindowAccessor.h
1 // Scintilla source code edit control\r
2 /** @file WindowAccessor.h\r
3  ** Implementation of BufferAccess and StylingAccess on a Scintilla\r
4  ** rapid easy access to contents of a Scintilla.\r
5  **/\r
6 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>\r
7 // The License.txt file describes the conditions under which this software may be distributed.\r
8 \r
9 #ifdef SCI_NAMESPACE\r
10 namespace Scintilla {\r
11 #endif\r
12 \r
13 /**\r
14  */\r
15 class WindowAccessor : public Accessor {\r
16         // Private so WindowAccessor objects can not be copied\r
17         WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {}\r
18         WindowAccessor &operator=(const WindowAccessor &) { return *this; }\r
19 protected:\r
20         WindowID id;\r
21         PropSet &props;\r
22         int lenDoc;\r
23 \r
24         char styleBuf[bufferSize];\r
25         int validLen;\r
26         char chFlags;\r
27         char chWhile;\r
28         unsigned int startSeg;\r
29 \r
30         bool InternalIsLeadByte(char ch);\r
31         void Fill(int position);\r
32 public:\r
33         WindowAccessor(WindowID id_, PropSet &props_) : \r
34                 Accessor(), id(id_), props(props_), \r
35                 lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {\r
36         }\r
37         ~WindowAccessor();\r
38         bool Match(int pos, const char *s);\r
39         char StyleAt(int position);\r
40         int GetLine(int position);\r
41         int LineStart(int line);\r
42         int LevelAt(int line);\r
43         int Length();\r
44         void Flush();\r
45         int GetLineState(int line);\r
46         int SetLineState(int line, int state);\r
47         int GetPropertyInt(const char *key, int defaultValue=0) { \r
48                 return props.GetInt(key, defaultValue); \r
49         }\r
50         char *GetProperties() {\r
51                 return props.ToString();\r
52         }\r
53 \r
54         void StartAt(unsigned int start, char chMask=31);\r
55         void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };\r
56         unsigned int GetStartSegment() { return startSeg; }\r
57         void StartSegment(unsigned int pos);\r
58         void ColourTo(unsigned int pos, int chAttr);\r
59         void SetLevel(int line, int level);\r
60         int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);\r
61         void IndicatorFill(int start, int end, int indicator, int value);\r
62 };\r
63 \r
64 #ifdef SCI_NAMESPACE\r
65 }\r
66 #endif\r