KTextEditor
kateviewaccessible.h
28class KateViewAccessible : public QAccessibleWidget, public QAccessibleTextInterface, public QAccessibleEditableTextInterface
36 m_conn = QObject::connect(view->view()->document(), &KTextEditor::Document::textChanged, [this]() {
187 KTextEditor::Range range = KTextEditor::Range(cursorFromInt(startOffset), cursorFromInt(endOffset));
199 QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const override
268 QString textBeforeOffset(int /*offset*/, QAccessible::TextBoundaryType /*boundaryType*/, int *startOffset, int *endOffset) const override
275 QString textAfterOffset(int /*offset*/, QAccessible::TextBoundaryType /*boundaryType*/, int *startOffset, int *endOffset) const override
286 KTextEditor::Range range(document->offsetToCursor(startOffset), document->offsetToCursor(endOffset));
300 KTextEditor::Range range(document->offsetToCursor(startOffset), document->offsetToCursor(endOffset));
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition cursor.h:192
constexpr bool isValid() const noexcept
Returns whether the current position of this cursor is a valid position (line + column must both be >...
Definition cursor.h:102
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition cursor.h:174
Backend of KTextEditor::Document related public KTextEditor interfaces.
Definition katedocument.h:68
qsizetype cursorToOffset(KTextEditor::Cursor c) const override
Retrives the offset for the given cursor position NOTE: It will return -1 if the cursor was invalid o...
Definition katedocument.cpp:926
KTextEditor::Cursor offsetToCursor(qsizetype offset) const override
Retrives the cursor position for given offset NOTE: It will return an invalid cursor(-1,...
Definition katedocument.cpp:931
int lineLength(int line) const override
Get the length of a given line in characters.
Definition katedocument.cpp:921
virtual KTextEditor::Cursor offsetToCursor(qsizetype offset) const =0
Retrives the cursor position for given offset NOTE: It will return an invalid cursor(-1,...
void textChanged(KTextEditor::Document *document)
The document emits this signal whenever its text changes.
virtual bool setText(const QString &text)=0
Set the given text as new document content.
virtual bool removeText(Range range, bool block=false)=0
Remove the text specified in range.
virtual bool insertText(KTextEditor::Cursor position, const QString &text, bool block=false)=0
Insert text at position.
virtual bool replaceText(Range range, const QString &text, bool block=false)
Replace text from range with specified text.
Definition document.cpp:85
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
constexpr Cursor end() const noexcept
Get the end position of this range.
Definition include/ktexteditor/range.h:163
constexpr Cursor start() const noexcept
Get the start position of this range.
Definition include/ktexteditor/range.h:153
void setRange(Range range) noexcept
Set the start and end cursors to range.start() and range.end() respectively.
Definition utils/range.cpp:35
void setScrollPosition(KTextEditor::Cursor cursor)
Scroll view to cursor.
Definition ktexteditor.cpp:383
This class implements a QAccessible-interface for a KateViewInternal.
Definition kateviewaccessible.h:29
int positionFromCursor(KateViewInternal *view, KTextEditor::Cursor cursor) const
When possible, using the last returned value m_lastPosition do the count from the last cursor positio...
Definition kateviewaccessible.h:310
Q_SCRIPTABLE Q_NOREPLY void start()
InterfaceType
EditableText
TextBoundaryType
virtual QObject * object() const const override
QAccessibleWidget(QWidget *w, QAccessible::Role role, const QString &name)
virtual QAccessible::State state() const const override
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
int x() const const
int y() const const
bool isEmpty() const const
qsizetype length() const const
QString mid(qsizetype position, qsizetype n) const const
qsizetype size() const const
NoFocus
qsizetype position() const const
qsizetype toNextBoundary()
bool hasFocus() const const
focusPolicy
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:53:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:53:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.