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.
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; }
20 char styleBuf
[bufferSize
];
24 unsigned int startSeg
;
26 bool InternalIsLeadByte(char ch
);
27 void Fill(int position
);
29 WindowAccessor(WindowID id_
, PropSet
&props_
) :
30 Accessor(), id(id_
), props(props_
),
31 lenDoc(-1), validLen(0), chFlags(0), chWhile(0) {
34 bool Match(int pos
, const char *s
);
35 char StyleAt(int position
);
36 int GetLine(int position
);
37 int LineStart(int line
);
38 int LevelAt(int line
);
41 int GetLineState(int line
);
42 int SetLineState(int line
, int state
);
43 int GetPropertyInt(const char *key
, int defaultValue
=0) {
44 return props
.GetInt(key
, defaultValue
);
46 char *GetProperties() {
47 return props
.ToString();
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);