nss: upgrade to release 3.73
[LibreOffice.git] / winaccessibility / source / UAccCOM / AccText.h
blobfbbb07cb841f0cf693f0945ff8675720e46bdee4
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 #ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXT_H
21 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXT_H
23 #include "Resource.h" // main symbols
25 #include "AccTextBase.h"
27 /**
28 * CAccText implements IAccessibleText interface.
30 class ATL_NO_VTABLE CAccText :
31 public CComObjectRoot,
32 public CComCoClass<CAccText,&CLSID_AccText>,
33 public IAccessibleText,
34 public CAccTextBase
36 public:
37 CAccText()
41 BEGIN_COM_MAP(CAccText)
42 COM_INTERFACE_ENTRY(IAccessibleText)
43 COM_INTERFACE_ENTRY(IUNOXWrapper)
44 COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,SmartQI_)
45 #if defined __clang__
46 #pragma clang diagnostic push
47 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
48 #endif
49 END_COM_MAP()
50 #if defined __clang__
51 #pragma clang diagnostic pop
52 #endif
54 static HRESULT WINAPI SmartQI_(void* pv,
55 REFIID iid, void** ppvObject, DWORD_PTR)
57 return static_cast<CAccText*>(pv)->SmartQI(iid,ppvObject);
60 HRESULT SmartQI(REFIID iid, void** ppvObject)
62 if( m_pOuterUnknown )
63 return OuterQueryInterface(iid,ppvObject);
64 return E_FAIL;
67 DECLARE_NO_REGISTRY()
69 public:
70 // IAccessibleText
72 // Adds a text selection.
73 STDMETHOD(addSelection)(long startOffset, long endOffset) override;//, unsigned char * success);
75 // Gets text attributes.
76 STDMETHOD(get_attributes)(long offset, long * startOffset, long * endOffset, BSTR * textAttributes) override;
78 // Gets caret offset.
79 STDMETHOD(get_caretOffset)(long * offset) override;
81 // Gets bounding rect containing the glyph(s) representing the character
82 // at the specified text offset
83 STDMETHOD(get_characterExtents)(long offset, IA2CoordinateType coordType, long * x, long * y, long * width, long * height) override;
85 // Gets number of active non-contiguous selections.
86 STDMETHOD(get_nSelections)(long * nSelections) override;
88 // Gets bounding rect for the glyph at a certain point.
89 STDMETHOD(get_offsetAtPoint)(long x, long y, IA2CoordinateType coordType, long * offset) override;
91 // Gets character offsets of N-th active text selection.
92 STDMETHOD(get_selection)(long selection, long * startOffset, long * endOffset) override;
94 // Gets a range of text by offset NOTE: returned string may be longer
95 // than endOffset-startOffset bytes if text contains multi-byte characters.
96 STDMETHOD(get_text)(long startOffset, long endOffset, BSTR * text) override;
98 // Gets a specified amount of text that ends before a specified offset.
99 STDMETHOD(get_textBeforeOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text) override;
101 // Gets a specified amount of text that spans the specified offset.
102 STDMETHOD(get_textAfterOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text) override;
104 // Gets a specified amount of text that starts after a specified offset.
105 STDMETHOD(get_textAtOffset)(long offset, IA2TextBoundaryType boundaryType, long * startOffset, long * endOffset, BSTR * text) override;
107 // Unselects a range of text.
108 STDMETHOD(removeSelection)(long selectionIndex) override;//, unsigned char * success);
110 // Moves text caret.
111 STDMETHOD(setCaretOffset)(long offset) override;//, unsigned char * success);
113 // Changes the bounds of an existing selection.
114 STDMETHOD(setSelection)(long selectionIndex, long startOffset, long endOffset) override;//, unsigned char * success);
116 // Gets total number of characters.
117 // NOTE: this may be different than the total number of bytes required
118 // to store the text, if the text contains multi-byte characters.
119 STDMETHOD(get_nCharacters)(long * nCharacters) override;
121 // Makes specific part of string visible on screen.
122 STDMETHOD(scrollSubstringTo)(long startIndex, long endIndex,enum IA2ScrollType scrollType) override;
123 STDMETHOD(scrollSubstringToPoint)(long startIndex, long endIndex,enum IA2CoordinateType coordinateType, long x, long y ) override;
125 STDMETHOD(get_newText)( IA2TextSegment *newText) override;
127 STDMETHOD(get_oldText)( IA2TextSegment *oldText) override;
130 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTEXT_H
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */