edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::MultiLineScopedTextRange Class Reference

This class 'defines' a single document scope. More...

#include <textdocumentscopes.h>

+ Inheritance diagram for edbee::MultiLineScopedTextRange:
+ Collaboration diagram for edbee::MultiLineScopedTextRange:

Public Member Functions

 MultiLineScopedTextRange (int anchor, int caret, TextScope *scope)
 The multiline scoped textrange.
 
virtual ~MultiLineScopedTextRange ()
 The multi-line destructor.
 
void setGrammarRule (TextGrammarRule *rule)
 Sets the rule (we need the rule to perform end-of-line matching)
 
TextGrammarRulegrammarRule () const
 Returns the active grammar rule.
 
void giveEndRegExp (RegExp *regExp)
 Gives the end regular expression.
 
RegExpendRegExp ()
 returns the end-regular expression
 
- Public Member Functions inherited from edbee::ScopedTextRange
 ScopedTextRange (int anchor, int caret, TextScope *scope)
 A scoped text range.
 
virtual ~ScopedTextRange ()
 The default destructor.
 
void setScope (TextScope *scope)
 sets the scope of this textrange
 
TextScopescope () const
 returns the scope
 
QString toString () const
 Converts the scoped textrange to a string.
 
virtual MultiLineScopedTextRangemultiLineScopedTextRange ()
 returns the multi-line scoped text range
 
- Public Member Functions inherited from edbee::TextRange
 TextRange (int anchor=0, int caret=0)
 
int anchor () const
 
int caret () const
 
int min () const
 returns the minimal value
 
int max () const
 
int & minVar ()
 returns the minimal variable reference
 
int & maxVar ()
 
int length () const
 
void fixCaretForUnicode (TextDocument *doc, int direction)
 Makes sure the caret isn't in-between a unicode boundary refs #19 - Dirty hack to improve caret-movement by skipping non-BMP characters.
 
void setAnchor (int anchor)
 
void setAnchorBounded (TextDocument *doc, int anchor)
 Sets the anchor to the given location, and forces the anchor to say between the document bounds.
 
void setCaret (int caret)
 
void setCaretBounded (TextDocument *doc, int caret)
 Sets the caret to the given location, and forces the caret to say between the document bounds.
 
void setLength (int newLength)
 Changes the length by modifying the max-variable.
 
void set (int anchor, int caret)
 
void reset ()
 
bool hasSelection () const
 
bool isEmpty () const
 
void clearSelection ()
 
QString toString () const
 This method converts a text-selection range to a string helpfull with debuggin.
 
void moveCaret (TextDocument *doc, int amount)
 Moves the caret the given amount.
 
void moveCaretOrDeselect (TextDocument *doc, int amount)
 move the caret or deselect the given amount
 
int moveWhileChar (TextDocument *doc, int pos, int amount, const QString &chars)
 This method charactes after the given char group When moving to the left the cursor is placed AFTER the last character.
 
int moveUntilChar (TextDocument *doc, int pos, int amount, const QString &chars)
 This method charactes until the given chargroup is found When moving to the LEFT the cursor is placed AFTER the found character.
 
void moveCaretWhileChar (TextDocument *doc, int amount, const QString &chars)
 moves the caret while a character is moving
 
void moveCaretUntilChar (TextDocument *doc, int amount, const QString &chars)
 
void moveAnchortWhileChar (TextDocument *doc, int amount, const QString &chars)
 
void moveAnchorUntilChar (TextDocument *doc, int amount, const QString &chars)
 
void moveCaretByCharGroup (TextDocument *doc, int amount, const QString &whitespace, const QStringList &characterGroups)
 This method moves the caret to/from the given seperator.
 
void moveCaretToLineBoundary (TextDocument *doc, int amount, const QString &whitespace)
 This moves the caret to a line boundary.
 
void moveCaretToWordBoundaryAtOffset (TextDocument *doc, int offset)
 Moves the caret to a word boundary (used for word dragging selections)
 
void moveCaretToLineBoundaryAtOffset (TextDocument *doc, int offset)
 Moves the caret to a word boundary (used for word dragging selections)
 
void expandToFullLine (TextDocument *doc, int amount)
 Expands the selection range so it only consists of full lines amount specifies the amount (and the direction) of the expansions -1 means expand lines to top (and add extra lines) 1 means expand lines at the bottom (and add extras lines) 0 is a special case, it moves the caret to the start of the current line and expands to the end of the line. It does not add lines.
 
void deselectTrailingNewLine (TextDocument *doc)
 This method deselects the last character if it's a newline.
 
void expandToWord (TextDocument *doc, const QString &whitespace, const QStringList &characterGroups)
 Expands the selection to a words.
 
void expandToIncludeRange (TextRange &range)
 
void forceBounds (TextDocument *doc)
 Sets the bounds.
 
bool equals (const TextRange &range)
 This method checks if the two ranges are equal.
 
bool touches (TextRange &range)
 Checks if two ranges touch eachother. Touching means that the start and end of two ranges are onto eachother Possible situations ( [ = anchor, > = caret, ( = don't care ) (A)(B) or (B)(A)
 
bool contains (int pos)
 checks if the given position is in this textrange
 

Static Public Member Functions

static bool lessThan (MultiLineScopedTextRange *r1, MultiLineScopedTextRange *r2)
 This method compares selection ranges.
 
- Static Public Member Functions inherited from edbee::TextRange
static bool lessThan (TextRange &r1, TextRange &r2)
 This method compares selection ranges.
 

Detailed Description

This class 'defines' a single document scope.

Constructor & Destructor Documentation

◆ MultiLineScopedTextRange()

edbee::MultiLineScopedTextRange::MultiLineScopedTextRange ( int anchor,
int caret,
TextScope * scope )

The multiline scoped textrange.

Parameters
anchor

◆ ~MultiLineScopedTextRange()

edbee::MultiLineScopedTextRange::~MultiLineScopedTextRange ( )
virtual

The multi-line destructor.

Member Function Documentation

◆ endRegExp()

RegExp * edbee::MultiLineScopedTextRange::endRegExp ( )

returns the end-regular expression

◆ giveEndRegExp()

void edbee::MultiLineScopedTextRange::giveEndRegExp ( RegExp * regExp)

Gives the end regular expression.

◆ grammarRule()

TextGrammarRule * edbee::MultiLineScopedTextRange::grammarRule ( ) const

Returns the active grammar rule.

◆ lessThan()

bool edbee::MultiLineScopedTextRange::lessThan ( MultiLineScopedTextRange * r1,
MultiLineScopedTextRange * r2 )
static

This method compares selection ranges.

◆ setGrammarRule()

void edbee::MultiLineScopedTextRange::setGrammarRule ( TextGrammarRule * rule)

Sets the rule (we need the rule to perform end-of-line matching)


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