aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/Accessor.h
blob: fc67f07c099801b1f0f62017913bc94c103640f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SciTE - Scintilla based Text Editor
// Accessor.h - rapid easy access to contents of a Scintilla
// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.

enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8};

class BufferAccess;

typedef bool (*PFNIsCommentLeader)(BufferAccess &styler, int pos, int len);

// Interface to data in a Scintilla
class BufferAccess {
public:
	virtual void SetCodePage(int codePage_)=0;
	virtual char operator[](int position)=0;
	virtual char SafeGetCharAt(int position, char chDefault=' ')=0;
	virtual bool IsLeadByte(char ch)=0;
	virtual char StyleAt(int position)=0;
	virtual int GetLine(int position)=0;
	virtual int LineStart(int line)=0;
	virtual int LevelAt(int line)=0;
	virtual int Length()=0;
	virtual void Flush()=0;
	virtual int GetLineState(int line)=0;
	virtual int SetLineState(int line, int state)=0;
	virtual PropSet &GetPropSet()=0;

	// Style setting
	virtual void StartAt(unsigned int start, char chMask=31)=0;
	virtual void SetFlags(char chFlags_, char chWhile_)=0;
	virtual unsigned int GetStartSegment()=0;
	virtual void StartSegment(unsigned int pos)=0;
	virtual void ColourTo(unsigned int pos, int chAttr)=0;
	virtual void SetLevel(int line, int level)=0;
	virtual int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0)=0;
};