Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccTextBase.h
blobfc0c0a7be77211a78c913114010d7c9e83f6cf39
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 // 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
31 public:
32 CAccTextBase();
33 virtual ~CAccTextBase();
35 // IAccessibleText
36 public:
37 // IAccessibleText
39 // Adds a text selection.
40 STDMETHOD(get_addSelection)(long startOffset, long endOffset);
42 // Gets text attributes.
43 STDMETHOD(get_attributes)(long offset, long * startOffset, long * endOffset, BSTR * textAttributes);
45 // Gets caret offset.
46 STDMETHOD(get_caretOffset)(long * offset);
48 // Gets total number of characters.
49 STDMETHOD(get_characterCount)(long * nCharacters);
51 // Gets bounding rect containing the glyph(s) representing the character
52 // at the specified text offset
53 STDMETHOD(get_characterExtents)(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height);
55 // Gets number of active non-contiguous selections.
56 STDMETHOD(get_nSelections)(long * nSelections);
58 // Gets bounding rect for the glyph at a certain point.
59 STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long * offset);
61 // Gets character offsets of N-th active text selection.
62 STDMETHOD(get_selection)(long selectionIndex, long * startOffset, long * endOffset);
64 // Gets a range of text by offset NOTE: returned string may be longer
65 // than endOffset-startOffset bytes if text contains multi-byte characters.
66 STDMETHOD(get_text)(long startOffset, long endOffset, BSTR * text);
68 // Gets a specified amount of text that ends before a specified offset.
69 STDMETHOD(get_textBeforeOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
71 // Gets a specified amount of text that spans the specified offset.
72 STDMETHOD(get_textAfterOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
74 // Gets a specified amount of text that starts after a specified offset.
75 STDMETHOD(get_textAtOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text);
77 // Unselects a range of text.
78 STDMETHOD(removeSelection)(long selectionIndex);
80 // Moves text caret.
81 STDMETHOD(setCaretOffset)(long offset);
83 // Changes the bounds of an existing selection.
84 STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset);
86 // Gets total number of characters.
87 // NOTE: this may be different than the total number of bytes required
88 // to store the text, if the text contains multi-byte characters.
89 STDMETHOD(get_nCharacters)(long * nCharacters);
91 STDMETHOD(get_newText)( IA2TextSegment *newText);
93 STDMETHOD(get_oldText)( IA2TextSegment *oldText);
95 // Makes specific part of string visible on screen.
96 STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex,enum IA2ScrollType scrollType);
97 STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y );
99 // Override of IUNOXWrapper.
100 STDMETHOD(put_XInterface)(hyper pXInterface) override;
102 private:
104 css::uno::Reference<css::accessibility::XAccessibleText> pRXText;
106 css::accessibility::XAccessibleText* GetXInterface()
108 return pRXText.get();
112 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXTBASE_H
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */