edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
chartextbuffer.h
Go to the documentation of this file.
1// edbee - Copyright (c) 2012-2025 by Rick Blommers and contributors
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "edbee/exports.h"
7
11
12namespace edbee {
13
14
17{
18public:
19 CharTextBuffer( QObject* parent=0);
20
21 virtual int length() const;
22 virtual QChar charAt( int offset ) const;
23 virtual QString textPart( int offset, int length ) const;
24
25 virtual void replaceText( int offset, int length, const QChar* buffer, int bufferLength );
26
27 virtual int lineCount() { return lineOffsetList_.length(); }
28
29 virtual int lineFromOffset( int offset );
30 virtual int offsetFromLine( int line );
31
32 virtual void rawAppendBegin();
33 virtual void rawAppend( QChar c );
34 virtual void rawAppend( const QChar* data, int dataLength );
35 virtual void rawAppendEnd();
36
37 virtual QChar* rawDataPointer();
38
40 LineOffsetVector& lineOffsetList() { return lineOffsetList_; }
41
42protected slots:
43
44 void emitTextChanged( edbee::TextBufferChange* change, QString oldText = QString());
45
46private:
47 QCharGapVector buf_;
48 LineOffsetVector lineOffsetList_;
49
50 int rawAppendStart_;
51 int rawAppendLineStart_;
52
53};
54
55} // edbee
virtual QString textPart(int offset, int length) const
Returns the text part.
Definition chartextbuffer.cpp:47
CharTextBuffer(QObject *parent=0)
The constructor of the textbuffer.
Definition chartextbuffer.cpp:16
virtual QChar charAt(int offset) const
Returns the character at the given character.
Definition chartextbuffer.cpp:35
virtual int length() const
Returns the length of the buffer.
Definition chartextbuffer.cpp:26
virtual int lineCount()
this method should return an array with all line offsets. A line offset pointsto the START of a line ...
Definition chartextbuffer.h:27
void emitTextChanged(edbee::TextBufferChange *change, QString oldText=QString())
virtual void replaceText(int offset, int length, const QChar *buffer, int bufferLength)
replaces the given text
Definition chartextbuffer.cpp:64
LineOffsetVector & lineOffsetList()
Definition chartextbuffer.h:40
This class implements the vector for storing the line numbers at certain offsets/ The class allows th...
Definition lineoffsetvector.h:26
The character vecor to use.
Definition gapvector.h:411
This clas represents a text buffer change and is used to pass around between events This is a sharedd...
Definition textbuffer.h:45
TextBuffer(QObject *parent=0)
The textbuffer constructor.
Definition textbuffer.cpp:90
#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