Qt 4.8
Public Functions | Static Public Functions | Private Types | Private Slots | Properties | List of all members
QAccessibleHierarchyManager Class Reference

#include <qaccessible_mac_p.h>

Inheritance diagram for QAccessibleHierarchyManager:
QObject

Public Functions

QAInterface lookup (const AXUIElementRef &element)
 
QAInterface lookup (const QAElement &element)
 
QAElement lookup (const QAInterface &interface)
 
QAElement lookup (QObject *const object, int id)
 
void registerChildren (const QAInterface &interface)
 
QAElement registerInterface (QObject *object, int child)
 
QAElement registerInterface (const QAInterface &interface)
 
void registerInterface (QObject *object, HIObjectRef hiobject, QInterfaceFactory *interfaceFactory)
 
void reset ()
 
 ~QAccessibleHierarchyManager ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Static Public Functions

static QAccessibleHierarchyManagerinstance ()
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 

Private Types

typedef QHash< HIObjectRef, QInterfaceFactory * > HIObjectInterfaceHash
 
typedef QHash< QObject *, QInterfaceFactory * > QObjectElementHash
 
typedef QHash< QObject *, HIObjectRefQObjectHIObjectHash
 

Private Slots

void objectDestroyed (QObject *)
 

Properties

HIObjectInterfaceHash hiobjectInterfaceHash
 
QObjectElementHash qobjectElementHash
 
QObjectHIObjectHash qobjectHiobjectHash
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 445 of file qaccessible_mac_p.h.

Typedefs

◆ HIObjectInterfaceHash

Definition at line 467 of file qaccessible_mac_p.h.

◆ QObjectElementHash

Definition at line 466 of file qaccessible_mac_p.h.

◆ QObjectHIObjectHash

Definition at line 468 of file qaccessible_mac_p.h.

Constructors and Destructors

◆ ~QAccessibleHierarchyManager()

QAccessibleHierarchyManager::~QAccessibleHierarchyManager ( )
inline

Definition at line 449 of file qaccessible_mac_p.h.

Functions

◆ instance()

QAccessibleHierarchyManager * QAccessibleHierarchyManager::instance ( )
static

Definition at line 587 of file qaccessible_mac.mm.

588 {
589  return accessibleHierarchyManager();
590 }

◆ lookup() [1/4]

QAInterface QAccessibleHierarchyManager::lookup ( const AXUIElementRef &  element)

Definition at line 760 of file qaccessible_mac.mm.

761 {
762  if (element == 0)
763  return QAInterface();
764 #ifndef QT_MAC_USE_COCOA
765  HIObjectRef hiObject = AXUIElementGetHIObject(element);
766 
767  QInterfaceFactory *factory = hiobjectInterfaceHash.value(hiObject);
768  if (factory == 0) {
769  return QAInterface();
770  }
771 
772  UInt64 id;
773  AXUIElementGetIdentifier(element, &id);
774  return factory->interface(id);
775 #else
776  return QAInterface();
777 #endif
778 }
HIObjectInterfaceHash hiobjectInterfaceHash
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
struct OpaqueHIObjectRef * HIObjectRef
virtual QAInterface interface(UInt64 identifier)=0

◆ lookup() [2/4]

QAInterface QAccessibleHierarchyManager::lookup ( const QAElement element)

Definition at line 780 of file qaccessible_mac.mm.

781 {
782  return lookup(element.element());
783 }
AXUIElementRef element() const
QAInterface lookup(const AXUIElementRef &element)

◆ lookup() [3/4]

QAElement QAccessibleHierarchyManager::lookup ( const QAInterface interface)

Definition at line 785 of file qaccessible_mac.mm.

786 {
787  if (interface.isValid() == false)
788  return QAElement();
789 
791  if (factory == 0)
792  return QAElement();
793 
794  return factory->element(interface);
795 }
QObjectElementHash qobjectElementHash
bool isValid() const
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
virtual QAElement element(int id)=0
QObject * object() const
QAInterface objectInterface() const

◆ lookup() [4/4]

QAElement QAccessibleHierarchyManager::lookup ( QObject *const  object,
int  id 
)

Definition at line 797 of file qaccessible_mac.mm.

798 {
799  QInterfaceFactory *factory = qobjectElementHash.value(object);
800  if (factory == 0)
801  return QAElement();
802 
803  return factory->element(id);
804 }
QObjectElementHash qobjectElementHash
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
virtual QAElement element(int id)=0

◆ objectDestroyed

void QAccessibleHierarchyManager::objectDestroyed ( QObject object)
privateslot

Definition at line 568 of file qaccessible_mac.mm.

