11#include <QExplicitlySharedDataPointer>
52 int offset()
const {
return d_->offset_; }
53 int length()
const {
return d_->length_; }
54 const QChar*
newText()
const {
return d_->newText_; }
56 int line()
const {
return d_->line_; }
58 inline int newLineCount()
const {
return d_->newLineOffsets_.size(); }
63 QExplicitlySharedDataPointer<TextBufferChangeData> d_;
80 virtual QChar
charAt(
int offset )
const = 0;
87 virtual void replaceText(
int offset,
int length,
const QChar* buffer,
int bufferLength ) = 0;
104 virtual void rawAppend(
const QChar* data,
int dataLength ) = 0;
136 virtual int findCharPos(
int offset,
int direction,
const QString& chars,
bool equals );
137 virtual int findCharPosWithinRange(
int offset,
int direction,
const QString& chars,
bool equals,
int beginRange,
int endRange );
138 virtual int findCharPosOrClamp(
int offset,
int direction,
const QString& chars,
bool equals );
This class implements the vector for storing the line numbers at certain offsets/ The class allows th...
Definition lineoffsetvector.h:26
int lineCount_
the number of lines that are involved.
Definition textbuffer.h:36
int length_
The number of chars to replaced.
Definition textbuffer.h:30
int offset_
The offset in the buffer.
Definition textbuffer.h:29
int line_
The line number were the change occured.
Definition textbuffer.h:35
int newTextLength_
The length of this text.
Definition textbuffer.h:32
QVector< int > newLineOffsets_
A list of new line offset.
Definition textbuffer.h:37
TextBufferChangeData(TextBuffer *buffer, int off, int len, const QChar *text, int textlen)
Initializes the textbuffer change.
Definition textbuffer.cpp:16
const QChar * newText_
The reference to a new text.
Definition textbuffer.h:31
This clas represents a text buffer change and is used to pass around between events This is a sharedd...
Definition textbuffer.h:45
TextBufferChange()
Definition textbuffer.cpp:65
const QChar * newText() const
Definition textbuffer.h:54
int lineCount() const
Definition textbuffer.h:57
const QVector< int > & newLineOffsets() const
Definition textbuffer.h:59
int length() const
Definition textbuffer.h:53
int line() const
Definition textbuffer.h:56
int offset() const
Definition textbuffer.h:52
int newLineCount() const
Definition textbuffer.h:58
int newTextLength() const
Definition textbuffer.h:55
This class represents the textbuffer of the editor.
Definition textbuffer.h:68
virtual int length() const =0
should return the number of 'characters'.
virtual int lineCount()=0
this method should return an array with all line offsets. A line offset pointsto the START of a line ...
virtual int findCharPosOrClamp(int offset, int direction, const QString &chars, bool equals)
See documentation at findCharPosWithinRange. This method searches a char position within the given ra...
Definition textbuffer.cpp:245
virtual void replaceText(int offset, int length, const QChar *buffer, int bufferLength)=0
this method should replace the given text And fire a 'text-replaced' signal
virtual int findCharPosWithinRangeOrClamp(int offset, int direction, const QString &chars, bool equals, int beginRange, int endRange)
See documentation at findCharPosWithinRange. This method searches a char position within the given ra...
Definition textbuffer.cpp:253
virtual QString textPart(int offset, int length) const =0
return the given text.
virtual QString line(int line)
Returns the line at the given line position. This line INCLUDES the newline character (if it's there)
Definition textbuffer.cpp:159
virtual void rawAppend(const QChar *data, int dataLength)=0
This method should raw append the given character string.
virtual void rawAppend(QChar c)=0
this method should append the given character to the buffer
virtual void rawAppendEnd()=0
the end raw append method should bring the document in a consistent state and emit the correct "repla...
virtual QString lineWithoutNewline(int line)
Returns the line without the newline character.
Definition textbuffer.cpp:168
virtual int lineLength(int line)
Returns the length of the given line. Also counting the trailing newline character if present.
Definition textbuffer.cpp:180
virtual int columnFromOffsetAndLine(int offset, int line=-1)
this method translates the given position to a column number.
Definition textbuffer.cpp:123
virtual void rawAppendBegin()=0
This method starts raw appending.
virtual QChar charAt(int offset) const =0
A method for returning a single char.
virtual int lineFromOffset(int offset)=0
TextBuffer(QObject *parent=0)
The textbuffer constructor.
Definition textbuffer.cpp:90
QString text()
Returns the full text as a QString.
Definition textbuffer.cpp:107
virtual void appendText(const QString &text)
Appends the given text to the textbuffer.
Definition textbuffer.cpp:139
virtual int findCharPosWithinRange(int offset, int direction, const QString &chars, bool equals, int beginRange, int endRange)
This method finds the find the first character position that equals the given char.
Definition textbuffer.cpp:228
virtual int offsetFromLine(int line)=0
void textChanged(edbee::TextBufferChange change, QString oldText=QString())
Definition moc_textbuffer.cpp:226
void textAboutToBeChanged(edbee::TextBufferChange change)
Definition moc_textbuffer.cpp:219
virtual int lineLengthWithoutNewline(int line)
Returns the length of the given line. Without counting a trailing newline character.
Definition textbuffer.cpp:189
virtual QString lineOffsetsAsString()
Definition textbuffer.cpp:266
virtual int offsetFromLineAndColumn(int line, int col)
This method returns the offset from the give line and column If the column exceed the number of colum...
Definition textbuffer.cpp:147
void setText(const QString &text)
A convenient method for directly filling the textbuffer with the given content.
Definition textbuffer.cpp:114
virtual QChar * rawDataPointer()=0
This method returns the raw data buffer. WARNING this method CAN be slow because when using a gapvect...
virtual int findCharPos(int offset, int direction, const QString &chars, bool equals)
See documentation at findCharPosWithinRange.
Definition textbuffer.cpp:212
A text line item reference.
Definition textlinedata.h:30
A single text region A region constists of an anchor and a caret: The anchor defines the 'start' of t...
Definition textrange.h:29
#define EDBEE_EXPORT
Definition exports.h:15
QT Acessibility has an issue with reporting blank lines between elements lines. defining 'WINDOWS_EMP...
Definition commentcommand.cpp:20