20 class TextDocumentFilter;
21 class TextDocumentScopes;
22 class TextEditorConfig;
23 class TextEditorController;
27 class TextLineDataManager;
90 virtual void endUndoGroup(
int coalesceId,
bool flatten=
false );
120 void append(
const QString& text,
int coalesceId=0 );
121 void replace(
int offset,
int length,
const QString& text,
int coalesceId=0);
122 void setText(
const QString& text );
128 void rawAppend(
const QChar *chars,
int length );
145 QString
textPart(
int offset,
int length );
147 QString
line(
int line );
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition: textdocument.h:40
virtual TextEditorConfig * config() const =0
this method should return the config
virtual void setLineEnding(const LineEnding *lineENding)=0
This clas represents a text buffer change and is used to pass around between events This is a sharedd...
Definition: textbuffer.h:45
virtual void giveLineData(int line, int field, TextLineData *dataItem)
This method gives a given data item to a text line.
Definition: textdocument.cpp:56
An undoable-command-group.
Definition: change.h:84
virtual void setDocumentFilter(TextDocumentFilter *filter)
Sets the document filter without tranfering the ownership.
Definition: textdocument.cpp:160
void rawAppendBegin()
begins the raw append modes. In raw append mode data is directly streamed to the textdocument-buffer...
Definition: textdocument.cpp:320
virtual TextCodec * encoding()=0
This method should return the current encoding.
virtual const LineEnding * lineEnding()=0
This method should return the current line ending.
QChar charAtOrNull(int idx)
returns the char at the given index if the index is valid else the null character is returned ...
Definition: textdocument.cpp:377
virtual bool isUndoRunning()
This method should return true if the current change is the cause of an undo operation.
Definition: textdocument.cpp:125
virtual TextLineData * getLineData(int line, int field)
Returns the line specific data at the given line.
Definition: textdocument.cpp:69
virtual void endUndoGroup(int coalesceId, bool flatten=false)
Ends the current undo group.
Definition: textdocument.cpp:92
int lineFromOffset(int offset)
returns the line number which contains the given offset
Definition: textdocument.cpp:398
This manager manages all line definitions.
Definition: textlinedata.h:75
virtual void beginUndoGroup(ChangeGroup *group)
Starts an undo group.
Definition: textdocument.cpp:80
void beginChanges(TextEditorController *controller)
Start the changes.
Definition: textdocument.cpp:186
virtual bool isUndoCollectionEnabled()
this method return true if the undo stack is enabled
Definition: textdocument.cpp:111
virtual void setLanguageGrammar(TextGrammar *grammar)=0
Changes the language grammar. This method should emit a grammarChanged signal (if the grammar is chan...
virtual TextUndoStack * textUndoStack()=0
this method should return a reference to the undo stack
virtual void setLineDataFieldsPerLine(int count)
This method can be used to change the number of reserved fields by the document Increasing the amount...
Definition: textdocument.cpp:47
void languageGrammarChanged()
This signal is emitted if the grammar has been changed.
Definition: moc_textdocument.cpp:214
void rawAppend(QChar c)
Appends a single char in raw append mode.
Definition: textdocument.cpp:337
TextDocument(QObject *parent=0)
Constructs the textdocument.
Definition: textdocument.cpp:27
This class represents a single text codec The codec has a name and contains methods to create encoder...
Definition: textcodec.h:37
void lastScopedOffsetChanged(int previousOffset, int lastScopedOffset)
this signal is emitted if the scoped range has been changed
Definition: moc_textdocument.cpp:220
void textAboutToBeChanged(edbee::TextBufferChange change)
Definition: moc_textdocument.cpp:193
QString textPart(int offset, int length)
Returns the given part of the text.
Definition: textdocument.cpp:454
virtual bool isUndoOrRedoRunning()
Is it an undo or redo (which means all commands area already available)
Definition: textdocument.cpp:139
int length()
Returns the length of the document in characters default implementation is to forward this call to th...
Definition: textdocument.cpp:352
int lineLength(int line)
Returns the length of the given line.
Definition: textdocument.cpp:427
virtual void setUndoCollectionEnabled(bool enabled)
Enables or disables the collection of undo commands.
Definition: textdocument.cpp:118
General configuration settings of the text editor.
Definition: texteditorconfig.h:17
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
virtual TextLexer * textLexer()=0
Should return the current document lexer.
virtual void setPersisted(bool enabled=true)
Calc this method to mark current state as persisted.
Definition: textdocument.cpp:153
This class defines a single language grammar.
Definition: textgrammar.h:125
virtual TextGrammar * languageGrammar()=0
This method should return the current language grammar.
virtual bool isPersisted()
Checks if the document is in a persited state.
Definition: textdocument.cpp:146
virtual bool isRedoRunning()
Checks if currently an undo operation is running.
Definition: textdocument.cpp:132
Change * executeAndGiveChange(Change *change, int coalesceId)
call this method to execute a change. The change is first passed to the filter so the documentFilter ...
Definition: textdocument.cpp:281
int offsetFromLine(int line)
Retrieves the character-offset of the given line.
Definition: textdocument.cpp:389
A basic change.
Definition: change.h:18
The texteditor works via the controller. The controller is the central point/mediater which maps/cont...
Definition: texteditorcontroller.h:37
void giveSelection(TextEditorController *controller, TextRangeSet *rangeSet)
sets the selectioin for the current rangeset The selection may never be empty
Definition: textdocument.cpp:256
QString lineWithoutNewline(int line)
Returns the given line without the trailing character.
Definition: textdocument.cpp:463
void textChanged(edbee::TextBufferChange change)
Definition: moc_textdocument.cpp:200
This class represents the textbuffer of the editor.
Definition: textbuffer.h:68
void append(const QString &text, int coalesceId=0)
Appends the given text to the document.
Definition: textdocument.cpp:295
The basic textrange class. A simple class of textrange with a simple vector implementation.
Definition: textrange.h:198
void setText(const QString &text)
Changes the compelte document text.
Definition: textdocument.cpp:312
QChar charAt(int idx)
Returns the character at the given position.
Definition: textdocument.cpp:366
QString text()
Returns the document text as a QString.
Definition: textdocument.cpp:444
int lineCount()
Returns the number of lines.
Definition: textdocument.cpp:359
This class is used to 'contain' all document scope information.
Definition: textdocumentscopes.h:325
Definition: textdocumentfilter.h:20
virtual void giveDocumentFilter(TextDocumentFilter *filter)
this method sets the document filter You can give a 0 pointer to delte the old filter! ...
Definition: textdocument.cpp:170
int offsetFromLineAndColumn(int line, int column)
Returns the character offset of the given line and column.
Definition: textdocument.cpp:418
void rawAppendEnd()
When then raw appending is done. The events are fired that the document has been changed The undo-col...
Definition: textdocument.cpp:329
int lineLengthWithoutNewline(int line)
returns the length of the given lilne without the newline
Definition: textdocument.cpp:436
QString line(int line)
line the line number to retrieve
Definition: textdocument.cpp:472
virtual void setEncoding(TextCodec *codec)=0
This is the undo stack for the texteditor. This stack is SHARED by all views of the document The stac...
Definition: textundostack.h:50
virtual TextLineDataManager * lineDataManager()=0
this method can be used to give a 'custom' line data item to a given line
virtual TextDocumentScopes * scopes()=0
Should return the document-scopes of this document.
This is a single lexer.
Definition: textlexer.h:17
A special class to perform line-ending detection.
Definition: lineending.h:12
virtual TextDocumentFilter * documentFilter()
This method returns the document filter.
Definition: textdocument.cpp:179
A text line item reference.
Definition: textlinedata.h:28
int columnFromOffsetAndLine(int offset, int line=-1)
return the column position for the given offset and line
Definition: textdocument.cpp:408
virtual ~TextDocument()
Destroys the textdocument.
Definition: textdocument.cpp:36
void persistedChanged(bool persisted)
This signal is emitted if the persisted state is changed.
Definition: moc_textdocument.cpp:207
void endChanges(int coalesceId)
Definition: textdocument.cpp:267
virtual Change * giveChangeWithoutFilter(Change *change, int coalesceId)=0
void replace(int offset, int length, const QString &text, int coalesceId=0)
Appends the given text.
Definition: textdocument.cpp:304
void replaceRangeSet(TextRangeSet &rangeSet, const QString &text)
Replaces the given rangeset.
Definition: textdocument.cpp:193
virtual void endUndoGroupAndDiscard()
Ends the undo group and discards all recorded information Warning it does NOT undo all made changes!!...
Definition: textdocument.cpp:104
virtual TextBuffer * buffer() const =0
This method should return the active textbuffer Warning you should NEVER directly modify the textbuff...