569 {
570  HIObjectRef hiObject = qobjectHiobjectHash.value(object);
571  delete qobjectElementHash.value(object);
572  qobjectElementHash.remove(object);
573  hiobjectInterfaceHash.remove(hiObject);
574 }
QObjectElementHash qobjectElementHash
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
HIObjectInterfaceHash hiobjectInterfaceHash
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
struct OpaqueHIObjectRef * HIObjectRef
QObjectHIObjectHash qobjectHiobjectHash

◆ registerChildren()

void QAccessibleHierarchyManager::registerChildren ( const QAInterface interface)

Definition at line 746 of file qaccessible_mac.mm.

747 {
748  QObject * const object = interface.object();
749  if (object == 0)
750  return;
751 
752  QInterfaceFactory *interfaceFactory = qobjectElementHash.value(object);
753 
754  if (interfaceFactory == 0)
755  return;
756 
757  interfaceFactory->registerChildren();
758 }
QObjectElementHash qobjectElementHash
virtual void registerChildren()=0
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QObject * object() const

◆ registerInterface() [1/3]

QAElement QAccessibleHierarchyManager::registerInterface ( QObject object,
int  child 
)

Definition at line 684 of file qaccessible_mac.mm.

685 {
686 #ifndef QT_MAC_USE_COCOA
688 #else
689  Q_UNUSED(object);
690  Q_UNUSED(child);
691  return QAElement();
692 #endif
693 }
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...
QAElement registerInterface(QObject *object, int child)
#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

◆ registerInterface() [2/3]

QAElement QAccessibleHierarchyManager::registerInterface ( const QAInterface interface)

Definition at line 698 of file qaccessible_mac.mm.

699 {
700 #ifndef QT_MAC_USE_COCOA
701  if (interface.isValid() == false)
702  return QAElement();
703  QAInterface objectInterface = interface.objectInterface();
704 
705  QObject * qobject = objectInterface.object();
706  HIObjectRef hiobject = objectInterface.hiObject();
707  if (qobject == 0 || hiobject == 0)
708  return QAElement();
709 
710  if (qobjectElementHash.contains(qobject) == false) {
711  registerInterface(qobject, hiobject, createFactory(interface));
712  HIObjectSetAccessibilityIgnored(hiobject, !isItInteresting(interface));
713  }
714 
715  return QAElement(hiobject, interface.id());
716 #else
717  Q_UNUSED(interface);
718  return QAElement();
719 #endif
720 }
HIObjectRef hiObject() const
QObjectElementHash qobjectElementHash
bool isValid() const
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
QObject * object() const
int id() const
struct OpaqueHIObjectRef * HIObjectRef
QAInterface objectInterface() const
QAElement registerInterface(QObject *object, int child)
#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
static QInterfaceFactory * createFactory(const QAInterface &interface)
bool isItInteresting(const QAInterface &interface)

◆ registerInterface() [3/3]

void QAccessibleHierarchyManager::registerInterface ( QObject object,
HIObjectRef  hiobject,
QInterfaceFactory interfaceFactory 
)

Definition at line 726 of file qaccessible_mac.mm.

727 {
728 #ifndef QT_MAC_USE_COCOA
729  if (qobjectElementHash.contains(qobject) == false) {
730  qobjectElementHash.insert(qobject, interfaceFactory);
731  qobjectHiobjectHash.insert(qobject, hiobject);
733  }
734 
735  if (hiobjectInterfaceHash.contains(hiobject) == false) {
736  hiobjectInterfaceHash.insert(hiobject, interfaceFactory);
738  }
739 #else
740  Q_UNUSED(qobject);
741  Q_UNUSED(hiobject);
742  Q_UNUSED(interfaceFactory);
743 #endif
744 }
QObjectElementHash qobjectElementHash
static void installAcessibilityEventHandler(HIObjectRef hiObject)
#define SLOT(a)
Definition: qobjectdefs.h:226
HIObjectInterfaceHash hiobjectInterfaceHash
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
#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
QObjectHIObjectHash qobjectHiobjectHash

◆ reset()

void QAccessibleHierarchyManager::reset ( )

Definition at line 579 of file qaccessible_mac.mm.

580 {
585 }
QObjectElementHash qobjectElementHash
void clear()
Removes all items from the hash.
Definition: qhash.h:574
HIObjectInterfaceHash hiobjectInterfaceHash
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319
QObjectHIObjectHash qobjectHiobjectHash

Properties

◆ hiobjectInterfaceHash

HIObjectInterfaceHash QAccessibleHierarchyManager::hiobjectInterfaceHash
private

Definition at line 471 of file qaccessible_mac_p.h.

◆ qobjectElementHash

QObjectElementHash QAccessibleHierarchyManager::qobjectElementHash
private

Definition at line 470 of file qaccessible_mac_p.h.

◆ qobjectHiobjectHash

QObjectHIObjectHash QAccessibleHierarchyManager::qobjectHiobjectHash
private

Definition at line 472 of file qaccessible_mac_p.h.


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