]>
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 | ||
7e0c58e9 RD |
9 | #ifdef SCI_NAMESPACE |
10 | namespace Scintilla { | |
11 | #endif | |
12 | ||
65ec6247 RD |
13 | /** |
14 | */ | |
f6bcfd97 BP |
15 | class WindowAccessor : public Accessor { |
16 | // Private so WindowAccessor objects can not be copied | |
17 | WindowAccessor(const WindowAccessor &source) : Accessor(), props(source.props) {} | |
18 | WindowAccessor &operator=(const WindowAccessor &) { return *this; } | |
19 | protected: | |
20 | WindowID id; | |
21 | PropSet &props; | |
22 | int lenDoc; | |
23 | ||
24 | char styleBuf[bufferSize]; | |
25 | int validLen; | |
26 | char chFlags; | |
27 | char chWhile; | |
28 | unsigned int startSeg; | |
29 | ||
30 | bool InternalIsLeadByte(char ch); | |
31 | void Fill(int position); | |
32 | public: | |
88a8b04e RD |
33 | WindowAccessor(WindowID id_, PropSet &props_) : |
34 | Accessor(), id(id_), props(props_), | |
d134f170 | 35 | lenDoc(-1), validLen(0), chFlags(0), chWhile(0) { |
f6bcfd97 BP |
36 | } |
37 | ~WindowAccessor(); | |
a834585d | 38 | bool Match(int pos, const char *s); |
f6bcfd97 BP |
39 | char StyleAt(int position); |
40 | int GetLine(int position); | |
41 | int LineStart(int line); | |
42 | int LevelAt(int line); | |
43 | int Length(); | |
44 | void Flush(); | |
45 | int GetLineState(int line); | |
46 | int SetLineState(int line, int state); | |
88a8b04e RD |
47 | int GetPropertyInt(const char *key, int defaultValue=0) { |
48 | return props.GetInt(key, defaultValue); | |
f6bcfd97 | 49 | } |
65ec6247 RD |
50 | char *GetProperties() { |
51 | return props.ToString(); | |
52 | } | |
f6bcfd97 BP |
53 | |
54 | void StartAt(unsigned int start, char chMask=31); | |
7e0c58e9 | 55 | void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; }; |
f6bcfd97 BP |
56 | unsigned int GetStartSegment() { return startSeg; } |
57 | void StartSegment(unsigned int pos); | |
58 | void ColourTo(unsigned int pos, int chAttr); | |
59 | void SetLevel(int line, int level); | |
60 | int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); | |
7e0c58e9 | 61 | void IndicatorFill(int start, int end, int indicator, int value); |
f6bcfd97 | 62 | }; |
7e0c58e9 RD |
63 | |
64 | #ifdef SCI_NAMESPACE | |
65 | } | |
66 | #endif |