LibreOffice Module winaccessibility (master) 1
AccTextBase.cxx
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
21// AccTextBase.cpp: implementation of the CAccTextBase class.
22
23#include "stdafx.h"
24
25#include "AccTextBase.h"
26
27#include <rtl/ustrbuf.hxx>
28#include <sal/log.hxx>
29#include <vcl/svapp.hxx>
31
32#include <com/sun/star/accessibility/AccessibleScrollType.hpp>
33#include <com/sun/star/accessibility/AccessibleTextType.hpp>
34#include <com/sun/star/accessibility/XAccessible.hpp>
35#include <com/sun/star/accessibility/XAccessibleContext.hpp>
36#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
37#include <com/sun/star/accessibility/XAccessibleTextSelection.hpp>
38#include "MAccessible.h"
39
40using namespace css::accessibility;
41using namespace css::uno;
42
43namespace
44{
45sal_Int16 lcl_matchIA2TextBoundaryType(IA2TextBoundaryType boundaryType)
46{
47 switch (boundaryType)
48 {
50 return com::sun::star::accessibility::AccessibleTextType::CHARACTER;
52 return com::sun::star::accessibility::AccessibleTextType::WORD;
54 return com::sun::star::accessibility::AccessibleTextType::SENTENCE;
56 return com::sun::star::accessibility::AccessibleTextType::PARAGRAPH;
58 return com::sun::star::accessibility::AccessibleTextType::LINE;
60 // assert here, better handle it directly at call site
61 assert(false
62 && "No match for IA2_TEXT_BOUNDARY_ALL, handle at call site.");
63 break;
64 default:
65 break;
66 }
67
68 SAL_WARN("iacc2", "Unmatched text boundary type: " << boundaryType);
69 return -1;
70}
71}
72
73
74// Construction/Destruction
75
76
78{}
79
81{}
82
83
91COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_addSelection(long startOffset, long endOffset)
92{
94
95 try {
96
97 // #CHECK XInterface#
98 if(pUNOInterface == nullptr)
99 return E_FAIL;
100
101 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
102
103 Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
104
105 if( pRExtension.is() )
106 {
107 pRExtension->addSelection(0, startOffset, endOffset);
108 return S_OK;
109 }
110 else
111 {
112 GetXInterface()->setSelection(startOffset, endOffset);
113 return S_OK;
114 }
115
116 } catch(...) { return E_FAIL; }
117}
118
127COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_attributes(long offset, long * startOffset, long * endOffset, BSTR * textAttributes)
128{
130
131 try {
132
133 if (startOffset == nullptr || endOffset == nullptr || textAttributes == nullptr)
134 return E_INVALIDARG;
135 // #CHECK XInterface#
136 if(!pRXText.is())
137 {
138 return E_FAIL;
139 }
140
141 if( offset < 0 || offset > GetXInterface()->getCharacterCount() )
142 return E_FAIL;
143
144 OUStringBuffer strAttrs("Version:1;");
145
146 Sequence< css::beans::PropertyValue > pValues = GetXInterface()->getCharacterAttributes(offset, Sequence< OUString >());
147 int nCount = pValues.getLength();
148
149 sal_Int16 numberingLevel = 0;
150 OUString numberingPrefix;
151 Any anyNumRule;
152 bool bHaveNumberingPrefixAttr = false;
153 bool bHaveNumberingLevel = false;
154 bool bHaveNumberingRules = false;
155 for(int i =0; i<nCount; i++)
156 {
157
158 const css::beans::PropertyValue &pValue = pValues[i];
159 if(pValue.Name == "NumberingLevel")
160 {
161 if (pValue.Value != Any())
162 pValue.Value >>= numberingLevel;
163 else
164 numberingLevel = -1;
165 bHaveNumberingLevel = true;
166 continue;
167 }
168 if(pValue.Name == "NumberingPrefix")
169 {
170 pValue.Value >>=numberingPrefix;
171 bHaveNumberingPrefixAttr = true;
172 continue;
173 }
174 if(pValue.Name == "NumberingRules")
175 {
176 bHaveNumberingRules = true;
177 anyNumRule = pValue.Value;
178 continue;
179 }
180 if (bHaveNumberingLevel && bHaveNumberingRules && bHaveNumberingPrefixAttr)
181 {
182 strAttrs.append(';');
183 numberingPrefix = numberingPrefix.replaceAll(u"\\", u"\\\\")
184 .replaceAll(u";", u"\\;")
185 .replaceAll(u"=", u"\\=")
186 .replaceAll(u",", u"\\,")
187 .replaceAll(u":", u"\\:");
188
189 strAttrs.append(CMAccessible::get_String4Numbering(anyNumRule,numberingLevel,numberingPrefix));
190 bHaveNumberingLevel = false;
191 bHaveNumberingRules = false;
192 }
193 if( (bHaveNumberingPrefixAttr && i > 1 ) ||
194 (!bHaveNumberingPrefixAttr && i > 0 ) ) //element 0 is NumberingPrefix, not write alone
195 {
196 strAttrs.append(';');
197 }
198 strAttrs.append(pValue.Name + ":");
199
200 if (pValue.Name == "CharBackColor" ||
201 pValue.Name == "CharColor" ||
202 pValue.Name == "CharUnderlineColor" )
203 {
204 unsigned long nColor;
205 pValue.Value >>= nColor;
206 strAttrs.append('#');
207 OUString const hex = OUString::number(nColor, 16).toAsciiUpperCase();
208 for (sal_Int32 j = hex.getLength(); j < 8; ++j) {
209 strAttrs.append('0');
210 }
211 strAttrs.append(hex);
212 }
213 else
214 {
215 strAttrs.append(CMAccessible::get_StringFromAny(pValue.Value));
216 }
217 }
218 strAttrs.append(';');
219 // #CHECK#
220 if(*textAttributes)
221 SysFreeString(*textAttributes);
222 *textAttributes = SysAllocString(o3tl::toW(strAttrs.makeStringAndClear().getStr()));
223
224 if( offset < GetXInterface()->getCharacterCount() )
225 {
226 TextSegment textSeg = GetXInterface()->getTextAtIndex(offset, AccessibleTextType::ATTRIBUTE_RUN);
227 *startOffset = textSeg.SegmentStart;
228 *endOffset = textSeg.SegmentEnd;
229 }
230 else
231 {
233 *endOffset = offset;
234 }
235
236 return S_OK;
237
238 } catch(...) { return E_FAIL; }
239}
240
246COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_caretOffset(long * offset)
247{
249
250 try {
251
252 if (offset == nullptr)
253 return E_INVALIDARG;
254 // #CHECK XInterface#
255 if(!pRXText.is())
256 {
257 *offset = 0;
258 return S_OK;
259 }
260
261 *offset = GetXInterface()->getCaretPosition();
262 return S_OK;
263
264 } catch(...) { return E_FAIL; }
265}
266
272COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_characterCount(long * nCharacters)
273{
275
276 try {
277
278 if (nCharacters == nullptr)
279 return E_INVALIDARG;
280 // #CHECK XInterface#
281 if(!pRXText.is())
282 {
283 *nCharacters = 0;
284 return S_OK;
285 }
286
287 *nCharacters = GetXInterface()->getCharacterCount();
288 return S_OK;
289
290 } catch(...) { return E_FAIL; }
291}
292
302COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_characterExtents(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height)
303{
305
306 try {
307
308 if (x == nullptr || height == nullptr || y == nullptr || width == nullptr)
309 return E_INVALIDARG;
310 // #CHECK XInterface#
311 if(!pRXText.is())
312 return E_FAIL;
313
314 if(offset < 0 || offset > GetXInterface()->getCharacterCount() )
315 return E_FAIL;
316
317 css::awt::Rectangle rectangle;
318 rectangle = GetXInterface()->getCharacterBounds(offset);
319
320 //IA2Point aPoint;
321 css::awt::Point aPoint;
322
323 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
324 if( !pRContext.is() )
325 {
326 return E_FAIL;
327 }
328 Reference<XAccessibleComponent> pRComp(pRContext,UNO_QUERY);
329 if( pRComp.is() )
330 {
332 {
333 css::awt::Point pt = pRComp->getLocationOnScreen();
334 aPoint.X = pt.X;
335 aPoint.Y = pt.Y;
336 }
338 {
339 css::awt::Point pt = pRComp->getLocation();
340 aPoint.X = pt.X;
341 aPoint.Y = pt.Y;
342 }
343 }
344 rectangle.X = rectangle.X + aPoint.X;
345 rectangle.Y = rectangle.Y + aPoint.Y;
346
347 *x = rectangle.X;
348 *y = rectangle.Y;
349
350 // GetXInterface()->getCharacterBounds() have different implement in different acc component
351 // But we need return the width/height == 1 for every component when offset == text length.
352 // So we ignore the return result of GetXInterface()->getCharacterBounds() when offset == text length.
353 if( offset == GetXInterface()->getCharacterCount() )
354 {
355 *width = 1;
356 *height = 1;
357 }
358 else
359 {
360 *width = rectangle.Width;
361 *height = rectangle.Height;
362 }
363
364 return S_OK;
365
366 } catch(...) { return E_FAIL; }
367}
368
374COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_nSelections(long * nSelections)
375{
377
378 try {
379
380 if (nSelections == nullptr)
381 return E_INVALIDARG;
382 // #CHECK XInterface#
383 if(pUNOInterface == nullptr)
384 {
385 *nSelections = 0;
386 return S_OK;
387 }
388
389 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
390
391 Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
392
393 if( pRExtension.is() )
394 {
395 *nSelections = pRExtension->getSelectedPortionCount();
396 return S_OK;
397 }
398
399 long iLength = GetXInterface()->getSelectedText().getLength();
400 if( iLength> 0)
401 {
402 *nSelections = 1;
403 return S_OK;
404 }
405
406 *nSelections = 0;
407 return S_OK;
408
409 } catch(...) { return E_FAIL; }
410}
411
420COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_offsetAtPoint(long x, long y, IA2CoordinateType, long * offset)
421{
423
424 try {
425
426 if (offset == nullptr)
427 return E_INVALIDARG;
428 // #CHECK XInterface#
429 if(!pRXText.is())
430 return E_FAIL;
431
432 css::awt::Point point;
433 point.X = x;
434 point.Y = y;
435 *offset = GetXInterface()->getIndexAtPoint(point);
436 return S_OK;
437
438 } catch(...) { return E_FAIL; }
439}
440
449COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_selection(long selectionIndex, long * startOffset, long * endOffset)
450{
452
453 try {
454
455 if (startOffset == nullptr || endOffset == nullptr )
456 return E_INVALIDARG;
457 // #CHECK XInterface#
458 if(pUNOInterface == nullptr )
459 return E_FAIL;
460
461 long nSelection = 0;
462 get_nSelections(&nSelection);
463
464 if(selectionIndex >= nSelection || selectionIndex < 0 )
465 return E_FAIL;
466
467 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
468
469 Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
470
471 if( pRExtension.is() )
472 {
473 *startOffset = pRExtension->getSeletedPositionStart(selectionIndex);
474 *endOffset = pRExtension->getSeletedPositionEnd(selectionIndex);
475 return S_OK;
476 }
477 else if(GetXInterface()->getSelectionEnd() > -1)
478 {
479 *startOffset = GetXInterface()->getSelectionStart();
480 *endOffset = GetXInterface()->getSelectionEnd();
481 return S_OK;
482 }
483
484 *startOffset = 0;
485 *endOffset = 0;
486 return E_FAIL;
487
488 } catch(...) { return E_FAIL; }
489}
490
498COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_text(long startOffset, long endOffset, BSTR * text)
499{
501
502 try {
503
504 if (text == nullptr)
505 return E_INVALIDARG;
506 // #CHECK XInterface#
507 if(!pRXText.is())
508 return E_FAIL;
509
510 if (endOffset < -1 || endOffset < startOffset )
511 {
512 return E_FAIL;
513 }
514
515 OUString ouStr;
516 if (endOffset == -1 )
517 {
518 long nLen=0;
519 if(SUCCEEDED(get_characterCount(&nLen)))
520 {
521 ouStr = GetXInterface()->getTextRange( 0, nLen );
522 }
523 }
524 else
525 {
526 ouStr = GetXInterface()->getTextRange( startOffset, endOffset );
527 }
528
529 SysFreeString(*text);
530 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
531 return S_OK;
532
533 } catch(...) { return E_FAIL; }
534}
535
545COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textBeforeOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
546{
548
549 try {
550
551 // #CHECK#
552 if (startOffset == nullptr || endOffset == nullptr || text == nullptr)
553 return E_INVALIDARG;
554 // #CHECK XInterface#
555 if(!pRXText.is())
556 return E_FAIL;
557
559 {
560 long nChar;
561 get_nCharacters( &nChar );
562 *startOffset = 0;
563 *endOffset = nChar;
564 return get_text(0, nChar, text);
565 }
566
567 const sal_Int16 nUnoBoundaryType = lcl_matchIA2TextBoundaryType(boundaryType);
568 if (nUnoBoundaryType < 0)
569 return E_FAIL;
570
571 TextSegment segment = GetXInterface()->getTextBeforeIndex(offset, nUnoBoundaryType);
572 OUString ouStr = segment.SegmentText;
573 SysFreeString(*text);
574 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
575 *startOffset = segment.SegmentStart;
576 *endOffset = segment.SegmentEnd;
577
578 return S_OK;
579
580 } catch(...) { return E_FAIL; }
581}
582
592COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textAfterOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
593{
595
596 try {
597
598 if (startOffset == nullptr || endOffset == nullptr || text == nullptr)
599 return E_INVALIDARG;
600 // #CHECK XInterface#
601 if(!pRXText.is())
602 return E_FAIL;
603
605 {
606 long nChar;
607 get_nCharacters( &nChar );
608 *startOffset = 0;
609 *endOffset = nChar;
610 return get_text(0, nChar, text);
611 }
612
613 const sal_Int16 nUnoBoundaryType = lcl_matchIA2TextBoundaryType(boundaryType);
614 if (nUnoBoundaryType < 0)
615 return E_FAIL;
616
617 TextSegment segment = GetXInterface()->getTextBehindIndex(offset, nUnoBoundaryType);
618 OUString ouStr = segment.SegmentText;
619 SysFreeString(*text);
620 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
621 *startOffset = segment.SegmentStart;
622 *endOffset = segment.SegmentEnd;
623
624 return S_OK;
625
626 } catch(...) { return E_FAIL; }
627}
628
638COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_textAtOffset(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text)
639{
641
642 try {
643
644 if (startOffset == nullptr || text == nullptr ||endOffset == nullptr)
645 return E_INVALIDARG;
646 // #CHECK XInterface#
647 if(!pRXText.is())
648 return E_FAIL;
649
651 {
652 long nChar;
653 get_nCharacters( &nChar );
654 *startOffset = 0;
655 *endOffset = nChar;
656 return get_text(0, nChar, text);
657 }
658
659 const sal_Int16 nUnoBoundaryType = lcl_matchIA2TextBoundaryType(boundaryType);
660 if (nUnoBoundaryType < 0)
661 return E_FAIL;
662
663 TextSegment segment = GetXInterface()->getTextAtIndex(offset, nUnoBoundaryType);
664 OUString ouStr = segment.SegmentText;
665 SysFreeString(*text);
666 *text = SysAllocString(o3tl::toW(ouStr.getStr()));
667 *startOffset = segment.SegmentStart;
668 *endOffset = segment.SegmentEnd;
669
670 return S_OK;
671
672 } catch(...) { return E_FAIL; }
673}
674
681COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::removeSelection(long selectionIndex)
682{
684
685 try {
686
687 // #CHECK XInterface#
688 if(pUNOInterface == nullptr)
689 {
690 return E_FAIL;
691 }
692
693 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
694
695 Reference< XAccessibleTextSelection > pRExtension(pRContext,UNO_QUERY);
696
697 if( pRExtension.is() )
698 {
699 pRExtension->removeSelection(selectionIndex);
700 return S_OK;
701 }
702 else
703 {
704 GetXInterface()->setSelection(0, 0);
705 return S_OK;
706 }
707
708 } catch(...) { return E_FAIL; }
709}
710
717COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::setCaretOffset(long offset)
718{
720
721 try {
722
723 // #CHECK XInterface#
724 if(!pRXText.is())
725 return E_FAIL;
726
727 GetXInterface()->setCaretPosition( offset);
728
729 return S_OK;
730
731 } catch(...) { return E_FAIL; }
732}
733
742COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::setSelection(long, long startOffset, long endOffset)
743{
745
746 try {
747
748 // #CHECK XInterface#
749 if(!pRXText.is())
750 {
751 return E_FAIL;
752 }
753
754 GetXInterface()->setSelection( startOffset, endOffset );
755
756 return S_OK;
757
758 } catch(...) { return E_FAIL; }
759}
760
766COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_nCharacters(long * nCharacters)
767{
769
770 try {
771
772 if (nCharacters == nullptr)
773 return E_INVALIDARG;
774 // #CHECK XInterface#
775 if(!pRXText.is())
776 {
777 *nCharacters = 0;
778 return S_OK;
779 }
780
781 *nCharacters = GetXInterface()->getCharacterCount();
782
783 return S_OK;
784
785 } catch(...) { return E_FAIL; }
786}
787
788// added by qiuhd, 2006/07/03, for direver 07/11
789COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_newText( IA2TextSegment *)
790{
791 return E_NOTIMPL;
792}
793
794COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::get_oldText( IA2TextSegment *)
795{
796 return E_NOTIMPL;
797}
798
805COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringToPoint(long, long, IA2CoordinateType, long, long )
806{
807 return E_NOTIMPL;
808}
809
810COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::scrollSubstringTo(long startIndex, long endIndex, IA2ScrollType type)
811{
813
814 try {
815
816 // #CHECK XInterface#
817 if(!pRXText.is())
818 return E_FAIL;
819
820 AccessibleScrollType lUnoType;
821
822 switch(type)
823 {
825 lUnoType = AccessibleScrollType_SCROLL_TOP_LEFT;
826 break;
828 lUnoType = AccessibleScrollType_SCROLL_BOTTOM_RIGHT;
829 break;
831 lUnoType = AccessibleScrollType_SCROLL_TOP_EDGE;
832 break;
834 lUnoType = AccessibleScrollType_SCROLL_BOTTOM_EDGE;
835 break;
837 lUnoType = AccessibleScrollType_SCROLL_LEFT_EDGE;
838 break;
840 lUnoType = AccessibleScrollType_SCROLL_RIGHT_EDGE;
841 break;
843 lUnoType = AccessibleScrollType_SCROLL_ANYWHERE;
844 break;
845 default:
846 return E_NOTIMPL;
847 }
848
850 return S_OK;
851
852 return E_NOTIMPL;
853
854 } catch(...) { return E_FAIL; }
855}
856
862COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::put_XInterface(hyper pXInterface)
863{
864 // internal IUNOXWrapper - no mutex meeded
865
866 try {
867
868 CUNOXWrapper::put_XInterface(pXInterface);
869 //special query.
870 if(pUNOInterface == nullptr)
871 return E_FAIL;
872 Reference<XAccessibleContext> pRContext = pUNOInterface->getAccessibleContext();
873 if( !pRContext.is() )
874 {
875 return E_FAIL;
876 }
877 Reference<XAccessibleText> pRXI(pRContext,UNO_QUERY);
878 if( !pRXI.is() )
879 pRXText = nullptr;
880 else
881 pRXText = pRXI;
882 return S_OK;
883
884 } catch(...) { return E_FAIL; }
885}
886
887/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const PropertyValue * pValues
STDMETHOD() get_nSelections(long *nSelections)
Get selections count.
css::accessibility::XAccessibleText * GetXInterface()
Definition: AccTextBase.h:110
STDMETHOD() get_characterCount(long *nCharacters)
Get character count.
STDMETHOD() get_caretOffset(long *offset)
Get caret position.
long long long * endOffset
Definition: AccTextBase.h:43
long long endIndex
Definition: AccTextBase.h:102
STDMETHOD() put_XInterface(hyper pXInterface) override
Put UNO interface.
STDMETHOD() setSelection(long selectionIndex, long startOffset, long endOffset)
Set special selection.
STDMETHOD() get_selection(long selectionIndex, long *startOffset, long *endOffset)
Get selection range.
STDMETHOD() get_text(long startOffset, long endOffset, BSTR *text)
Get special text.
long IA2TextBoundaryType boundaryType
Definition: AccTextBase.h:71
long IA2CoordinateType long long long long * height
Definition: AccTextBase.h:54
long IA2CoordinateType long long long * width
Definition: AccTextBase.h:54
long IA2CoordinateType long * x
Definition: AccTextBase.h:54
css::uno::Reference< css::accessibility::XAccessibleText > pRXText
Definition: AccTextBase.h:108
STDMETHOD() setCaretOffset(long offset)
Set caret position.
STDMETHOD() get_addSelection(long startOffset, long endOffset)
Get special selection.
Definition: AccTextBase.cxx:91
STDMETHOD() get_offsetAtPoint(long x, long y, IA2CoordinateType coordType, long *offset)
Get offset of some special point.
STDMETHOD() get_nCharacters(long *nCharacters)
Get characters count.
STDMETHOD() get_newText(IA2TextSegment *newText)
STDMETHOD() scrollSubstringTo(long startIndex, long endIndex, enum IA2ScrollType scrollType)
STDMETHOD() get_oldText(IA2TextSegment *oldText)
long IA2TextBoundaryType long long BSTR * text
Definition: AccTextBase.h:71
long long * startOffset
Definition: AccTextBase.h:43
long IA2CoordinateType coordType
Definition: AccTextBase.h:54
STDMETHOD() removeSelection(long selectionIndex)
Remove selection.
virtual ~CAccTextBase()
Definition: AccTextBase.cxx:80
long long long BSTR * textAttributes
Definition: AccTextBase.h:43
long IA2CoordinateType long long * y
Definition: AccTextBase.h:54
static OUString get_StringFromAny(css::uno::Any const &pAny)
static OUString get_String4Numbering(const css::uno::Any &pAny, sal_Int16 numberingLevel, std::u16string_view numberingPrefix)
STDMETHOD() put_XInterface(hyper pXInterface) override
Definition: UNOXWrapper.cxx:27
css::accessibility::XAccessible * pUNOInterface
Definition: UNOXWrapper.h:34
int nCount
IA2ScrollType
These constants control the scrolling of an object or substring into a window.
@ IA2_SCROLL_TYPE_LEFT_EDGE
Scroll the left edge of the object or substring such that the left edge (and as much as possible of t...
@ IA2_SCROLL_TYPE_BOTTOM_EDGE
Scroll the bottom edge of the object or substring such that the bottom edge (and as much as possible ...
@ IA2_SCROLL_TYPE_ANYWHERE
Scroll the object or substring such that as much as possible of the object or substring is within the...
@ IA2_SCROLL_TYPE_TOP_EDGE
Scroll the top edge of the object or substring such that the top edge (and as much as possible of the...
@ IA2_SCROLL_TYPE_RIGHT_EDGE
Scroll the right edge of the object or substring such that the right edge (and as much as possible of...
@ IA2_SCROLL_TYPE_BOTTOM_RIGHT
Scroll the bottom right corner of the object or substring such that the bottom right corner (and as m...
@ IA2_SCROLL_TYPE_TOP_LEFT
Scroll the top left corner of the object or substring such that the top left corner (and as much as p...
IA2CoordinateType
These constants define which coordinate system a point is located in.
@ IA2_COORDTYPE_SCREEN_RELATIVE
The coordinates are relative to the screen.
@ IA2_COORDTYPE_PARENT_RELATIVE
The coordinates are relative to the upper left corner of the bounding box of the immediate parent.
IA2TextBoundaryType
This enum defines values which specify a text boundary type.
@ IA2_TEXT_BOUNDARY_LINE
Range is from start of one line to the start of another line.
@ IA2_TEXT_BOUNDARY_WORD
The range provided matches the range observed when the application processes the Ctrl + left arrow an...
@ IA2_TEXT_BOUNDARY_ALL
Using this value will cause all text to be returned.
@ IA2_TEXT_BOUNDARY_SENTENCE
Range is from start of one sentence to the start of another sentence.
@ IA2_TEXT_BOUNDARY_CHAR
Typically, a single character is returned.
@ IA2_TEXT_BOUNDARY_PARAGRAPH
Range is from start of one paragraph to the start of another paragraph.
#define SAL_WARN(area, stream)
def rectangle(l)
def point()
int i
A structure containing a substring and the start and end offsets in the enclosing string.
ResultType type