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 //////////////////////////////////////////////////////////////////////
23 // AccActionBase.h: interface for the CAccActionBase class.
24 //////////////////////////////////////////////////////////////////////
25 
26 #if !defined(AFX_ACCACTIONBASE_H__F87FAD24_D66E_4D22_9B24_3304A303DC84__INCLUDED_)
27 #define AFX_ACCACTIONBASE_H__F87FAD24_D66E_4D22_9B24_3304A303DC84__INCLUDED_
28 
29 #if _MSC_VER > 1000
30 #pragma once
31 #endif // _MSC_VER > 1000
32 
33 #define WNT
34 
35 #include <com/sun/star/uno/reference.hxx>
36 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
37 #include "UNOXWrapper.h"
38 
39 class ATL_NO_VTABLE CAccActionBase  : public CUNOXWrapper
40 {
41 public:
42     CAccActionBase();
43     virtual ~CAccActionBase();
44 
45     // IAccessibleAction
46 public:
47     // IAccessibleAction
48 
49     // Returns the number of action.
50     STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
51 
52     // Performs specified action on the object.
53     STDMETHOD(doAction)(/* [in] */ long actionIndex);
54 
55     // Gets description of specified action.
56     STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
57 
58     // added , 2006/06/28, for driver 07/11
59     // get the action name
60     STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
61 
62     // get the localized action Name
63     STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
64 
65     // Returns key binding object (if any) associated with specified action
66     // key binding is string.
67     // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
68     STDMETHOD(get_keyBinding)(
69         /* [in] */ long actionIndex,
70         /* [in] */ long nMaxBinding,
71         /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
72         /* [retval][out] */ long __RPC_FAR *nBinding);
73 
74     // Overide of IUNOXWrapper.
75     STDMETHOD(put_XInterface)(long pXInterface);
76 
77     static void GetkeyBindingStrByXkeyBinding( const com::sun::star::uno::Sequence< com::sun::star::awt::KeyStroke > &keySet, OLECHAR* pString );
78 
79 protected:
80 
81     static OLECHAR* getOLECHARFromKeyCode(long key);
82 
83     com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleAction> pRXAct;
84 
85 private:
GetXInterface()86     inline com::sun::star::accessibility::XAccessibleAction* GetXInterface()
87     {
88         return pRXAct.get();
89     }
90 };
91 
92 #endif // !defined(AFX_ACCACTIONBASE_H__F87FAD24_D66E_4D22_9B24_3304A303DC84__INCLUDED_)
93