1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright IBM Corporation 2010.
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org.  If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #ifndef __ACCACTION_H_
30 #define __ACCACTION_H_
31 
32 #include "resource.h"       // main symbols
33 #include "AccActionBase.h"
34 
35 /**
36  * CAccAction implements IAccessibleAction interface.
37  */
38 class ATL_NO_VTABLE CAccAction :
39             public CComObjectRoot,
40             public CComCoClass<CAccAction, &CLSID_AccAction>,
41             public IAccessibleAction,
42             public CAccActionBase
43 {
44 public:
45     CAccAction()
46     {
47 
48     }
49     ~CAccAction()
50     {
51 
52     }
53 
54     DECLARE_REGISTRY_RESOURCEID(IDR_ACCACTION)
55 
56     BEGIN_COM_MAP(CAccAction)
57     COM_INTERFACE_ENTRY(IAccessibleAction)
58     COM_INTERFACE_ENTRY(IUNOXWrapper)
59     COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
60     END_COM_MAP()
61 
62     static HRESULT WINAPI _SmartQI(void* pv,
63                                    REFIID iid, void** ppvObject, DWORD)
64     {
65         return ((CAccAction*)pv)->SmartQI(iid,ppvObject);
66     }
67 
68     HRESULT SmartQI(REFIID iid, void** ppvObject)
69     {
70         if( m_pOuterUnknown )
71             return OuterQueryInterface(iid,ppvObject);
72         return E_FAIL;
73     }
74 
75     // IAccessibleAction
76 public:
77     // IAccessibleAction
78 
79     // Returns the number of action.
80     STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
81 
82     // Performs specified action on the object.
83     STDMETHOD(doAction)(/* [in] */ long actionIndex);
84 
85     // Gets description of specified action.
86     STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
87 
88     // added by qiuhd, 2006/06/28, for driver 07/11
89     // get the action name
90     STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
91 
92     // get the localized action name
93     STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
94 
95     // Returns key binding object (if any) associated with specified action
96     // key binding is string.
97     // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
98     STDMETHOD(get_keyBinding)(
99         /* [in] */ long actionIndex,
100         /* [in] */ long nMaxBinding,
101         /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
102         /* [retval][out] */ long __RPC_FAR *nBinding);
103 
104     // Overide of IUNOXWrapper.
105     STDMETHOD(put_XInterface)(long pXInterface);
106 
107     // Overide of IUNOXWrapper.
108     STDMETHOD(put_XSubInterface)(long pXSubInterface);
109 
110 };
111 
112 #endif //__ACCACTION_H_
113