LibreOffice Module svx (master)  1
AccessibleTextHelper.hxx
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 #ifndef INCLUDED_SVX_ACCESSIBLETEXTHELPER_HXX
21 #define INCLUDED_SVX_ACCESSIBLETEXTHELPER_HXX
22 
23 #include <memory>
24 #include <vector>
25 
26 #include <com/sun/star/uno/Reference.hxx>
27 #include <sal/types.h>
28 #include <svx/svxdllapi.h>
29 
30 namespace com::sun::star {
31  namespace accessibility { class XAccessible; }
32  namespace accessibility { class XAccessibleEventListener; }
33  namespace awt { struct Point; }
34 }
35 
36 class Point;
37 class SvxEditSource;
38 
39 namespace accessibility
40 {
41 
42  class AccessibleTextHelper_Impl;
43 
111  {
112 
113  public:
114  typedef ::std::vector< sal_Int16 > VectorOfStates;
115 
126  explicit AccessibleTextHelper( ::std::unique_ptr< SvxEditSource > && pEditSource );
127 
129 
130  AccessibleTextHelper( const AccessibleTextHelper& ) = delete;
131  AccessibleTextHelper& operator= ( const AccessibleTextHelper& ) = delete;
132 
141  const SvxEditSource& GetEditSource() const;
142 
183  void SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource );
184 
201  void SetEventSource( const css::uno::Reference< css::accessibility::XAccessible >& rInterface );
202 
217  void SetOffset( const Point& rPoint );
218 
236  void SetStartIndex( sal_Int32 nOffset );
237 
242  sal_Int32 GetStartIndex() const;
243 
253  void SetAdditionalChildStates( const VectorOfStates& rChildStates );
254 
269  void UpdateChildren();
270 
279  void Dispose();
280 
304  void SetFocus( bool bHaveFocus = true );
305 
316  bool HaveFocus();
317 
318  // XAccessibleContext child handling methods
319 
325  sal_Int32 GetChildCount() const;
331  css::uno::Reference< css::accessibility::XAccessible > GetChild( sal_Int32 i );
332 
333  // XAccessibleEventBroadcaster child related methods
334 
339  void AddEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener );
344  void RemoveEventListener( const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener );
345 
346  // XAccessibleComponent child related methods
347 
353  css::uno::Reference< css::accessibility::XAccessible > GetAt( const css::awt::Point& aPoint );
354 
355  private:
356 
358  const std::unique_ptr< AccessibleTextHelper_Impl > mpImpl;
359 
360  };
361 
362 } // end of namespace accessibility
363 
364 #endif // INCLUDED_SVX_ACCESSIBLETEXTHELPER_HXX
365 
366 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class for objects containing EditEngine/Outliner text.
exports com.sun.star. awt
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
::std::vector< sal_Int16 > VectorOfStates
const std::unique_ptr< AccessibleTextHelper_Impl > mpImpl
void Dispose(const T &xInterface)