Group functions in QAccessibleTextInterface
Do the same in QAccessibleTextWidget I got a bit annoyed by this, should hopefully make life easier when forward porting QPlainTextEdit Change-Id: Ib4b90d1892974ea39ecfcbc5cad6ed0694207b58 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>bb10
parent
4564103d53
commit
0cba86f7a4
|
|
@ -70,14 +70,18 @@ class Q_GUI_EXPORT QAccessibleTextInterface
|
|||
{
|
||||
public:
|
||||
virtual ~QAccessibleTextInterface() {}
|
||||
|
||||
virtual void addSelection(int startOffset, int endOffset) = 0;
|
||||
virtual QString attributes(int offset, int *startOffset, int *endOffset) const = 0;
|
||||
virtual int cursorPosition() const = 0;
|
||||
virtual QRect characterRect(int offset) const = 0;
|
||||
virtual int selectionCount() const = 0;
|
||||
virtual int offsetAtPoint(const QPoint &point) const = 0;
|
||||
// selection
|
||||
virtual void selection(int selectionIndex, int *startOffset, int *endOffset) const = 0;
|
||||
virtual int selectionCount() const = 0;
|
||||
virtual void addSelection(int startOffset, int endOffset) = 0;
|
||||
virtual void removeSelection(int selectionIndex) = 0;
|
||||
virtual void setSelection(int selectionIndex, int startOffset, int endOffset) = 0;
|
||||
|
||||
// cursor
|
||||
virtual int cursorPosition() const = 0;
|
||||
virtual void setCursorPosition(int position) = 0;
|
||||
|
||||
// text
|
||||
virtual QString text(int startOffset, int endOffset) const = 0;
|
||||
virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
||||
int *startOffset, int *endOffset) const = 0;
|
||||
|
|
@ -85,11 +89,14 @@ public:
|
|||
int *startOffset, int *endOffset) const = 0;
|
||||
virtual QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
||||
int *startOffset, int *endOffset) const = 0;
|
||||
virtual void removeSelection(int selectionIndex) = 0;
|
||||
virtual void setCursorPosition(int position) = 0;
|
||||
virtual void setSelection(int selectionIndex, int startOffset, int endOffset) = 0;
|
||||
virtual int characterCount() const = 0;
|
||||
|
||||
// character <-> geometry
|
||||
virtual QRect characterRect(int offset) const = 0;
|
||||
virtual int offsetAtPoint(const QPoint &point) const = 0;
|
||||
|
||||
virtual void scrollToSubstring(int startIndex, int endIndex) = 0;
|
||||
virtual QString attributes(int offset, int *startOffset, int *endOffset) const = 0;
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QAccessibleEditableTextInterface
|
||||
|
|
|
|||
|
|
@ -76,13 +76,18 @@ public:
|
|||
QAccessibleTextWidget(QWidget *o, QAccessible::Role r = QAccessible::EditableText, const QString &name = QString());
|
||||
|
||||
// QAccessibleTextInterface
|
||||
void addSelection(int startOffset, int endOffset);
|
||||
QString attributes(int offset, int *startOffset, int *endOffset) const;
|
||||
int cursorPosition() const;
|
||||
QRect characterRect(int offset) const;
|
||||
int selectionCount() const;
|
||||
int offsetAtPoint(const QPoint &point) const;
|
||||
// selection
|
||||
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
|
||||
int selectionCount() const;
|
||||
void addSelection(int startOffset, int endOffset);
|
||||
void removeSelection(int selectionIndex);
|
||||
void setSelection(int selectionIndex, int startOffset, int endOffset);
|
||||
|
||||
// cursor
|
||||
int cursorPosition() const;
|
||||
void setCursorPosition(int position);
|
||||
|
||||
// text
|
||||
QString text(int startOffset, int endOffset) const;
|
||||
QString textBeforeOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
||||
int *startOffset, int *endOffset) const;
|
||||
|
|
@ -90,11 +95,13 @@ public:
|
|||
int *startOffset, int *endOffset) const;
|
||||
QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
|
||||
int *startOffset, int *endOffset) const;
|
||||
void removeSelection(int selectionIndex);
|
||||
void setCursorPosition(int position);
|
||||
void setSelection(int selectionIndex, int startOffset, int endOffset);
|
||||
int characterCount() const;
|
||||
|
||||
// character <-> geometry
|
||||
QRect characterRect(int offset) const;
|
||||
int offsetAtPoint(const QPoint &point) const;
|
||||
|
||||
QString attributes(int offset, int *startOffset, int *endOffset) const;
|
||||
|
||||
// QAccessibleEditableTextInterface
|
||||
void deleteText(int startOffset, int endOffset);
|
||||
|
|
|
|||
Loading…
Reference in New Issue