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