--- /dev/null
+// Scintilla source code edit control\r
+/** @file DocumentAccessor.h\r
+ ** Implementation of BufferAccess and StylingAccess on a Scintilla\r
+ ** rapid easy access to contents of a Scintilla.\r
+ **/\r
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>\r
+// The License.txt file describes the conditions under which this software may be distributed.\r
+\r
+#ifdef SCI_NAMESPACE\r
+namespace Scintilla {\r
+#endif\r
+\r
+class Document;\r
+\r
+/**\r
+ */\r
+class DocumentAccessor : public Accessor {\r
+ // Private so DocumentAccessor objects can not be copied\r
+ DocumentAccessor(const DocumentAccessor &source) : Accessor(), props(source.props) {}\r
+ DocumentAccessor &operator=(const DocumentAccessor &) { return *this; }\r
+\r
+protected:\r
+ Document *pdoc;\r
+ PropSet &props;\r
+ WindowID id;\r
+ int lenDoc;\r
+\r
+ char styleBuf[bufferSize];\r
+ int validLen;\r
+ char chFlags;\r
+ char chWhile;\r
+ unsigned int startSeg;\r
+ int startPosStyling;\r
+ int mask;\r
+\r
+ bool InternalIsLeadByte(char ch);\r
+ void Fill(int position);\r
+\r
+public:\r
+ DocumentAccessor(Document *pdoc_, PropSet &props_, WindowID id_=0) : \r
+ Accessor(), pdoc(pdoc_), props(props_), id(id_),\r
+ lenDoc(-1), validLen(0), chFlags(0), chWhile(0), \r
+ startSeg(0), startPosStyling(0),\r
+ mask(127) { // Initialize the mask to be big enough for any lexer.\r
+ }\r
+ ~DocumentAccessor();\r
+ bool Match(int pos, const char *s);\r
+ char StyleAt(int position);\r
+ int GetLine(int position);\r
+ int LineStart(int line);\r
+ int LevelAt(int line);\r
+ int Length();\r
+ void Flush();\r
+ int GetLineState(int line);\r
+ int SetLineState(int line, int state);\r
+ int GetPropertyInt(const char *key, int defaultValue=0) { \r
+ return props.GetInt(key, defaultValue); \r
+ }\r
+ char *GetProperties() {\r
+ return props.ToString();\r
+ }\r
+ WindowID GetWindow() { return id; }\r
+\r
+ void StartAt(unsigned int start, char chMask=31);\r
+ void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };\r
+ unsigned int GetStartSegment() { return startSeg; }\r
+ void StartSegment(unsigned int pos);\r
+ void ColourTo(unsigned int pos, int chAttr);\r
+ void SetLevel(int line, int level);\r
+ int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);\r
+ void IndicatorFill(int start, int end, int indicator, int value);\r
+};\r
+\r
+#ifdef SCI_NAMESPACE\r
+}\r
+#endif\r