1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_ACCHYPERTEXT_H
21 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCHYPERTEXT_H
23 #include "resource.h" // main symbols
25 #include <com/sun/star/accessibility/XAccessible.hpp>
26 #include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
27 #include "AccTextBase.h"
30 * CAccHypertext implements IAccessibleHypertext interface.
32 class ATL_NO_VTABLE CAccHypertext
:
33 public CComObjectRoot
,
34 public CComCoClass
<CAccHypertext
,&CLSID_AccHypertext
>,
35 public IAccessibleHypertext
,
46 BEGIN_COM_MAP(CAccHypertext
)
47 COM_INTERFACE_ENTRY(IAccessibleText
)
48 COM_INTERFACE_ENTRY(IAccessibleHypertext
)
49 COM_INTERFACE_ENTRY(IUNOXWrapper
)
50 COM_INTERFACE_ENTRY_FUNC_BLIND(NULL
,_SmartQI
)
53 static HRESULT WINAPI
_SmartQI(void* pv
,
54 REFIID iid
, void** ppvObject
, DWORD_PTR
)
56 return ((CAccHypertext
*)pv
)->SmartQI(iid
,ppvObject
);
59 HRESULT
SmartQI(REFIID iid
, void** ppvObject
)
62 return OuterQueryInterface(iid
,ppvObject
);
71 // Adds a text selection.
72 STDMETHOD(addSelection
)(long startOffset
, long endOffset
);//, unsigned char * success)
74 // Gets text attributes.
75 STDMETHOD(get_attributes
)(long offset
, long * startOffset
, long * endOffset
, BSTR
* textAttributes
);
78 STDMETHOD(get_caretOffset
)(long * offset
);
80 // Gets total number of characters.
81 STDMETHOD(get_characterCount
)(long * nCharacters
);
83 // Gets bounding rect containing the glyph(s) representing the character
84 // at the specified text offset
85 STDMETHOD(get_characterExtents
)(long offset
, IA2CoordinateType coordType
, long * x
, long * y
, long * width
, long * height
);
87 // Gets number of active non-contiguous selections.
88 STDMETHOD(get_nSelections
)(long * nSelections
);
90 // Gets bounding rect for the glyph at a certain point.
91 STDMETHOD(get_offsetAtPoint
)(long x
, long y
, IA2CoordinateType coordType
, long * offset
);
93 // Gets character offsets of N-th active text selection.
94 STDMETHOD(get_selection
)(long selection
, long * startOffset
, long * endOffset
);
96 // Gets a range of text by offset NOTE: returned string may be longer
97 // than endOffset-startOffset bytes if text contains multi-byte characters.
98 STDMETHOD(get_text
)(long startOffset
, long endOffset
, BSTR
* text
);
100 // Gets a specified amount of text that ends before a specified offset.
101 STDMETHOD(get_textBeforeOffset
)(long offset
, IA2TextBoundaryType boundaryType
, long * startOffset
, long * endOffset
, BSTR
* text
);
103 // Gets a specified amount of text that spans the specified offset.
104 STDMETHOD(get_textAfterOffset
)(long offset
, IA2TextBoundaryType boundaryType
, long * startOffset
, long * endOffset
, BSTR
* text
);
106 // Gets a specified amount of text that starts after a specified offset.
107 STDMETHOD(get_textAtOffset
)(long offset
, IA2TextBoundaryType boundaryType
, long * startOffset
, long * endOffset
, BSTR
* text
);
109 // Unselects a range of text.
110 STDMETHOD(removeSelection
)(long selectionIndex
);
113 STDMETHOD(setCaretOffset
)(long offset
);
115 // Changes the bounds of an existing selection.
116 STDMETHOD(setSelection
)(long selectionIndex
, long startOffset
, long endOffset
);
118 // Gets total number of characters.
119 // NOTE: this may be different than the total number of bytes required
120 // to store the text, if the text contains multi-byte characters.
121 STDMETHOD(get_nCharacters
)(long * nCharacters
);
123 // Makes specific part of string visible on screen.
124 STDMETHOD(scrollSubstringTo
)(long startIndex
, long endIndex
,enum IA2ScrollType scrollType
);
126 STDMETHOD(scrollSubstringToPoint
)(long startIndex
, long endIndex
,enum IA2CoordinateType coordinateType
, long x
, long y
);
128 STDMETHOD(get_newText
)( IA2TextSegment
*newText
);
130 STDMETHOD(get_oldText
)( IA2TextSegment
*oldText
);
132 //IAccessibleHypertext
134 // Gets the number of hyperlink.
135 STDMETHOD(get_nHyperlinks
)(long *hyperlinkCount
);
137 // Gets the hyperlink object via specified index.
138 STDMETHOD(get_hyperlink
)(long index
,IAccessibleHyperlink
**hyperlink
);
140 // Returns the index of the hyperlink that is associated with this
142 STDMETHOD(get_hyperlinkIndex
)(long charIndex
, long *hyperlinkIndex
);
144 // Override of IUNOXWrapper.
145 STDMETHOD(put_XInterface
)(hyper pXInterface
);
149 com::sun::star::uno::Reference
<com::sun::star::accessibility::XAccessibleHypertext
> pHyperText
;
153 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCHYPERTEXT_H
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */