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 char StyleAt(int position
);
35 int GetLine(int position
);
36 int LineStart(int line
);
37 int LevelAt(int line
);
40 int GetLineState(int line
);
41 int SetLineState(int line
, int state
);
42 int GetPropertyInt(const char *key
, int defaultValue
=0) {
43 return props
.GetInt(key
, defaultValue
);
45 char *GetProperties() {
46 return props
.ToString();
49 void StartAt(unsigned int start
, char chMask
=31);
50 void SetFlags(char chFlags_
, char chWhile_
) {chFlags
= chFlags_
; chWhile
= chWhile_
; };
51 unsigned int GetStartSegment() { return startSeg
; }
52 void StartSegment(unsigned int pos
);
53 void ColourTo(unsigned int pos
, int chAttr
);
54 void SetLevel(int line
, int level
);
55 int IndentAmount(int line
, int *flags
, PFNIsCommentLeader pfnIsCommentLeader
= 0);