edbee - Qt Editor Library
Signals | Public Member Functions | Protected Slots | List of all members
edbee::TextDocumentScopes Class Reference

This class is used to 'contain' all document scope information. More...

#include <textdocumentscopes.h>

+ Inheritance diagram for edbee::TextDocumentScopes:
+ Collaboration diagram for edbee::TextDocumentScopes:

Signals

void lastScopedOffsetChanged (int previousOffset, int lastScopedOffset)
 

Public Member Functions

 TextDocumentScopes (TextDocument *textDocument)
 The constructor for storing/managing the textdocument scopes. More...
 
virtual ~TextDocumentScopes ()
 The destructor. More...
 
int lastScopedOffset ()
 returns the last scoped offset More...
 
void setLastScopedOffset (int offset)
 Sets the last scoped offset. More...
 
void setDefaultScope (const QString &name, TextGrammarRule *rule)
 This method sets the default scope. More...
 
void giveLineScopedRangeList (int line, ScopedTextRangeList *list)
 This method sets the scoped line list. More...
 
ScopedTextRangeListscopedRangesAtLine (int line)
 This method returns all scoped ranges on the given line. More...
 
int scopedLineCount ()
 Returns the number of scopes lines in the lineRangeList_. More...
 
void giveMultiLineScopedTextRange (MultiLineScopedTextRange *range)
 gives the multi-lined textrange to the scopedranges More...
 
void removeScopesAfterOffset (int offset)
 This method invalidates all scopes after the given offset. More...
 
MultiLineScopedTextRangedefaultScopedRange ()
 This method retursn the default scoped textrange Currently this is done very dirty, by retrieving the defaultscoped range the begin and end is set tot he complete document a better solution would be a subclass that always returns 0 for an anchor and the documentlength for the caret. More...
 
QVector< MultiLineScopedTextRange * > multiLineScopedRangesBetweenOffsets (int offsetBegin, int offsetEnd)
 This method returns all scope-ranges at the given offset-ranges. More...
 
TextScopeList scopesAtOffset (int offset)
 returns all scopes between the given offsets More...
 
QVector< ScopedTextRange * > createScopedRangesAtOffsetList (int offset)
 This method returns all scoped ranges at the given offest Hmmm this is almost exactly the same implementation as the scopesAtOffset method !? (perhaps we should refactor this) More...
 
QString toString ()
 Converts the textdocument scoped to a string. More...
 
QStringList scopesAsStringList ()
 Returns a string-list will all scopes. This list is mainly used for debugging and testing. More...
 
void dumpScopedLineAddresses (const QString &text=QString())
 add all dumped line scopes More...
 
TextDocumenttextDocument ()
 returns the current textdocument scope More...
 

Protected Slots

void grammarChanged ()
 the grammar has been changed More...
 

Detailed Description

This class is used to 'contain' all document scope information.

Constructor & Destructor Documentation

◆ TextDocumentScopes()

edbee::TextDocumentScopes::TextDocumentScopes ( TextDocument textDocument)

The constructor for storing/managing the textdocument scopes.

Parameters
textDocumentthe textdocument this scoping is for

◆ ~TextDocumentScopes()

edbee::TextDocumentScopes::~TextDocumentScopes ( )
virtual

The destructor.

Member Function Documentation

◆ createScopedRangesAtOffsetList()

QVector< ScopedTextRange * > edbee::TextDocumentScopes::createScopedRangesAtOffsetList ( int  offset)

This method returns all scoped ranges at the given offest Hmmm this is almost exactly the same implementation as the scopesAtOffset method !? (perhaps we should refactor this)

Warning you MUST destroy (qDeleteAll) the list with scoped textranges returned by this list

Parameters
offsethe offset to retrieve the scoped ranges
Returns
the vector with text scopes. These scopes are document wide

◆ defaultScopedRange()

MultiLineScopedTextRange & edbee::TextDocumentScopes::defaultScopedRange ( )

This method retursn the default scoped textrange Currently this is done very dirty, by retrieving the defaultscoped range the begin and end is set tot he complete document a better solution would be a subclass that always returns 0 for an anchor and the documentlength for the caret.

◆ dumpScopedLineAddresses()

void edbee::TextDocumentScopes::dumpScopedLineAddresses ( const QString &  text = QString())

add all dumped line scopes

◆ giveLineScopedRangeList()

void edbee::TextDocumentScopes::giveLineScopedRangeList ( int  line,
ScopedTextRangeList list 
)

This method sets the scoped line list.

Parameters
linethe line
listthe list with all scopes on the given line

◆ giveMultiLineScopedTextRange()

void edbee::TextDocumentScopes::giveMultiLineScopedTextRange ( MultiLineScopedTextRange range)

gives the multi-lined textrange to the scopedranges

◆ grammarChanged

void edbee::TextDocumentScopes::grammarChanged ( )
protectedslot

the grammar has been changed

◆ lastScopedOffset()

int edbee::TextDocumentScopes::lastScopedOffset ( )

returns the last scoped offset

◆ lastScopedOffsetChanged

void edbee::TextDocumentScopes::lastScopedOffsetChanged ( int  previousOffset,
int  lastScopedOffset 
)
signal

◆ multiLineScopedRangesBetweenOffsets()

QVector< MultiLineScopedTextRange * > edbee::TextDocumentScopes::multiLineScopedRangesBetweenOffsets ( int  offsetBegin,
int  offsetEnd 
)

This method returns all scope-ranges at the given offset-ranges.

CHANGED 2013-01-22, was <

◆ removeScopesAfterOffset()

void edbee::TextDocumentScopes::removeScopesAfterOffset ( int  offset)

This method invalidates all scopes after the given offset.

Parameters
offsetthe offset from which to remove the offset

◆ scopedLineCount()

int edbee::TextDocumentScopes::scopedLineCount ( )

Returns the number of scopes lines in the lineRangeList_.

◆ scopedRangesAtLine()

ScopedTextRangeList * edbee::TextDocumentScopes::scopedRangesAtLine ( int  line)

This method returns all scoped ranges on the given line.

Parameters
linethe line to retrieve the scoped ranges for
Returns
the scoped textrange list

◆ scopesAsStringList()

QStringList edbee::TextDocumentScopes::scopesAsStringList ( )

Returns a string-list will all scopes. This list is mainly used for debugging and testing.

◆ scopesAtOffset()

TextScopeList edbee::TextDocumentScopes::scopesAtOffset ( int  offset)

returns all scopes between the given offsets

◆ setDefaultScope()

void edbee::TextDocumentScopes::setDefaultScope ( const QString &  name,
TextGrammarRule rule 
)

This method sets the default scope.

Parameters
thename of the scope
rulethe rule that matched

◆ setLastScopedOffset()

void edbee::TextDocumentScopes::setLastScopedOffset ( int  offset)

Sets the last scoped offset.

Parameters
offsetthe last scoped offset

◆ textDocument()

TextDocument * edbee::TextDocumentScopes::textDocument ( )

returns the current textdocument scope

◆ toString()

QString edbee::TextDocumentScopes::toString ( )

Converts the textdocument scoped to a string.


The documentation for this class was generated from the following files: