bump product version to 5.0.4.1
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccHyperLink.h
bloba493aac12a66893c2046644538b6cf43cec03be4
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()
42 ~CAccHyperLink()
46 BEGIN_COM_MAP(CAccHyperLink)
47 COM_INTERFACE_ENTRY(IAccessibleAction)
48 COM_INTERFACE_ENTRY(IAccessibleHyperlink)
49 COM_INTERFACE_ENTRY(IUNOXWrapper)
50 END_COM_MAP()
52 DECLARE_NO_REGISTRY()
54 static HRESULT WINAPI _SmartQI(void* pv,
55 REFIID iid, void** ppvObject, DWORD_PTR)
57 return ((CAccHyperLink*)pv)->SmartQI(iid,ppvObject);
60 HRESULT SmartQI(REFIID iid, void** ppvObject)
62 if( m_pOuterUnknown )
63 return OuterQueryInterface(iid,ppvObject);
64 return E_FAIL;
67 // IAccessibleHyperlink
68 public:
69 // IAccessibleAction
71 // Returns the number of action.
72 STDMETHOD(nActions)(/*[out,retval]*/long* nActions);
74 // Performs specified action on the object.
75 STDMETHOD(doAction)(/* [in] */ long actionIndex);
77 // get the action name
78 STDMETHOD(get_name)( long actionIndex, BSTR __RPC_FAR *name);
80 // get the localized action name
81 STDMETHOD(get_localizedName)( long actionIndex, BSTR __RPC_FAR *localizedName);
83 // Gets description of specified action.
84 STDMETHOD(get_description)(long actionIndex,BSTR __RPC_FAR *description);
86 // Returns key binding object (if any) associated with specified action
87 // key binding is string.
88 // e.g. "alt+d" (like IAccessible::get_accKeyboardShortcut).
89 STDMETHOD(get_keyBinding)(
90 /* [in] */ long actionIndex,
91 /* [in] */ long nMaxBinding,
92 /* [length_is][length_is][size_is][size_is][out] */ BSTR __RPC_FAR *__RPC_FAR *keyBinding,
93 /* [retval][out] */ long __RPC_FAR *nBinding);
95 // IAccessibleHyperlink
97 // get an object, e.g. BSTR or image object, that is overloaded with link behavior
98 STDMETHOD(get_anchor)(/* [in] */ long index,
99 /* [retval][out] */ VARIANT __RPC_FAR *anchor);
101 // get an object representing the target of the link, usually a BSTR of the URI
102 STDMETHOD(get_anchorTarget)(/* [in] */ long index,
103 /* [retval][out] */ VARIANT __RPC_FAR *anchorTarget);
105 // Returns the index at which the textual representation of the
106 // hyperlink (group) starts.
107 STDMETHOD(get_startIndex)(/* [retval][out] */ long __RPC_FAR *index);
109 // Returns the index at which the textual rerpesentation of the
110 // hyperlink (group) ends.
111 STDMETHOD(get_endIndex)(/* [retval][out] */ long __RPC_FAR *index);
113 // Returns whether the document referenced by this links is still valid.
114 STDMETHOD(get_valid)(/* [retval][out] */ boolean __RPC_FAR *valid);
116 // Override of IUNOXWrapper.
117 STDMETHOD(put_XInterface)(hyper pXInterface);
119 // Override of IUNOXWrapper.
120 STDMETHOD(put_XSubInterface)(hyper pXSubInterface);
122 private:
124 com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleHyperlink> pRXLink;
126 inline com::sun::star::accessibility::XAccessibleHyperlink* GetXInterface()
128 return pRXLink.get();
133 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCHYPERLINK_H
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */