LibreOffice Module winaccessibility (master) 1
AccTextBase.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20// AccTextBase.h: interface for the CAccTextBase class.
21
22#pragma once
23
24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/accessibility/XAccessibleText.hpp>
26#include "UNOXWrapper.h"
27
28class ATL_NO_VTABLE CAccTextBase : public CUNOXWrapper
29{
30public:
32 virtual ~CAccTextBase();
33
34 // IAccessibleText
35public:
36 // IAccessibleText
37
38 // Adds a text selection.
39 STDMETHOD(get_addSelection)(long startOffset, long endOffset);
40
41 // Gets text attributes.
42 STDMETHOD(get_attributes)
43 (long offset, long* startOffset, long* endOffset, BSTR* textAttributes);
44
45 // Gets caret offset.
46 STDMETHOD(get_caretOffset)(long* offset);
47
48 // Gets total number of characters.
49 STDMETHOD(get_characterCount)(long* nCharacters);
50
51 // Gets bounding rect containing the glyph(s) representing the character
52 // at the specified text offset
53 STDMETHOD(get_characterExtents)
54 (long offset, IA2CoordinateType coordType, long* x, long* y, long* width, long* height);
55
56 // Gets number of active non-contiguous selections.
57 STDMETHOD(get_nSelections)(long* nSelections);
58
59 // Gets bounding rect for the glyph at a certain point.
60 STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long* offset);
61
62 // Gets character offsets of N-th active text selection.
63 STDMETHOD(get_selection)(long selectionIndex, long* startOffset, long* endOffset);
64
65 // Gets a range of text by offset NOTE: returned string may be longer
66 // than endOffset-startOffset bytes if text contains multi-byte characters.
67 STDMETHOD(get_text)(long startOffset, long endOffset, BSTR* text);
68
69 // Gets a specified amount of text that ends before a specified offset.
70 STDMETHOD(get_textBeforeOffset)
71 (long offset, IA2TextBoundaryType boundaryType, long* startOffset, long* endOffset, BSTR* text);
72
73 // Gets a specified amount of text that spans the specified offset.
74 STDMETHOD(get_textAfterOffset)
75 (long offset, IA2TextBoundaryType boundaryType, long* startOffset, long* endOffset, BSTR* text);
76
77 // Gets a specified amount of text that starts after a specified offset.
78 STDMETHOD(get_textAtOffset)
79 (long offset, IA2TextBoundaryType boundaryType, long* startOffset, long* endOffset, BSTR* text);
80
81 // Unselects a range of text.
82 STDMETHOD(removeSelection)(long selectionIndex);
83
84 // Moves text caret.
85 STDMETHOD(setCaretOffset)(long offset);
86
87 // Changes the bounds of an existing selection.
88 STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset);
89
90 // Gets total number of characters.
91 // NOTE: this may be different than the total number of bytes required
92 // to store the text, if the text contains multi-byte characters.
93 STDMETHOD(get_nCharacters)(long* nCharacters);
94
95 STDMETHOD(get_newText)(IA2TextSegment* newText);
96
97 STDMETHOD(get_oldText)(IA2TextSegment* oldText);
98
99 // Makes specific part of string visible on screen.
100 STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex, enum IA2ScrollType scrollType);
101 STDMETHOD(scrollSubstringToPoint)
102 (long startIndex, long endIndex, enum IA2CoordinateType coordinateType, long x, long y);
103
104 // Override of IUNOXWrapper.
105 STDMETHOD(put_XInterface)(hyper pXInterface) override;
106
107private:
108 css::uno::Reference<css::accessibility::XAccessibleText> pRXText;
109
110 css::accessibility::XAccessibleText* GetXInterface() { return pRXText.get(); }
111};
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::accessibility::XAccessibleText * GetXInterface()
Definition: AccTextBase.h:110
long long long * endOffset
Definition: AccTextBase.h:43
long long endIndex
Definition: AccTextBase.h:102
long IA2TextBoundaryType boundaryType
Definition: AccTextBase.h:71
css::uno::Reference< css::accessibility::XAccessibleText > pRXText
Definition: AccTextBase.h:108
long IA2CoordinateType coordType
Definition: AccTextBase.h:54
CUNOXWrapper implements IUNOXWrapper interface.
Definition: UNOXWrapper.h:32
float y
float x
IA2ScrollType
These constants control the scrolling of an object or substring into a window.
IA2CoordinateType
These constants define which coordinate system a point is located in.
IA2TextBoundaryType
This enum defines values which specify a text boundary type.
def text(shape, orig_st)
A structure containing a substring and the start and end offsets in the enclosing string.