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 // AccTextBase.h: interface for the CAccTextBase class.
22 #ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXTBASE_H
23 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXTBASE_H
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <com/sun/star/accessibility/XAccessibleText.hpp>
27 #include "UNOXWrapper.h"
29 class ATL_NO_VTABLE CAccTextBase
: public CUNOXWrapper
33 virtual ~CAccTextBase();
39 // Adds a text selection.
40 STDMETHOD(get_addSelection
)(long startOffset
, long endOffset
);
42 // Gets text attributes.
43 STDMETHOD(get_attributes
)
44 (long offset
, long* startOffset
, long* endOffset
, BSTR
* textAttributes
);
47 STDMETHOD(get_caretOffset
)(long* offset
);
49 // Gets total number of characters.
50 STDMETHOD(get_characterCount
)(long* nCharacters
);
52 // Gets bounding rect containing the glyph(s) representing the character
53 // at the specified text offset
54 STDMETHOD(get_characterExtents
)
55 (long offset
, IA2CoordinateType coordType
, long* x
, long* y
, long* width
, long* height
);
57 // Gets number of active non-contiguous selections.
58 STDMETHOD(get_nSelections
)(long* nSelections
);
60 // Gets bounding rect for the glyph at a certain point.
61 STDMETHOD(get_offsetAtPoint
)(long x
, long y
, IA2CoordinateType coordType
, long* offset
);
63 // Gets character offsets of N-th active text selection.
64 STDMETHOD(get_selection
)(long selectionIndex
, long* startOffset
, long* endOffset
);
66 // Gets a range of text by offset NOTE: returned string may be longer
67 // than endOffset-startOffset bytes if text contains multi-byte characters.
68 STDMETHOD(get_text
)(long startOffset
, long endOffset
, BSTR
* text
);
70 // Gets a specified amount of text that ends before a specified offset.
71 STDMETHOD(get_textBeforeOffset
)
72 (long offset
, IA2TextBoundaryType boundaryType
, long* startOffset
, long* endOffset
, BSTR
* text
);
74 // Gets a specified amount of text that spans the specified offset.
75 STDMETHOD(get_textAfterOffset
)
76 (long offset
, IA2TextBoundaryType boundaryType
, long* startOffset
, long* endOffset
, BSTR
* text
);
78 // Gets a specified amount of text that starts after a specified offset.
79 STDMETHOD(get_textAtOffset
)
80 (long offset
, IA2TextBoundaryType boundaryType
, long* startOffset
, long* endOffset
, BSTR
* text
);
82 // Unselects a range of text.
83 STDMETHOD(removeSelection
)(long selectionIndex
);
86 STDMETHOD(setCaretOffset
)(long offset
);
88 // Changes the bounds of an existing selection.
89 STDMETHOD(setSelection
)(long selectionIndex
, long startOffset
, long endOffset
);
91 // Gets total number of characters.
92 // NOTE: this may be different than the total number of bytes required
93 // to store the text, if the text contains multi-byte characters.
94 STDMETHOD(get_nCharacters
)(long* nCharacters
);
96 STDMETHOD(get_newText
)(IA2TextSegment
* newText
);
98 STDMETHOD(get_oldText
)(IA2TextSegment
* oldText
);
100 // Makes specific part of string visible on screen.
101 STDMETHOD(scrollSubstringTo
)(long startIndex
, long endIndex
, enum IA2ScrollType scrollType
);
102 STDMETHOD(scrollSubstringToPoint
)
103 (long startIndex
, long endIndex
, enum IA2CoordinateType coordinateType
, long x
, long y
);
105 // Override of IUNOXWrapper.
106 STDMETHOD(put_XInterface
)(hyper pXInterface
) override
;
109 css::uno::Reference
<css::accessibility::XAccessibleText
> pRXText
;
111 css::accessibility::XAccessibleText
* GetXInterface() { return pRXText
.get(); }
114 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXTBASE_H
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */