~ubuntu-branches/ubuntu/wily/qtbase-opensource-src/wily

« back to all changes in this revision

Viewing changes to src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 12:46:17 UTC
  • Revision ID: package-import@ubuntu.com-20130205124617-c8jouts182j002fx
Tags: upstream-5.0.1+dfsg
ImportĀ upstreamĀ versionĀ 5.0.1+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
 
4
** Contact: http://www.qt-project.org/legal
 
5
**
 
6
** This file is part of the plugins of the Qt Toolkit.
 
7
**
 
8
** $QT_BEGIN_LICENSE:LGPL$
 
9
** Commercial License Usage
 
10
** Licensees holding valid commercial Qt licenses may use this file in
 
11
** accordance with the commercial license agreement provided with the
 
12
** Software or, alternatively, in accordance with the terms contained in
 
13
** a written agreement between you and Digia.  For licensing terms and
 
14
** conditions see http://qt.digia.com/licensing.  For further information
 
15
** use the contact form at http://qt.digia.com/contact-us.
 
16
**
 
17
** GNU Lesser General Public License Usage
 
18
** Alternatively, this file may be used under the terms of the GNU Lesser
 
19
** General Public License version 2.1 as published by the Free Software
 
20
** Foundation and appearing in the file LICENSE.LGPL included in the
 
21
** packaging of this file.  Please review the following information to
 
22
** ensure the GNU Lesser General Public License version 2.1 requirements
 
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
24
**
 
25
** In addition, as a special exception, Digia gives you certain additional
 
26
** rights.  These rights are described in the Digia Qt LGPL Exception
 
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
28
**
 
29
** GNU General Public License Usage
 
30
** Alternatively, this file may be used under the terms of the GNU
 
31
** General Public License version 3.0 as published by the Free Software
 
32
** Foundation and appearing in the file LICENSE.GPL included in the
 
33
** packaging of this file.  Please review the following information to
 
34
** ensure the GNU General Public License version 3.0 requirements will be
 
35
** met: http://www.gnu.org/copyleft/gpl.html.
 
36
**
 
37
**
 
38
** $QT_END_LICENSE$
 
39
**
 
40
****************************************************************************/
 
41
#ifndef QWINDOWSMSAAACCESSIBLE_H
 
42
#define QWINDOWSMSAAACCESSIBLE_H
 
43
 
 
44
#include <QtCore/QtConfig>
 
45
#ifndef QT_NO_ACCESSIBILITY
 
46
#include <QtCore/qglobal.h>
 
47
 
 
48
#include "../qtwindows_additional.h"
 
49
#include <QtCore/qsharedpointer.h>
 
50
#include <QtGui/qaccessible.h>
 
51
#ifndef Q_CC_MINGW
 
52
# include <oleacc.h>
 
53
# include "Accessible2.h"   // IAccessible2 inherits from IAccessible
 
54
#else
 
55
    // MinGW
 
56
# include <basetyps.h>
 
57
# include <oleacc.h>
 
58
#endif
 
59
 
 
60
QT_BEGIN_NAMESPACE
 
61
 
 
62
#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_OUTPUT)
 
63
bool debug_accessibility();
 
64
# define accessibleDebug !debug_accessibility() ? (void)0 : qDebug
 
65
#else
 
66
# define accessibleDebug
 
67
#endif
 
68
 
 
69
#ifndef QT_NO_DEBUG_OUTPUT
 
70
#define DEBUG_SHOW_ATCLIENT_COMMANDS
 
71
#endif
 
72
#if defined(DEBUG_SHOW_ATCLIENT_COMMANDS)
 
73
void accessibleDebugClientCalls_helper(const char* funcName, const QAccessibleInterface *iface);
 
74
# define accessibleDebugClientCalls(iface) accessibleDebugClientCalls_helper(Q_FUNC_INFO, iface)
 
75
#else
 
76
# define accessibleDebugClientCalls(iface)
 
77
#endif
 
78
 
 
79
typedef QSharedPointer<QAccessibleInterface> QAIPointer;
 
80
 
 
81
QWindow *window_helper(const QAccessibleInterface *iface);
 
82
 
 
83
/**************************************************************\
 
84
 *                     QWindowsAccessible                     *
 
85
 **************************************************************/
 
86
class QWindowsMsaaAccessible : public
 
87
#ifdef Q_CC_MINGW
 
88
        IAccessible
 
