Avoid potential negative array index access to cached text.
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccAction.h
blob7fcff081052334475e1ff5250efeb83b331f7083
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include "Resource.h" // main symbols
23 #include "AccActionBase.h"
25 /**
26 * CAccAction implements IAccessibleAction interface.
28 class ATL_NO_VTABLE CAccAction :
29 public CComObjectRoot,
30 public CComCoClass<CAccAction, &CLSID_AccAction>,
31 public IAccessibleAction,
32 public CAccActionBase
34 public:
35 CAccAction()
40 DECLARE_NO_REGISTRY()
42 BEGIN_COM_MAP(CAccAction)
43 COM_INTERFACE_ENTRY(IAccessibleAction)
44 COM_INTERFACE_ENTRY(IUNOXWrapper)
45 COM_INTERFACE_ENTRY_FUNC_BLIND(0,SmartQI_)
46 #if defined __clang__
47 #pragma clang diagnostic push
48 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
49 #endif
50 END_COM_MAP()
51 #if defined __clang__
52 #pragma clang diagnostic pop
53 #endif
55 static HRESULT WINAPI SmartQI_(void* pv,
56 REFIID iid, void** ppvObject, DWORD_PTR)
58 return static_cast<CAccAction*>(pv)->SmartQI(iid,ppvObject);
61 HRESULT SmartQI(REFIID iid, void** ppvObject)
63 if( m_pOuterUnknown )
64 return OuterQueryInterface(iid,ppvObject);
65 return E_FAIL;
68 // IAccessibleAction
69 public:
70 // IAccessibleAction
72 // Returns the number of action.
73 STDMETHOD(nActions)(/*[out,retval]*/long* nActions) override;
75 // Performs specified action on the object.
76 STDMETHOD(doAction)(/* [in] */ long actionIndex) override;
78 // Gets description of specified action.
79 STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description) override;
81 // added , 2006/06/28, for driver 07/11
82 // get the action name
83 STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name) override;
85 // get the localized action name
86 STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName) override;
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) override;
97 // Override of IUNOXWrapper.
98 STDMETHOD(put_XSubInterface)(hyper pXSubInterface) override;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */