Qt 4.8
Public Functions | Properties | List of all members
QAccessibleSimpleEditableTextInterface Class Reference

The QAccessibleSimpleEditableTextInterface class is a convenience class for text-based widgets. More...

#include <qaccessible2.h>

Inheritance diagram for QAccessibleSimpleEditableTextInterface:
QAccessibleEditableTextInterface QAccessible2Interface QAccessibleLineEdit

Public Functions

void copyText (int startOffset, int endOffset)
 
void cutText (int startOffset, int endOffset)
 
void deleteText (int startOffset, int endOffset)
 
void insertText (int offset, const QString &text)
 
void pasteText (int offset)
 
 QAccessibleSimpleEditableTextInterface (QAccessibleInterface *accessibleInterface)
 
void replaceText (int startOffset, int endOffset, const QString &text)
 
void setAttributes (int, int, const QString &)
 
- Public Functions inherited from QAccessibleEditableTextInterface
QAccessible2InterfaceqAccessibleEditableTextCastHelper ()
 
virtual ~QAccessibleEditableTextInterface ()
 
- Public Functions inherited from QAccessible2Interface
virtual ~QAccessible2Interface ()
 

Properties

QAccessibleInterfaceiface
 

Detailed Description

The QAccessibleSimpleEditableTextInterface class is a convenience class for text-based widgets.

Warning
This function is not part of the public interface. This function is under development and subject to change.

http://www.linux-foundation.org/en/Accessibility/IAccessible2 Specification

Definition at line 176 of file qaccessible2.h.

Constructors and Destructors

◆ QAccessibleSimpleEditableTextInterface()

QAccessibleSimpleEditableTextInterface::QAccessibleSimpleEditableTextInterface ( QAccessibleInterface accessibleInterface)

Definition at line 268 of file qaccessible2.cpp.

270  : iface(accessibleInterface)
271 {
272  Q_ASSERT(iface);
273 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

Functions

◆ copyText()

void QAccessibleSimpleEditableTextInterface::copyText ( int  startOffset,
int  endOffset 
)
virtual

Implements QAccessibleEditableTextInterface.

Definition at line 282 of file qaccessible2.cpp.

283 {
284 #ifdef QT_NO_CLIPBOARD
285  Q_UNUSED(startOffset);
286  Q_UNUSED(endOffset);
287 #else
288  QApplication::clipboard()->setText(textForRange(iface, startOffset, endOffset));
289 #endif
290 }
void setText(const QString &, Mode mode=Clipboard)
Copies text into the clipboard as plain text.
Definition: qclipboard.cpp:375
static QString textForRange(QAccessibleInterface *iface, int startOffset, int endOffset)
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ cutText()

void QAccessibleSimpleEditableTextInterface::cutText ( int  startOffset,
int  endOffset 
)
virtual

Implements QAccessibleEditableTextInterface.

Definition at line 306 of file qaccessible2.cpp.

307 {
308 #ifdef QT_NO_CLIPBOARD
309  Q_UNUSED(startOffset);
310  Q_UNUSED(endOffset);
311 #else
312  QString sub = textForRange(iface, startOffset, endOffset);
313  deleteText(startOffset, endOffset);
315 #endif
316 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
void setText(const QString &, Mode mode=Clipboard)
Copies text into the clipboard as plain text.
Definition: qclipboard.cpp:375
static QString textForRange(QAccessibleInterface *iface, int startOffset, int endOffset)
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
void deleteText(int startOffset, int endOffset)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ deleteText()

void QAccessibleSimpleEditableTextInterface::deleteText ( int  startOffset,
int  endOffset 
)
virtual

Implements QAccessibleEditableTextInterface.

Definition at line 292 of file qaccessible2.cpp.

Referenced by cutText().

293 {
295  txt.remove(startOffset, endOffset - startOffset);
296  iface->setText(QAccessible::Value, 0, txt);
297 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual QString text(Text t, int child) const =0
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
Definition: qstring.cpp:1867
virtual void setText(Text t, int child, const QString &text)=0
Sets the text property t of the object, or of the object&#39;s child if child is not 0, to text.

◆ insertText()

void QAccessibleSimpleEditableTextInterface::insertText ( int  offset,
const QString text 
)
virtual

Implements QAccessibleEditableTextInterface.

Definition at line 299 of file qaccessible2.cpp.

300 {
302  txt.insert(offset, text);
303  iface->setText(QAccessible::Value, 0, txt);
304 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual QString text(Text t, int child) const =0
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671
virtual void setText(Text t, int child, const QString &text)=0
Sets the text property t of the object, or of the object&#39;s child if child is not 0, to text.

◆ pasteText()

void QAccessibleSimpleEditableTextInterface::pasteText ( int  offset)
virtual

Implements QAccessibleEditableTextInterface.

Definition at line 318 of file qaccessible2.cpp.

319 {
320 #ifdef QT_NO_CLIPBOARD
321  Q_UNUSED(offset);
322 #else
324  txt.insert(offset, QApplication::clipboard()->text());
325  iface->setText(QAccessible::Value, 0, txt);
326 #endif
327 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
virtual QString text(Text t, int child) const =0
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
QString & insert(int i, QChar c)
Definition: qstring.cpp:1671
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
virtual void setText(Text t, int child, const QString &text)=0
Sets the text property t of the object, or of the object&#39;s child if child is not 0, to text.
#define text
Definition: qobjectdefs.h:80

◆ replaceText()

void QAccessibleSimpleEditableTextInterface::replaceText ( int  startOffset,
int  endOffset,
const QString text 
)
virtual

Implements QAccessibleEditableTextInterface.

Definition at line 329 of file qaccessible2.cpp.

330 {
332  txt.replace(startOffset, endOffset - startOffset, text);
333  iface->setText(QAccessible::Value, 0, txt);
334 }
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual QString text(Text t, int child) const =0
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
virtual void setText(Text t, int child, const QString &text)=0
Sets the text property t of the object, or of the object&#39;s child if child is not 0, to text.

◆ setAttributes()

void QAccessibleSimpleEditableTextInterface::setAttributes ( int  ,
int  ,
const QString  
)
inlinevirtual

Implements QAccessibleEditableTextInterface.

Definition at line 187 of file qaccessible2.h.

187 {}

Properties

◆ iface

QAccessibleInterface* QAccessibleSimpleEditableTextInterface::iface
private

The documentation for this class was generated from the following files: