1 // WindowAccessor.h - implementation of BufferAccess and StylingAccess on a Scintilla rapid easy access to contents of a Scintilla 
   2 // Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> 
   3 // The License.txt file describes the conditions under which this software may be distributed. 
   5 class WindowAccessor 
: public Accessor 
{ 
   6         // Private so WindowAccessor objects can not be copied 
   7         WindowAccessor(const WindowAccessor 
&source
) : Accessor(), props(source
.props
) {} 
   8         WindowAccessor 
&operator=(const WindowAccessor 
&) { return *this; } 
  14         char styleBuf
[bufferSize
]; 
  18         unsigned int startSeg
; 
  20         bool InternalIsLeadByte(char ch
); 
  21         void Fill(int position
); 
  23         WindowAccessor(WindowID id_
, PropSet 
&props_
) :  
  24                 Accessor(), id(id_
), props(props_
),  
  25                 lenDoc(-1), validLen(0), chFlags(0), chWhile(0) { 
  28         char StyleAt(int position
); 
  29         int GetLine(int position
); 
  30         int LineStart(int line
); 
  31         int LevelAt(int line
); 
  34         int GetLineState(int line
); 
  35         int SetLineState(int line
, int state
); 
  36         int GetPropertyInt(const char *key
, int defaultValue
=0) {  
  37                 return props
.GetInt(key
, defaultValue
);  
  40         void StartAt(unsigned int start
, char chMask
=31); 
  41         void SetFlags(char chFlags_
, char chWhile_
) {chFlags 
= chFlags_
; chWhile 
= chWhile_
; }; 
  42         unsigned int GetStartSegment() { return startSeg
; } 
  43         void StartSegment(unsigned int pos
); 
  44         void ColourTo(unsigned int pos
, int chAttr
); 
  45         void SetLevel(int line
, int level
); 
  46         int IndentAmount(int line
, int *flags
, PFNIsCommentLeader pfnIsCommentLeader 
= 0);