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.
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.
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; }
25 char styleBuf
[bufferSize
];
29 unsigned int startSeg
;
31 bool InternalIsLeadByte(char ch
);
32 void Fill(int position
);
34 WindowAccessor(WindowID id_
, PropertyGet
&props_
) :
35 Accessor(), id(id_
), props(props_
),
36 lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
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
);
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
);
51 char *GetProperties() {
52 return props
.ToString();
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
);