Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccHyperLink.h
blob1af6adabbbd225debb8657c93606775ec1abeabf
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 #ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCHYPERLINK_H
21 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCHYPERLINK_H
23 #include "Resource.h" // main symbols
25 #include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
26 #include "AccActionBase.h"
27 #include "UNOXWrapper.h"
29 /**
30 * CAccHyperLink implements IAccessibleHyperlink interface.
32 class ATL_NO_VTABLE CAccHyperLink :
33 public CComObjectRoot,
34 public CComCoClass<CAccHyperLink,&CLSID_AccHyperLink>,
35 public IAccessibleHyperlink,
36 public CAccActionBase
38 public:
39 CAccHyperLink()
43 BEGIN_COM_MAP(CAccHyperLink)
44 COM_INTERFACE_ENTRY(IAccessibleAction)
45 COM_INTERFACE_ENTRY(IAccessibleHyperlink)
46 COM_INTERFACE_ENTRY(IUNOXWrapper)
47 #if defined __clang__
48 #pragma clang diagnostic push
49 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
50 #endif
51 END_COM_MAP()
52 #if defined __clang__
53 #pragma clang diagnostic pop
54 #endif
56 DECLARE_NO_REGISTRY()
58 static HRESULT WINAPI SmartQI_(void* pv,
59 REFIID iid, void** ppvObject, DWORD_PTR)
61 return static_cast<CAccHyperLink*>(pv)->SmartQI(iid,ppvObject);
64 HRESULT SmartQI(REFIID iid, void** ppvObject)
66 if( m_pOuterUnknown )
67 return OuterQueryInterface(iid,ppvObject);
68 return E_FAIL;
71 // IAccessibleHyperlink
72 public:
73 // IAccessibleAction
75 // Returns the number of action.
76 STDMETHOD(nActions)(/*[out,retval]*/long* nActions) override;
78 // Performs specified action on the object.
79 STDMETHOD(doAction)(/* [in] */ long actionIndex) override;
81 // get the action name
82 STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name) override;
84 // get the localized action name
85 STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName) override;
87 // Gets description of specified action.
88 STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description) override;
90 // Returns key binding object (if any) associated with specified action
91 // key binding is string.
92 // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
93 STDMETHOD(get_keyBinding)(
94 /* [in] */ long actionIndex,
95 /* [in] */ long nMaxBinding,
96 /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
97 /* [retval][out] */ long __RPC_FAR *nBinding) override;
99 // IAccessibleHyperlink
101 // get an object, e.g. BSTR or image object, that is overloaded with link behavior
102 STDMETHOD(get_anchor)(/* [in] */ long index,
103 /* [retval][out] */ VARIANT __RPC_FAR *anchor) override;
105 // get an object representing the target of the link, usually a BSTR of the URI
106 STDMETHOD(get_anchorTarget)(/* [in] */ long index,
107 /* [retval][out] */ VARIANT __RPC_FAR *anchorTarget) override;
109 // Returns the index at which the textual representation of the
110 // hyperlink (group) starts.
111 STDMETHOD(get_startIndex)(/* [retval][out] */ long __RPC_FAR *index) override;
113 // Returns the index at which the textual representation of the
114 // hyperlink (group) ends.
115 STDMETHOD(get_endIndex)(/* [retval][out] */ long __RPC_FAR *index) override;
117 // Returns whether the document referenced by this links is still valid.
118 STDMETHOD(get_valid)(/* [retval][out] */ boolean __RPC_FAR *valid) override;
120 // Override of IUNOXWrapper.
121 STDMETHOD(put_XInterface)(hyper pXInterface) override;
123 // Override of IUNOXWrapper.
124 STDMETHOD(put_XSubInterface)(hyper pXSubInterface) override;
126 private:
128 css::uno::Reference<css::accessibility::XAccessibleHyperlink> pRXLink;
130 css::accessibility::XAccessibleHyperlink* GetXInterface()
132 return pRXLink.get();
137 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCHYPERLINK_H
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */