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
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
10 namespace Scintilla {
\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
24 char styleBuf[bufferSize];
\r
28 unsigned int startSeg;
\r
30 bool InternalIsLeadByte(char ch);
\r
31 void Fill(int position);
\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
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
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
50 char *GetProperties() {
\r
51 return props.ToString();
\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
64 #ifdef SCI_NAMESPACE
\r