1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef __ACCACTION_H_
23 #define __ACCACTION_H_
24 
25 #include "resource.h"       // main symbols
26 #include "AccActionBase.h"
27 
28 /**
29  * CAccAction implements IAccessibleAction interface.
30  */
31 class ATL_NO_VTABLE CAccAction :
32             public CComObjectRoot,
33             public CComCoClass<CAccAction, &CLSID_AccAction>,
34             public IAccessibleAction,
35             public CAccActionBase
36 {
37 public:
CAccAction()38     CAccAction()
39     {
40 
41     }
~CAccAction()42     ~CAccAction()
43     {
44 
45     }
46 
47     DECLARE_REGISTRY_RESOURCEID(IDR_ACCACTION)
48 
BEGIN_COM_MAP(CAccAction)49     BEGIN_COM_MAP(CAccAction)
50     COM_INTERFACE_ENTRY(IAccessibleAction)
51     COM_INTERFACE_ENTRY(IUNOXWrapper)
52     COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
53     END_COM_MAP()
54 
55     static HRESULT WINAPI _SmartQI(void* pv,
56                                    REFIID iid, void** ppvObject, DWORD)
57     {
58         return ((CAccAction*)pv)->SmartQI(iid,ppvObject);
59     }
60 
SmartQI(REFIID iid,void ** ppvObject)61     HRESULT SmartQI(REFIID iid, void** ppvObject)
62     {
63         if( m_pOuterUnknown )
64             return OuterQueryInterface(iid,ppvObject);
65         return E_FAIL;
66     }
67 
68     // IAccessibleAction
69 public:
70     // IAccessibleAction
71 
72     // Returns the number of action.
73     STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
74 
75     // Performs specified action on the object.
76     STDMETHOD(doAction)(/* [in] */ long actionIndex);
77 
78     // Gets description of specified action.
79     STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
80 
81     // added , 2006/06/28, for driver 07/11
82     // get the action name
83     STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
84 
85     // get the localized action name
86     STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
87 
88     // Returns key binding object (if any) associated with specified action
89     // key binding is string.
90     // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
91     STDMETHOD(get_keyBinding)(
92         /* [in] */ long actionIndex,
93         /* [in] */ long nMaxBinding,
94         /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
95         /* [retval][out] */ long __RPC_FAR *nBinding);
96 
97     // Overide of IUNOXWrapper.
98     STDMETHOD(put_XInterface)(long pXInterface);
99 
100     // Overide of IUNOXWrapper.
101     STDMETHOD(put_XSubInterface)(long pXSubInterface);
102 
103 };
104 
105 #endif //__ACCACTION_H_
106