89
#else
 
90
        IAccessible2
 
91
#endif
 
92
        , public IOleWindow
 
93
{
 
94
public:
 
95
    QWindowsMsaaAccessible(QAccessibleInterface *a)
 
96
        : accessible(a)
 
97
        , ref(0)
 
98
    {
 
99
    }
 
100
 
 
101
    virtual ~QWindowsMsaaAccessible()
 
102
    {
 
103
        delete accessible;
 
104
    }
 
105
 
 
106
    /* IUnknown */
 
107
    HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *);
 
108
    ULONG STDMETHODCALLTYPE AddRef();
 
109
    ULONG STDMETHODCALLTYPE Release();
 
110
 
 
111
    /* IDispatch */
 
112
    HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int *);
 
113
    HRESULT STDMETHODCALLTYPE GetTypeInfo(unsigned int, unsigned long, ITypeInfo **);
 
114
    HRESULT STDMETHODCALLTYPE GetIDsOfNames(const _GUID &, wchar_t **, unsigned int, unsigned long, long *);
 
115
    HRESULT STDMETHODCALLTYPE Invoke(long, const _GUID &, unsigned long, unsigned short, tagDISPPARAMS *, tagVARIANT *, tagEXCEPINFO *, unsigned int *);
 
116
 
 
117
    /* IAccessible */
 
118
    HRESULT STDMETHODCALLTYPE accHitTest(long xLeft, long yTop, VARIANT *pvarID);
 
119
    HRESULT STDMETHODCALLTYPE accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varID);
 
120
    HRESULT STDMETHODCALLTYPE accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEnd);
 
121
    HRESULT STDMETHODCALLTYPE get_accChild(VARIANT varChildID, IDispatch** ppdispChild);
 
122
    HRESULT STDMETHODCALLTYPE get_accChildCount(long* pcountChildren);
 
123
    HRESULT STDMETHODCALLTYPE get_accParent(IDispatch** ppdispParent);
 
124
 
 
125
    HRESULT STDMETHODCALLTYPE accDoDefaultAction(VARIANT varID);
 
126
    HRESULT STDMETHODCALLTYPE get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction);
 
127
    HRESULT STDMETHODCALLTYPE get_accDescription(VARIANT varID, BSTR* pszDescription);
 
128
    HRESULT STDMETHODCALLTYPE get_accHelp(VARIANT varID, BSTR *pszHelp);
 
129
    HRESULT STDMETHODCALLTYPE get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, long *pidTopic);
 
130
    HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut(VARIANT varID, BSTR *pszKeyboardShortcut);
 
131
    HRESULT STDMETHODCALLTYPE get_accName(VARIANT varID, BSTR* pszName);
 
132
    HRESULT STDMETHODCALLTYPE put_accName(VARIANT varChild, BSTR szName);
 
133
    HRESULT STDMETHODCALLTYPE get_accRole(VARIANT varID, VARIANT *pvarRole);
 
134
    HRESULT STDMETHODCALLTYPE get_accState(VARIANT varID, VARIANT *pvarState);
 
135
    HRESULT STDMETHODCALLTYPE get_accValue(VARIANT varID, BSTR* pszValue);
 
136
    HRESULT STDMETHODCALLTYPE put_accValue(VARIANT varChild, BSTR szValue);
 
137
 
 
138
    HRESULT STDMETHODCALLTYPE accSelect(long flagsSelect, VARIANT varID);
 
139
    HRESULT STDMETHODCALLTYPE get_accFocus(VARIANT *pvarID);
 
140
    HRESULT STDMETHODCALLTYPE get_accSelection(VARIANT *pvarChildren);
 
141
 
 
142
    /* IOleWindow */
 
143
    HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd);
 
144
    HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
 
145
 
 
146
protected:
 
147
    virtual QByteArray IIDToString(REFIID id);
 
148
 
 
149
    QAccessibleInterface *accessible;
 
150
 
 
151
    QAIPointer childPointer(VARIANT varID)
 
152
    {
 
153
        return QAIPointer(accessible->child(varID.lVal - 1));
 
154
    }
 
155
 
 
156
private:
 
157
    ULONG ref;
 
158
 
 
159
};
 
160
 
 
161
QT_END_NAMESPACE
 
162
 
 
163
#endif //QT_NO_ACCESSIBILITY
 
164
 
 
165
#endif // QWINDOWSMSAAACCESSIBLE_H