Fix casting. Casting is now done through the virtual interface_cast.
Change interface_cast to return void* to avoid using virtual inheritance. Get rid of the magic Q_ACCESSIBLE_OBJECT macro. Change-Id: I94b824aef53f2ba657d39d406b387c8681d47ee4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This commit is contained in:
parent
55c3799bd3
commit
84e66f69ae
@ -1203,12 +1203,6 @@ QVariant QAccessibleInterface::virtual_hook(const QVariant &)
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \internal */
|
|
||||||
QAccessible2Interface *QAccessibleInterface::cast_helper(QAccessible2::InterfaceType t)
|
|
||||||
{
|
|
||||||
return interface_cast(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
|
Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
|
||||||
{
|
{
|
||||||
|
@ -309,6 +309,17 @@ public:
|
|||||||
BackgroundColor = 4
|
BackgroundColor = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum InterfaceType
|
||||||
|
{
|
||||||
|
TextInterface,
|
||||||
|
EditableTextInterface,
|
||||||
|
ValueInterface,
|
||||||
|
TableInterface,
|
||||||
|
ActionInterface,
|
||||||
|
ImageInterface,
|
||||||
|
Table2Interface
|
||||||
|
};
|
||||||
|
|
||||||
typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*);
|
typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*);
|
||||||
typedef void(*UpdateHandler)(QObject*, int who, Event reason);
|
typedef void(*UpdateHandler)(QObject*, int who, Event reason);
|
||||||
typedef void(*RootObjectHandler)(QObject*);
|
typedef void(*RootObjectHandler)(QObject*);
|
||||||
@ -336,20 +347,6 @@ QT_END_NAMESPACE
|
|||||||
Q_DECLARE_METATYPE(QSet<QAccessible::Method>)
|
Q_DECLARE_METATYPE(QSet<QAccessible::Method>)
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QAccessible2
|
|
||||||
{
|
|
||||||
enum InterfaceType
|
|
||||||
{
|
|
||||||
TextInterface,
|
|
||||||
EditableTextInterface,
|
|
||||||
ValueInterface,
|
|
||||||
TableInterface,
|
|
||||||
ActionInterface,
|
|
||||||
ImageInterface,
|
|
||||||
Table2Interface
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
class QAccessible2Interface;
|
class QAccessible2Interface;
|
||||||
class QAccessibleTextInterface;
|
class QAccessibleTextInterface;
|
||||||
class QAccessibleEditableTextInterface;
|
class QAccessibleEditableTextInterface;
|
||||||
@ -397,33 +394,31 @@ public:
|
|||||||
{ return qvariant_cast<QSet<Method> >(invokeMethod(ListSupportedMethods)); }
|
{ return qvariant_cast<QSet<Method> >(invokeMethod(ListSupportedMethods)); }
|
||||||
|
|
||||||
inline QAccessibleTextInterface *textInterface()
|
inline QAccessibleTextInterface *textInterface()
|
||||||
{ return reinterpret_cast<QAccessibleTextInterface *>(cast_helper(QAccessible2::TextInterface)); }
|
{ return reinterpret_cast<QAccessibleTextInterface *>(interface_cast(QAccessible::TextInterface)); }
|
||||||
|
|
||||||
inline QAccessibleEditableTextInterface *editableTextInterface()
|
inline QAccessibleEditableTextInterface *editableTextInterface()
|
||||||
{ return reinterpret_cast<QAccessibleEditableTextInterface *>(cast_helper(QAccessible2::EditableTextInterface)); }
|
{ return reinterpret_cast<QAccessibleEditableTextInterface *>(interface_cast(QAccessible::EditableTextInterface)); }
|
||||||
|
|
||||||
inline QAccessibleValueInterface *valueInterface()
|
inline QAccessibleValueInterface *valueInterface()
|
||||||
{ return reinterpret_cast<QAccessibleValueInterface *>(cast_helper(QAccessible2::ValueInterface)); }
|
{ return reinterpret_cast<QAccessibleValueInterface *>(interface_cast(QAccessible::ValueInterface)); }
|
||||||
|
|
||||||
inline QAccessibleTableInterface *tableInterface()
|
inline QAccessibleTableInterface *tableInterface()
|
||||||
{ return reinterpret_cast<QAccessibleTableInterface *>(cast_helper(QAccessible2::TableInterface)); }
|
{ return reinterpret_cast<QAccessibleTableInterface *>(interface_cast(QAccessible::TableInterface)); }
|
||||||
|
|
||||||
inline QAccessibleActionInterface *actionInterface()
|
inline QAccessibleActionInterface *actionInterface()
|
||||||
{ return reinterpret_cast<QAccessibleActionInterface *>(cast_helper(QAccessible2::ActionInterface)); }
|
{ return reinterpret_cast<QAccessibleActionInterface *>(interface_cast(QAccessible::ActionInterface)); }
|
||||||
|
|
||||||
inline QAccessibleImageInterface *imageInterface()
|
inline QAccessibleImageInterface *imageInterface()
|
||||||
{ return reinterpret_cast<QAccessibleImageInterface *>(cast_helper(QAccessible2::ImageInterface)); }
|
{ return reinterpret_cast<QAccessibleImageInterface *>(interface_cast(QAccessible::ImageInterface)); }
|
||||||
|
|
||||||
inline QAccessibleTable2Interface *table2Interface()
|
inline QAccessibleTable2Interface *table2Interface()
|
||||||
{ return reinterpret_cast<QAccessibleTable2Interface *>(cast_helper(QAccessible2::Table2Interface)); }
|
{ return reinterpret_cast<QAccessibleTable2Interface *>(interface_cast(QAccessible::Table2Interface)); }
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
virtual QVariant virtual_hook(const QVariant &data);
|
virtual QVariant virtual_hook(const QVariant &data);
|
||||||
virtual QAccessible2Interface *interface_cast(QAccessible2::InterfaceType)
|
virtual void *interface_cast(QAccessible::InterfaceType)
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QAccessible2Interface *cast_helper(QAccessible2::InterfaceType);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QAccessibleEvent : public QEvent
|
class QAccessibleEvent : public QEvent
|
||||||
|
@ -91,50 +91,9 @@ namespace QAccessible2
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleTextInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~QAccessible2Interface() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
// catch-all functions. If an accessible class doesn't implement interface T, return 0
|
|
||||||
inline QAccessible2Interface *qAccessibleValueCastHelper() { return 0; }
|
|
||||||
inline QAccessible2Interface *qAccessibleTextCastHelper() { return 0; }
|
|
||||||
inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return 0; }
|
|
||||||
inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; }
|
|
||||||
inline QAccessible2Interface *qAccessibleActionCastHelper() { return 0; }
|
|
||||||
inline QAccessible2Interface *qAccessibleImageCastHelper() { return 0; }
|
|
||||||
inline QAccessible2Interface *qAccessibleTable2CastHelper() { return 0; }
|
|
||||||
|
|
||||||
#define Q_ACCESSIBLE_OBJECT \
|
|
||||||
public: \
|
|
||||||
QAccessible2Interface *interface_cast(QAccessible2::InterfaceType t) \
|
|
||||||
{ \
|
|
||||||
switch (t) { \
|
|
||||||
case QAccessible2::TextInterface: \
|
|
||||||
return qAccessibleTextCastHelper(); \
|
|
||||||
case QAccessible2::EditableTextInterface: \
|
|
||||||
return qAccessibleEditableTextCastHelper(); \
|
|
||||||
case QAccessible2::ValueInterface: \
|
|
||||||
return qAccessibleValueCastHelper(); \
|
|
||||||
case QAccessible2::TableInterface: \
|
|
||||||
return qAccessibleTableCastHelper(); \
|
|
||||||
case QAccessible2::ActionInterface: \
|
|
||||||
return qAccessibleActionCastHelper(); \
|
|
||||||
case QAccessible2::ImageInterface: \
|
|
||||||
return qAccessibleImageCastHelper(); \
|
|
||||||
case QAccessible2::Table2Interface: \
|
|
||||||
return qAccessibleTable2CastHelper(); \
|
|
||||||
} \
|
|
||||||
return 0; \
|
|
||||||
} \
|
|
||||||
private:
|
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleTextInterface: public QAccessible2Interface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
inline QAccessible2Interface *qAccessibleTextCastHelper() { return this; }
|
|
||||||
|
|
||||||
virtual ~QAccessibleTextInterface() {}
|
virtual ~QAccessibleTextInterface() {}
|
||||||
|
|
||||||
virtual void addSelection(int startOffset, int endOffset) = 0;
|
virtual void addSelection(int startOffset, int endOffset) = 0;
|
||||||
@ -158,11 +117,9 @@ public:
|
|||||||
virtual void scrollToSubstring(int startIndex, int endIndex) = 0;
|
virtual void scrollToSubstring(int startIndex, int endIndex) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleEditableTextInterface: public QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleEditableTextInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return this; }
|
|
||||||
|
|
||||||
virtual ~QAccessibleEditableTextInterface() {}
|
virtual ~QAccessibleEditableTextInterface() {}
|
||||||
|
|
||||||
virtual void copyText(int startOffset, int endOffset) = 0;
|
virtual void copyText(int startOffset, int endOffset) = 0;
|
||||||
@ -177,7 +134,7 @@ public:
|
|||||||
class Q_GUI_EXPORT QAccessibleSimpleEditableTextInterface: public QAccessibleEditableTextInterface
|
class Q_GUI_EXPORT QAccessibleSimpleEditableTextInterface: public QAccessibleEditableTextInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QAccessibleSimpleEditableTextInterface(QAccessibleInterface *accessibleInterface);
|
QAccessibleSimpleEditableTextInterface(QAccessibleInterface *accessibleInterface); //###
|
||||||
|
|
||||||
void copyText(int startOffset, int endOffset);
|
void copyText(int startOffset, int endOffset);
|
||||||
void deleteText(int startOffset, int endOffset);
|
void deleteText(int startOffset, int endOffset);
|
||||||
@ -191,10 +148,9 @@ private:
|
|||||||
QAccessibleInterface *iface;
|
QAccessibleInterface *iface;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleValueInterface: public QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleValueInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessible2Interface *qAccessibleValueCastHelper() { return this; }
|
|
||||||
|
|
||||||
virtual ~QAccessibleValueInterface() {}
|
virtual ~QAccessibleValueInterface() {}
|
||||||
|
|
||||||
@ -204,10 +160,10 @@ public:
|
|||||||
virtual QVariant minimumValue() = 0;
|
virtual QVariant minimumValue() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleTableInterface: public QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleTableInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessible2Interface *qAccessibleTableCastHelper() { return this; }
|
|
||||||
|
|
||||||
virtual QAccessibleInterface *accessibleAt(int row, int column) = 0;
|
virtual QAccessibleInterface *accessibleAt(int row, int column) = 0;
|
||||||
virtual QAccessibleInterface *caption() = 0;
|
virtual QAccessibleInterface *caption() = 0;
|
||||||
@ -267,10 +223,9 @@ public:
|
|||||||
virtual bool isExpandable() const = 0;
|
virtual bool isExpandable() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleTable2Interface: public QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleTable2Interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessible2Interface *qAccessibleTable2CastHelper() { return this; }
|
|
||||||
|
|
||||||
// Returns the cell at the specified row and column in the table.
|
// Returns the cell at the specified row and column in the table.
|
||||||
virtual QAccessibleTable2CellInterface *cellAt (int row, int column) const = 0;
|
virtual QAccessibleTable2CellInterface *cellAt (int row, int column) const = 0;
|
||||||
@ -327,11 +282,10 @@ friend class QAbstractItemView;
|
|||||||
friend class QAbstractItemViewPrivate;
|
friend class QAbstractItemViewPrivate;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleActionInterface: public QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleActionInterface
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(QAccessibleActionInterface)
|
Q_DECLARE_TR_FUNCTIONS(QAccessibleActionInterface)
|
||||||
public:
|
public:
|
||||||
inline QAccessible2Interface *qAccessibleActionCastHelper() { return this; }
|
|
||||||
|
|
||||||
virtual QStringList actionNames() const = 0;
|
virtual QStringList actionNames() const = 0;
|
||||||
virtual QString localizedActionName(const QString &name) const;
|
virtual QString localizedActionName(const QString &name) const;
|
||||||
@ -348,10 +302,9 @@ public:
|
|||||||
static const QString &uncheckAction();
|
static const QString &uncheckAction();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleImageInterface : public QAccessible2Interface
|
class Q_GUI_EXPORT QAccessibleImageInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessible2Interface *qAccessibleImageCastHelper() { return this; }
|
|
||||||
|
|
||||||
virtual QString imageDescription() = 0;
|
virtual QString imageDescription() = 0;
|
||||||
virtual QSize imageSize() = 0;
|
virtual QSize imageSize() = 0;
|
||||||
|
@ -78,7 +78,6 @@ private:
|
|||||||
|
|
||||||
class Q_GUI_EXPORT QAccessibleApplication : public QAccessibleObject
|
class Q_GUI_EXPORT QAccessibleApplication : public QAccessibleObject
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
QAccessibleApplication();
|
QAccessibleApplication();
|
||||||
|
|
||||||
|
@ -1451,12 +1451,18 @@ QAccessible::State QAccessibleHeader::state(int child) const
|
|||||||
|
|
||||||
class QAccessibleTabButton: public QAccessibleInterface, public QAccessibleActionInterface
|
class QAccessibleTabButton: public QAccessibleInterface, public QAccessibleActionInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
QAccessibleTabButton(QTabBar *parent, int index)
|
QAccessibleTabButton(QTabBar *parent, int index)
|
||||||
: m_parent(parent), m_index(index)
|
: m_parent(parent), m_index(index)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t) {
|
||||||
|
if (t == QAccessible::ActionInterface) {
|
||||||
|
return static_cast<QAccessibleActionInterface*>(this);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QObject *object() const { return 0; }
|
QObject *object() const { return 0; }
|
||||||
Role role() const { return QAccessible::PageTab; }
|
Role role() const { return QAccessible::PageTab; }
|
||||||
State state() const {
|
State state() const {
|
||||||
|
@ -103,7 +103,6 @@ public:
|
|||||||
#ifndef QT_NO_ITEMVIEWS
|
#ifndef QT_NO_ITEMVIEWS
|
||||||
class QAccessibleHeader : public QAccessibleWidget
|
class QAccessibleHeader : public QAccessibleWidget
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleHeader(QWidget *w);
|
explicit QAccessibleHeader(QWidget *w);
|
||||||
|
|
||||||
@ -162,7 +161,6 @@ private:
|
|||||||
|
|
||||||
class QAccessibleItemView: public QAccessibleAbstractScrollArea, public QAccessibleTableInterface
|
class QAccessibleItemView: public QAccessibleAbstractScrollArea, public QAccessibleTableInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleItemView(QWidget *w);
|
explicit QAccessibleItemView(QWidget *w);
|
||||||
|
|
||||||
@ -232,7 +230,6 @@ private:
|
|||||||
#ifndef QT_NO_TABBAR
|
#ifndef QT_NO_TABBAR
|
||||||
class QAccessibleTabBar : public QAccessibleWidget
|
class QAccessibleTabBar : public QAccessibleWidget
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleTabBar(QWidget *w);
|
explicit QAccessibleTabBar(QWidget *w);
|
||||||
|
|
||||||
@ -254,7 +251,6 @@ protected:
|
|||||||
#ifndef QT_NO_COMBOBOX
|
#ifndef QT_NO_COMBOBOX
|
||||||
class QAccessibleComboBox : public QAccessibleWidget
|
class QAccessibleComboBox : public QAccessibleWidget
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleComboBox(QWidget *w);
|
explicit QAccessibleComboBox(QWidget *w);
|
||||||
|
|
||||||
|
@ -470,6 +470,13 @@ QAccessible::Relation QAccessibleTable2::relationTo(const QAccessibleInterface *
|
|||||||
return QAccessible::Unrelated;
|
return QAccessible::Unrelated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleTable2::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::Table2Interface)
|
||||||
|
return static_cast<QAccessibleTable2Interface*>(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// TREE VIEW
|
// TREE VIEW
|
||||||
|
|
||||||
QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const
|
QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const
|
||||||
|
@ -60,7 +60,6 @@ class QAccessibleTable2HeaderCell;
|
|||||||
|
|
||||||
class QAccessibleTable2 :public QAccessibleTable2Interface, public QAccessibleObject
|
class QAccessibleTable2 :public QAccessibleTable2Interface, public QAccessibleObject
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleTable2(QWidget *w);
|
explicit QAccessibleTable2(QWidget *w);
|
||||||
|
|
||||||
@ -82,6 +81,7 @@ public:
|
|||||||
Relation relationTo(const QAccessibleInterface *other) const;
|
Relation relationTo(const QAccessibleInterface *other) const;
|
||||||
|
|
||||||
QVariant invokeMethod(Method, const QVariantList &) { return QVariant(); }
|
QVariant invokeMethod(Method, const QVariantList &) { return QVariant(); }
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// table2 interface
|
// table2 interface
|
||||||
virtual QAccessibleTable2CellInterface *cellAt(int row, int column) const;
|
virtual QAccessibleTable2CellInterface *cellAt(int row, int column) const;
|
||||||
|
@ -277,6 +277,13 @@ int QAccessibleMenuItem::navigate(RelationFlag relation, int entry, QAccessibleI
|
|||||||
return *target ? 0 : -1;
|
return *target ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleMenuItem::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::ActionInterface)
|
||||||
|
return static_cast<QAccessibleActionInterface*>(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QObject *QAccessibleMenuItem::object() const
|
QObject *QAccessibleMenuItem::object() const
|
||||||
{
|
{
|
||||||
return m_action;
|
return m_action;
|
||||||
|
@ -92,11 +92,12 @@ protected:
|
|||||||
|
|
||||||
class QAccessibleMenuItem : public QAccessibleInterface, public QAccessibleActionInterface
|
class QAccessibleMenuItem : public QAccessibleInterface, public QAccessibleActionInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleMenuItem(QWidget *owner, QAction *w);
|
explicit QAccessibleMenuItem(QWidget *owner, QAction *w);
|
||||||
|
|
||||||
virtual ~QAccessibleMenuItem();
|
virtual ~QAccessibleMenuItem();
|
||||||
|
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
virtual int childAt(int x, int y) const;
|
virtual int childAt(int x, int y) const;
|
||||||
virtual int childCount() const;
|
virtual int childCount() const;
|
||||||
virtual int indexOfChild(const QAccessibleInterface * child) const;
|
virtual int indexOfChild(const QAccessibleInterface * child) const;
|
||||||
|
@ -302,6 +302,15 @@ QVariant QAccessibleTextEdit::invokeMethod(QAccessible::Method method,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleTextEdit::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::TextInterface)
|
||||||
|
return static_cast<QAccessibleTextInterface*>(this);
|
||||||
|
else if (t == QAccessible::EditableTextInterface)
|
||||||
|
return static_cast<QAccessibleEditableTextInterface*>(this);
|
||||||
|
return QAccessibleWidget::interface_cast(t);
|
||||||
|
}
|
||||||
|
|
||||||
void QAccessibleTextEdit::addSelection(int startOffset, int endOffset)
|
void QAccessibleTextEdit::addSelection(int startOffset, int endOffset)
|
||||||
{
|
{
|
||||||
setSelection(0, startOffset, endOffset);
|
setSelection(0, startOffset, endOffset);
|
||||||
|
@ -69,7 +69,6 @@ class QMainWindow;
|
|||||||
class QAccessibleTextEdit : public QAccessibleWidget, public QAccessibleTextInterface,
|
class QAccessibleTextEdit : public QAccessibleWidget, public QAccessibleTextInterface,
|
||||||
public QAccessibleEditableTextInterface
|
public QAccessibleEditableTextInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleTextEdit(QWidget *o);
|
explicit QAccessibleTextEdit(QWidget *o);
|
||||||
|
|
||||||
@ -77,6 +76,7 @@ public:
|
|||||||
void setText(Text t, const QString &text);
|
void setText(Text t, const QString &text);
|
||||||
|
|
||||||
QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
|
QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleTextInterface
|
// QAccessibleTextInterface
|
||||||
void addSelection(int startOffset, int endOffset);
|
void addSelection(int startOffset, int endOffset);
|
||||||
@ -118,7 +118,6 @@ private:
|
|||||||
|
|
||||||
class QAccessibleStackedWidget : public QAccessibleWidget
|
class QAccessibleStackedWidget : public QAccessibleWidget
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleStackedWidget(QWidget *widget);
|
explicit QAccessibleStackedWidget(QWidget *widget);
|
||||||
|
|
||||||
@ -135,7 +134,6 @@ protected:
|
|||||||
|
|
||||||
class QAccessibleToolBox : public QAccessibleWidget
|
class QAccessibleToolBox : public QAccessibleWidget
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleToolBox(QWidget *widget);
|
explicit QAccessibleToolBox(QWidget *widget);
|
||||||
|
|
||||||
|
@ -87,6 +87,13 @@ QString QAccessibleAbstractSpinBox::text(Text t) const
|
|||||||
return QAccessibleWidget::text(t);
|
return QAccessibleWidget::text(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleAbstractSpinBox::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::ValueInterface)
|
||||||
|
return static_cast<QAccessibleValueInterface*>(this);
|
||||||
|
return QAccessibleWidget::interface_cast(t);
|
||||||
|
}
|
||||||
|
|
||||||
QVariant QAccessibleAbstractSpinBox::currentValue()
|
QVariant QAccessibleAbstractSpinBox::currentValue()
|
||||||
{
|
{
|
||||||
QVariant result = abstractSpinBox()->property("value");
|
QVariant result = abstractSpinBox()->property("value");
|
||||||
@ -244,6 +251,13 @@ QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, Role r)
|
|||||||
Q_ASSERT(qobject_cast<QAbstractSlider *>(w));
|
Q_ASSERT(qobject_cast<QAbstractSlider *>(w));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleAbstractSlider::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::ValueInterface)
|
||||||
|
return static_cast<QAccessibleValueInterface*>(this);
|
||||||
|
return QAccessibleWidget::interface_cast(t);
|
||||||
|
}
|
||||||
|
|
||||||
QVariant QAccessibleAbstractSlider::currentValue()
|
QVariant QAccessibleAbstractSlider::currentValue()
|
||||||
{
|
{
|
||||||
return abstractSlider()->value();
|
return abstractSlider()->value();
|
||||||
|
@ -60,11 +60,11 @@ class QDial;
|
|||||||
#ifndef QT_NO_SPINBOX
|
#ifndef QT_NO_SPINBOX
|
||||||
class QAccessibleAbstractSpinBox: public QAccessibleWidget, public QAccessibleValueInterface // TODO, public QAccessibleActionInterface
|
class QAccessibleAbstractSpinBox: public QAccessibleWidget, public QAccessibleValueInterface // TODO, public QAccessibleActionInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleAbstractSpinBox(QWidget *w);
|
explicit QAccessibleAbstractSpinBox(QWidget *w);
|
||||||
|
|
||||||
QString text(Text t) const;
|
QString text(Text t) const;
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleValueInterface
|
// QAccessibleValueInterface
|
||||||
QVariant currentValue();
|
QVariant currentValue();
|
||||||
@ -101,9 +101,9 @@ protected:
|
|||||||
|
|
||||||
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
|
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
|
explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleValueInterface
|
// QAccessibleValueInterface
|
||||||
QVariant currentValue();
|
QVariant currentValue();
|
||||||
|
@ -474,6 +474,13 @@ int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterfa
|
|||||||
return QAccessibleWidget::navigate(rel, entry, target);
|
return QAccessibleWidget::navigate(rel, entry, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleDisplay::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::ImageInterface)
|
||||||
|
return static_cast<QAccessibleImageInterface*>(this);
|
||||||
|
return QAccessibleWidget::interface_cast(t);
|
||||||
|
}
|
||||||
|
|
||||||
/*! \internal */
|
/*! \internal */
|
||||||
QString QAccessibleDisplay::imageDescription()
|
QString QAccessibleDisplay::imageDescription()
|
||||||
{
|
{
|
||||||
@ -614,6 +621,15 @@ QVariant QAccessibleLineEdit::invokeMethod(QAccessible::Method method,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleLineEdit::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::TextInterface)
|
||||||
|
return static_cast<QAccessibleTextInterface*>(this);
|
||||||
|
else if (t == QAccessible::EditableTextInterface)
|
||||||
|
return static_cast<QAccessibleEditableTextInterface*>(this);
|
||||||
|
return QAccessibleWidget::interface_cast(t);
|
||||||
|
}
|
||||||
|
|
||||||
void QAccessibleLineEdit::addSelection(int startOffset, int endOffset)
|
void QAccessibleLineEdit::addSelection(int startOffset, int endOffset)
|
||||||
{
|
{
|
||||||
setSelection(0, startOffset, endOffset);
|
setSelection(0, startOffset, endOffset);
|
||||||
@ -743,6 +759,13 @@ QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)
|
|||||||
Q_ASSERT(progressBar());
|
Q_ASSERT(progressBar());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleProgressBar::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::ValueInterface)
|
||||||
|
return static_cast<QAccessibleValueInterface*>(this);
|
||||||
|
return QAccessibleDisplay::interface_cast(t);
|
||||||
|
}
|
||||||
|
|
||||||
QVariant QAccessibleProgressBar::currentValue()
|
QVariant QAccessibleProgressBar::currentValue()
|
||||||
{
|
{
|
||||||
return progressBar()->value();
|
return progressBar()->value();
|
||||||
|
@ -57,7 +57,6 @@ class QProgressBar;
|
|||||||
|
|
||||||
class QAccessibleButton : public QAccessibleWidget
|
class QAccessibleButton : public QAccessibleWidget
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
Q_DECLARE_TR_FUNCTIONS(QAccessibleButton)
|
Q_DECLARE_TR_FUNCTIONS(QAccessibleButton)
|
||||||
public:
|
public:
|
||||||
QAccessibleButton(QWidget *w, Role r);
|
QAccessibleButton(QWidget *w, Role r);
|
||||||
@ -99,7 +98,6 @@ protected:
|
|||||||
|
|
||||||
class QAccessibleDisplay : public QAccessibleWidget, public QAccessibleImageInterface
|
class QAccessibleDisplay : public QAccessibleWidget, public QAccessibleImageInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleDisplay(QWidget *w, Role role = StaticText);
|
explicit QAccessibleDisplay(QWidget *w, Role role = StaticText);
|
||||||
|
|
||||||
@ -108,6 +106,7 @@ public:
|
|||||||
|
|
||||||
Relation relationTo(const QAccessibleInterface *other) const;
|
Relation relationTo(const QAccessibleInterface *other) const;
|
||||||
int navigate(RelationFlag, int entry, QAccessibleInterface **target) const;
|
int navigate(RelationFlag, int entry, QAccessibleInterface **target) const;
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleImageInterface
|
// QAccessibleImageInterface
|
||||||
QString imageDescription();
|
QString imageDescription();
|
||||||
@ -119,7 +118,6 @@ public:
|
|||||||
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface,
|
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface,
|
||||||
public QAccessibleSimpleEditableTextInterface
|
public QAccessibleSimpleEditableTextInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
|
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
|
||||||
|
|
||||||
@ -127,6 +125,7 @@ public:
|
|||||||
void setText(Text t, const QString &text);
|
void setText(Text t, const QString &text);
|
||||||
State state() const;
|
State state() const;
|
||||||
QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
|
QVariant invokeMethod(QAccessible::Method method, const QVariantList ¶ms);
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleTextInterface
|
// QAccessibleTextInterface
|
||||||
void addSelection(int startOffset, int endOffset);
|
void addSelection(int startOffset, int endOffset);
|
||||||
@ -157,9 +156,9 @@ protected:
|
|||||||
#ifndef QT_NO_PROGRESSBAR
|
#ifndef QT_NO_PROGRESSBAR
|
||||||
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface
|
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleProgressBar(QWidget *o);
|
explicit QAccessibleProgressBar(QWidget *o);
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleValueInterface
|
// QAccessibleValueInterface
|
||||||
QVariant currentValue();
|
QVariant currentValue();
|
||||||
|
@ -875,6 +875,13 @@ QColor QAccessibleWidget::backgroundColor() const
|
|||||||
return widget()->palette().color(widget()->backgroundRole());
|
return widget()->palette().color(widget()->backgroundRole());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *QAccessibleWidget::interface_cast(QAccessible::InterfaceType t)
|
||||||
|
{
|
||||||
|
if (t == QAccessible::ActionInterface)
|
||||||
|
return static_cast<QAccessibleActionInterface*>(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif //QT_NO_ACCESSIBILITY
|
#endif //QT_NO_ACCESSIBILITY
|
||||||
|
@ -56,7 +56,6 @@ class QAccessibleWidgetPrivate;
|
|||||||
|
|
||||||
class Q_WIDGETS_EXPORT QAccessibleWidget : public QAccessibleObject, public QAccessibleActionInterface
|
class Q_WIDGETS_EXPORT QAccessibleWidget : public QAccessibleObject, public QAccessibleActionInterface
|
||||||
{
|
{
|
||||||
Q_ACCESSIBLE_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QAccessibleWidget(QWidget *o, Role r = Client, const QString& name = QString());
|
explicit QAccessibleWidget(QWidget *o, Role r = Client, const QString& name = QString());
|
||||||
|
|
||||||
@ -79,6 +78,7 @@ public:
|
|||||||
QColor foregroundColor() const;
|
QColor foregroundColor() const;
|
||||||
QColor backgroundColor() const;
|
QColor backgroundColor() const;
|
||||||
|
|
||||||
|
void *interface_cast(QAccessible::InterfaceType t);
|
||||||
|
|
||||||
// QAccessibleActionInterface
|
// QAccessibleActionInterface
|
||||||
QStringList actionNames() const;
|
QStringList actionNames() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user