10 #include <QStringList> 19 class MultiLineScopedTextRange;
21 class ScopedTextRange;
22 class TextDocumentScopes;
23 class TextGrammarRule;
41 TextScopeAtomId
atomAt(
int idx)
const;
52 TextScopeAtomId* scopeAtoms_;
127 QVector<TextScopeList*> selectorList_;
151 TextScopeAtomId wildcardId();
153 TextScopeAtomId findOrRegisterScopeAtom(
const QString& atom );
154 TextScope* refTextScope(
const QString& scopeString );
157 TextScopeList* createTextScopeList(
const QString &scopeListString );
159 const QString& atomName( TextScopeAtomId
id );
162 TextScopeAtomId wildCardId_;
165 QList<QString> atomNameList_;
166 QHash<QString,TextScopeAtomId> atomNameMap_;
169 QList<TextScope*> textScopeList_;
170 QHash<QString,TextScope*> textScopeRefMap_;
187 QString toString()
const;
237 void setIndependent(
bool enable=
true);
238 bool isIndependent()
const;
245 QVector<ScopedTextRange*> ranges_;
266 void giveEndRegExp(
RegExp* regExp );
290 virtual int rangeCount()
const;
292 virtual const TextRange& constRange(
int idx)
const;
293 virtual void addRange(
int anchor,
int caret );
294 virtual void addRange(
const TextRange& range);
296 virtual void removeRange(
int idx );
297 virtual void clear();
298 virtual void toSingleRange();
299 virtual void sortRanges();
303 void removeAndInvalidateRangesAfterOffset(
int offset );
307 void processChangesIfRequired(
bool joinBorders );
316 QList<MultiLineScopedTextRange*> scopedRangeList_;
333 int lastScopedOffset();
334 void setLastScopedOffset(
int offset );
342 int scopedLineCount();
345 void removeScopesAfterOffset(
int offset );
348 QVector<MultiLineScopedTextRange*> multiLineScopedRangesBetweenOffsets(
int offsetBegin,
int offsetEnd );
350 QVector<ScopedTextRange*> createScopedRangesAtOffsetList(
int offset );
353 QStringList scopesAsStringList();
355 void dumpScopedLineAddresses(
const QString& text = QString() );
362 void grammarChanged();
365 void lastScopedOffsetChanged(
int previousOffset,
int lastScopedOffset );
385 int lastScopedOffset_;
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition: textdocument.h:40
This abstract class represents a set of textranges The ranges are kept ordered and will not contain o...
Definition: textrange.h:105
The scope manager is used to manage the scopes... A scope consist out of several scope-parts: ...
Definition: textdocumentscopes.h:141
This class is used to define a gap vector. A Gapvector is split in 2 parts. where the gap is moved to...
Definition: gapvector.h:19
int atomCount()
returns the number of atom items
Definition: textdocumentscopes.cpp:289
short TextScopeAtomId
This type defines a single scope atom.
Definition: textdocumentscopes.h:24
This class 'defines' a single document scope.
Definition: textdocumentscopes.h:257
defines a single grammar rule
Definition: textgrammar.h:24
Our first version of scope-selector only support a list of scopes Thus the Descendant (space) selecto...
Definition: textdocumentscopes.h:113
This class defines a full text-scope. A full textscope is textscope with one ore more scoped-elements...
Definition: textdocumentscopes.h:36
virtual MultiLineScopedTextRange * multiLineScopedTextRange()
returns the multi-line scoped text range
Definition: textdocumentscopes.h:190
This is a set of scoped textranges. This set is used to remember parsed language ranges.
Definition: textdocumentscopes.h:282
friend class TextScopeManager
Definition: textdocumentscopes.h:54
A list of text-scopes. on a certian location, usually more then one scope is available on a given loc...
Definition: textdocumentscopes.h:61
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
A class for matching QStrings with the Oniguruma API We need this Regular Expression library to be ab...
Definition: regexp.h:36
a list of textscopes This class is used for single-line scopes (Todo, this needs to be optimized) ...
Definition: textdocumentscopes.h:223
TextScopeAtomId atomAt(int idx) const
This method returns the atom at the given index.
Definition: textdocumentscopes.cpp:296
A base scoped text range.
Definition: textdocumentscopes.h:178
bool startsWith(TextScope *scope)
Checks if the current scope starts with the given scope wild-card atoms will always match...
Definition: textdocumentscopes.cpp:306
This class is used to 'contain' all document scope information.
Definition: textdocumentscopes.h:325
A single text region A region constists of an anchor and a caret: The anchor defines the 'start' of t...
Definition: textrange.h:29
const QString name()
This method returns the name of this scope.
Definition: textdocumentscopes.cpp:275
A line based ScopedText range, that referenes a multi-line text-reference.
Definition: textdocumentscopes.h:203
int rindexOf(TextScope *scope)
This method returns the 'index' of the given full-scope. This is a kind of substring search...
Definition: textdocumentscopes.cpp:326