/src/libreoffice/editeng/source/accessibility/AccessibleImageBullet.hxx
Line | Count | Source |
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 | | #pragma once |
21 | | |
22 | | #include <tools/gen.hxx> |
23 | | #include <comphelper/OAccessible.hxx> |
24 | | #include <cppuhelper/implbase.hxx> |
25 | | |
26 | | #include <com/sun/star/uno/Reference.hxx> |
27 | | #include <com/sun/star/lang/XServiceInfo.hpp> |
28 | | #include <com/sun/star/accessibility/XAccessible.hpp> |
29 | | |
30 | | class SvxEditSource; |
31 | | class SvxTextForwarder; |
32 | | class SvxViewForwarder; |
33 | | |
34 | | namespace accessibility |
35 | | { |
36 | | |
37 | | /** This class implements the image bullets for the EditEngine/Outliner UAA |
38 | | */ |
39 | | class AccessibleImageBullet final |
40 | | : public cppu::ImplInheritanceHelper<comphelper::OAccessible, css::lang::XServiceInfo> |
41 | | { |
42 | | |
43 | | public: |
44 | | /// Create accessible object for given parent |
45 | | AccessibleImageBullet(css::uno::Reference<css::accessibility::XAccessible> xParent, |
46 | | sal_Int64 nIndexInParent); |
47 | | |
48 | | // XAccessibleContext |
49 | | virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; |
50 | | virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override; |
51 | | virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override; |
52 | | virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; |
53 | | virtual sal_Int16 SAL_CALL getAccessibleRole() override; |
54 | | virtual OUString SAL_CALL getAccessibleDescription() override; |
55 | | virtual OUString SAL_CALL getAccessibleName() override; |
56 | | virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override; |
57 | | virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; |
58 | | virtual css::lang::Locale SAL_CALL getLocale() override; |
59 | | |
60 | | // XAccessibleComponent |
61 | | virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; |
62 | | virtual void SAL_CALL grabFocus( ) override; |
63 | | virtual sal_Int32 SAL_CALL getForeground( ) override; |
64 | | virtual sal_Int32 SAL_CALL getBackground( ) override; |
65 | | |
66 | | // XServiceInfo |
67 | | virtual OUString SAL_CALL getImplementationName() override; |
68 | | virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) override; |
69 | | virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override; |
70 | | |
71 | | /** Set the edit engine offset |
72 | | |
73 | | @attention This method does not lock the SolarMutex, |
74 | | leaving that to the calling code. This is because only |
75 | | there potential deadlock situations can be resolved. Thus, |
76 | | make sure SolarMutex is locked when calling this. |
77 | | */ |
78 | | void SetEEOffset( const Point& rOffset ); |
79 | | |
80 | | /** Set the EditEngine offset |
81 | | |
82 | | @attention This method does not lock the SolarMutex, |
83 | | leaving that to the calling code. This is because only |
84 | | there potential deadlock situations can be resolved. Thus, |
85 | | make sure SolarMutex is locked when calling this. |
86 | | */ |
87 | | void SetEditSource( SvxEditSource* pEditSource ); |
88 | | |
89 | | void SAL_CALL dispose() override; |
90 | | |
91 | | /** Set the current paragraph number |
92 | | |
93 | | @attention This method does not lock the SolarMutex, |
94 | | leaving that to the calling code. This is because only |
95 | | there potential deadlock situations can be resolved. Thus, |
96 | | make sure SolarMutex is locked when calling this. |
97 | | */ |
98 | | void SetParagraphIndex( sal_Int32 nIndex ); |
99 | | |
100 | | /** Query the current paragraph number (0 - nParas-1) |
101 | | |
102 | | @attention This method does not lock the SolarMutex, |
103 | | leaving that to the calling code. This is because only |
104 | | there potential deadlock situations can be resolved. Thus, |
105 | | make sure SolarMutex is locked when calling this. |
106 | | */ |
107 | 0 | sal_Int32 GetParagraphIndex() const { return mnParagraphIndex; } |
108 | | |
109 | | private: |
110 | | AccessibleImageBullet( const AccessibleImageBullet& ) = delete; |
111 | | AccessibleImageBullet& operator= ( const AccessibleImageBullet& ) = delete; |
112 | | |
113 | | // maintain state set and send STATE_CHANGE events |
114 | | void SetState( const sal_Int64 nStateId ); |
115 | | void UnSetState( const sal_Int64 nStateId ); |
116 | | |
117 | | SvxEditSource& GetEditSource() const; |
118 | | |
119 | | /** Query the SvxTextForwarder for EditEngine access. |
120 | | |
121 | | @attention This method does not lock the SolarMutex, |
122 | | leaving that to the calling code. This is because only |
123 | | there potential deadlock situations can be resolved. Thus, |
124 | | make sure SolarMutex is locked when calling this. |
125 | | */ |
126 | | SvxTextForwarder& GetTextForwarder() const; |
127 | | |
128 | | /** Query the SvxViewForwarder for EditEngine access. |
129 | | |
130 | | @attention This method does not lock the SolarMutex, |
131 | | leaving that to the calling code. This is because only |
132 | | there potential deadlock situations can be resolved. Thus, |
133 | | make sure SolarMutex is locked when calling this. |
134 | | */ |
135 | | SvxViewForwarder& GetViewForwarder() const; |
136 | | |
137 | | css::awt::Rectangle implGetBounds() override; |
138 | | |
139 | | // the paragraph index in the edit engine (guarded by solar mutex) |
140 | | sal_Int32 mnParagraphIndex; |
141 | | |
142 | | // our current index in the parent (guarded by solar mutex) |
143 | | sal_Int32 mnIndexInParent; |
144 | | |
145 | | // the current edit source (guarded by solar mutex) |
146 | | SvxEditSource* mpEditSource; |
147 | | |
148 | | // the offset of the underlying EditEngine from the shape/cell (guarded by solar mutex) |
149 | | Point maEEOffset; |
150 | | |
151 | | // the current state set (updated from SetState/UnSetState and guarded by solar mutex) |
152 | | sal_Int64 mnStateSet = 0; |
153 | | |
154 | | /// The shape we're the accessible for (unguarded) |
155 | | css::uno::Reference< css::accessibility::XAccessible > mxParent; |
156 | | }; |
157 | | |
158 | | } // end of namespace accessibility |
159 | | |
160 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |