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