Eneboo - Documentación para desarrolladores
src/qt/include/qaccessible.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qaccessible.h   3.3.8   edited Jan 11 14:46 $
00003 **
00004 ** Definition of QAccessible and QAccessibleObject classes
00005 **
00006 ** Copyright (C) 2000-2007 Trolltech ASA.  All rights reserved.
00007 **
00008 ** This file is part of the kernel module of the Qt GUI Toolkit.
00009 **
00010 ** This file may be distributed under the terms of the Q Public License
00011 ** as defined by Trolltech ASA of Norway and appearing in the file
00012 ** LICENSE.QPL included in the packaging of this file.
00013 **
00014 ** This file may be distributed and/or modified under the terms of the
00015 ** GNU General Public License version 2 as published by the Free Software
00016 ** Foundation and appearing in the file LICENSE.GPL included in the
00017 ** packaging of this file.
00018 **
00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00020 ** licenses may use this file in accordance with the Qt Commercial License
00021 ** Agreement provided with the Software.
00022 **
00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00025 **
00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00027 **   information about Qt Commercial License Agreements.
00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00030 **
00031 ** Contact info@trolltech.com if any conditions of this licensing are
00032 ** not clear to you.
00033 **
00034 **********************************************************************/
00035 
00036 #ifndef QACCESSIBLE_H
00037 #define QACCESSIBLE_H
00038 
00039 #ifndef QT_H
00040 #include "qobject.h"
00041 #include <private/qcom_p.h>
00042 #include "qrect.h"
00043 #include "qguardedptr.h"
00044 #include "qmemarray.h"
00045 #endif // QT_H
00046 
00047 #if defined(QT_ACCESSIBILITY_SUPPORT)
00048 
00049 struct QAccessibleInterface;
00050 
00051 class Q_EXPORT QAccessible
00052 {
00053 private:
00054 #ifdef Q_WS_MAC
00055     static QMAC_PASCAL OSStatus globalEventProcessor(EventHandlerCallRef,  EventRef, void *);
00056     static QObject *queryAccessibleObject(QAccessibleInterface *);
00057 #endif
00058 public:
00059     enum Event {
00060         SoundPlayed         = 0x0001,
00061         Alert               = 0x0002,
00062         ForegroundChanged   = 0x0003,
00063         MenuStart           = 0x0004,
00064         MenuEnd             = 0x0005,
00065         PopupMenuStart      = 0x0006,
00066         PopupMenuEnd        = 0x0007,
00067         ContextHelpStart    = 0x000C,
00068         ContextHelpEnd      = 0x000D,
00069         DragDropStart       = 0x000E,
00070         DragDropEnd         = 0x000F,
00071         DialogStart         = 0x0010,
00072         DialogEnd           = 0x0011,
00073         ScrollingStart      = 0x0012,
00074         ScrollingEnd        = 0x0013,
00075 
00076         MenuCommand         = 0x0018,
00077 
00078         ObjectCreated       = 0x8000,
00079         ObjectDestroyed     = 0x8001,
00080         ObjectShow          = 0x8002,
00081         ObjectHide          = 0x8003,
00082         ObjectReorder       = 0x8004,
00083         Focus               = 0x8005,
00084         Selection           = 0x8006,
00085         SelectionAdd        = 0x8007,
00086         SelectionRemove     = 0x8008,
00087         SelectionWithin     = 0x8009,
00088         StateChanged        = 0x800A,
00089         LocationChanged     = 0x800B,
00090         NameChanged         = 0x800C,
00091         DescriptionChanged  = 0x800D,
00092         ValueChanged        = 0x800E,
00093         ParentChanged       = 0x800F,
00094         HelpChanged         = 0x80A0,
00095         DefaultActionChanged= 0x80B0,
00096         AcceleratorChanged  = 0x80C0
00097     };
00098 
00099     enum State {
00100         Normal          = 0x00000000,
00101         Unavailable     = 0x00000001,
00102         Selected        = 0x00000002,
00103         Focused         = 0x00000004,
00104         Pressed         = 0x00000008,
00105         Checked         = 0x00000010,
00106         Mixed           = 0x00000020,
00107         ReadOnly        = 0x00000040,
00108         HotTracked      = 0x00000080,
00109         Default         = 0x00000100,
00110         Expanded        = 0x00000200,
00111         Collapsed       = 0x00000400,
00112         Busy            = 0x00000800,
00113         Floating        = 0x00001000,
00114         Marqueed        = 0x00002000,
00115         Animated        = 0x00004000,
00116         Invisible       = 0x00008000,
00117         Offscreen       = 0x00010000,
00118         Sizeable        = 0x00020000,
00119         Moveable        = 0x00040000,
00120         SelfVoicing     = 0x00080000,
00121         Focusable       = 0x00100000,
00122         Selectable      = 0x00200000,
00123         Linked          = 0x00400000,
00124         Traversed       = 0x00800000,
00125         MultiSelectable = 0x01000000,
00126         ExtSelectable   = 0x02000000,
00127         AlertLow        = 0x04000000,
00128         AlertMedium     = 0x08000000,
00129         AlertHigh       = 0x10000000,
00130         Protected       = 0x20000000,
00131         Valid           = 0x3fffffff
00132     };
00133 
00134     enum Role {
00135         NoRole          = 0x00000000,
00136         TitleBar        = 0x00000001,
00137         MenuBar         = 0x00000002,
00138         ScrollBar       = 0x00000003,
00139         Grip            = 0x00000004,
00140         Sound           = 0x00000005,
00141         Cursor          = 0x00000006,
00142         Caret           = 0x00000007,
00143         AlertMessage    = 0x00000008,
00144         Window          = 0x00000009,
00145         Client          = 0x0000000A,
00146         PopupMenu       = 0x0000000B,
00147         MenuItem        = 0x0000000C,
00148         ToolTip         = 0x0000000D,
00149         Application     = 0x0000000E,
00150         Document        = 0x0000000F,
00151         Pane            = 0x00000010,
00152         Chart           = 0x00000011,
00153         Dialog          = 0x00000012,
00154         Border          = 0x00000013,
00155         Grouping        = 0x00000014,
00156         Separator       = 0x00000015,
00157         ToolBar         = 0x00000016,
00158         StatusBar       = 0x00000017,
00159         Table           = 0x00000018,
00160         ColumnHeader    = 0x00000019,
00161         RowHeader       = 0x0000001A,
00162         Column          = 0x0000001B,
00163         Row             = 0x0000001C,
00164         Cell            = 0x0000001D,
00165         Link            = 0x0000001E,
00166         HelpBalloon     = 0x0000001F,
00167         Character       = 0x00000020,
00168         List            = 0x00000021,
00169         ListItem        = 0x00000022,
00170         Outline         = 0x00000023,
00171         OutlineItem     = 0x00000024,
00172         PageTab         = 0x00000025,
00173         PropertyPage    = 0x00000026,
00174         Indicator       = 0x00000027,
00175         Graphic         = 0x00000028,
00176         StaticText      = 0x00000029,
00177         EditableText    = 0x0000002A,  // Editable, selectable, etc.
00178         PushButton      = 0x0000002B,
00179         CheckBox        = 0x0000002C,
00180         RadioButton     = 0x0000002D,
00181         ComboBox        = 0x0000002E,
00182         DropLest        = 0x0000002F,
00183         ProgressBar     = 0x00000030,
00184         Dial            = 0x00000031,
00185         HotkeyField     = 0x00000032,
00186         Slider          = 0x00000033,
00187         SpinBox         = 0x00000034,
00188         Diagram         = 0x00000035,
00189         Animation       = 0x00000036,
00190         Equation        = 0x00000037,
00191         ButtonDropDown  = 0x00000038,
00192         ButtonMenu      = 0x00000039,
00193         ButtonDropGrid  = 0x0000003A,
00194         Whitespace      = 0x0000003B,
00195         PageTabList     = 0x0000003C,
00196         Clock           = 0x0000003D
00197     };
00198 
00199     enum NavDirection {
00200         NavUp           = 0x00000001,
00201         NavDown         = 0x00000002,
00202         NavLeft         = 0x00000003,
00203         NavRight        = 0x00000004,
00204         NavNext         = 0x00000005,
00205         NavPrevious     = 0x00000006,
00206         NavFirstChild   = 0x00000007,
00207         NavLastChild    = 0x00000008,
00208         NavFocusChild   = 0x00000009
00209     };
00210 
00211     enum Text {
00212         Name            = 0,
00213         Description,
00214         Value,
00215         Help,
00216         Accelerator,
00217         DefaultAction
00218     };
00219 
00220     static QRESULT queryAccessibleInterface( QObject *, QAccessibleInterface ** );
00221     static void updateAccessibility( QObject *, int who, Event reason );
00222     static bool isActive();
00223 
00224     static void initialize();
00225     static void cleanup();
00226 };
00227 
00228 // {EC86CB9C-5DA0-4c43-A739-13EBDF1C6B14}
00229 #define IID_QAccessible QUuid( 0xec86cb9c, 0x5da0, 0x4c43, 0xa7, 0x39, 0x13, 0xeb, 0xdf, 0x1c, 0x6b, 0x14 )
00230 
00231 struct Q_EXPORT QAccessibleInterface : public QAccessible, public QUnknownInterface
00232 {
00233     // check for valid pointers
00234     virtual bool        isValid() const = 0;
00235 
00236     // hierarchy
00237     virtual int         childCount() const = 0;
00238     virtual QRESULT     queryChild( int control, QAccessibleInterface** ) const = 0;
00239     virtual QRESULT     queryParent( QAccessibleInterface** ) const = 0;
00240 
00241     // navigation
00242     virtual int         controlAt( int x, int y ) const = 0;
00243     virtual QRect       rect( int control ) const = 0;
00244     virtual int         navigate( NavDirection direction, int startControl ) const = 0;
00245 
00246     // properties and state
00247     virtual QString     text( Text t, int control ) const = 0;
00248     virtual void        setText( Text t, int control, const QString &text ) = 0;
00249     virtual Role        role( int control ) const = 0;
00250     virtual State       state( int control ) const = 0;
00251     virtual QMemArray<int> selection() const = 0;
00252 
00253     // methods
00254     virtual bool        doDefaultAction( int control ) = 0;
00255     virtual bool        setFocus( int control ) = 0;
00256     virtual bool        setSelected( int control, bool on, bool extend ) = 0;
00257     virtual void        clearSelection() = 0;    
00258 };
00259 
00260 // {49F4C6A7-412F-41DE-9E24-648843421FD3} 
00261 #ifndef IID_QAccessibleFactory
00262 #define IID_QAccessibleFactory QUuid( 0x49f4c6a7, 0x412f, 0x41de, 0x9e, 0x24, 0x64, 0x88, 0x43, 0x42, 0x1f, 0xd3 )
00263 #endif
00264 
00265 struct Q_EXPORT QAccessibleFactoryInterface : public QAccessible, public QFeatureListInterface
00266 {
00267     virtual QRESULT createAccessibleInterface( const QString &, QObject *, QAccessibleInterface** ) = 0;
00268 };
00269 
00270 class Q_EXPORT QAccessibleObject : public QObject, public QAccessibleInterface
00271 {
00272 public:
00273     QAccessibleObject( QObject *object );
00274     virtual ~QAccessibleObject();
00275 
00276     QRESULT     queryInterface( const QUuid &, QUnknownInterface** );
00277     Q_REFCOUNT
00278 
00279     bool        isValid() const;
00280 
00281 protected:
00282     QObject *object() const;
00283 
00284 private:
00285     QGuardedPtr<QObject> object_;
00286 };
00287 
00288 #define Q_DEFINED_QACCESSIBLE_OBJECT
00289 #include "qwinexport.h"
00290 #endif //QT_ACCESSIBILITY_SUPPORT
00291 
00292 #endif //QACCESSIBLE_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'