LibreOffice Module svx (master) 1
charmapacc.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_SOURCE_INC_CHARMAPACC_HXX
21#define INCLUDED_SVX_SOURCE_INC_CHARMAPACC_HXX
22
24#include <com/sun/star/accessibility/XAccessibleAction.hpp>
25#include <com/sun/star/accessibility/XAccessibleTable.hpp>
26#include <tools/gen.hxx>
27#include <rtl/ref.hxx>
28
29#include <vector>
30class SvxShowCharSet;
31
32namespace svx
33{
34 typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible
36
38
40
41 // - SvxShowCharSetItem -
42
46 {
48 sal_uInt16 mnId;
49 OUString maText;
53
54 SvxShowCharSetItem( SvxShowCharSet& rParent, SvxShowCharSetAcc* _pParent, sal_uInt16 _nPos );
56
57 css::uno::Reference< css::accessibility::XAccessible > GetAccessible();
58 };
59
60
61 typedef ::cppu::ImplHelper2 < css::accessibility::XAccessible,
62 css::accessibility::XAccessibleTable
64
65 // - SvxShowCharSetAcc -
66
70 class SvxShowCharSetAcc final : public ::comphelper::OAccessibleSelectionHelper,
72 {
73 ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren;
74 SvxShowCharSet* m_pParent; // the vcl control
75 virtual void SAL_CALL disposing() override;
76 public:
78
80 DECLARE_XTYPEPROVIDER( )
81
82 // XAccessibleComponent
83 virtual void SAL_CALL grabFocus( ) override;
84 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
85
86 //OAccessibleContextHelper
87 // XAccessibleContext - still waiting to be overwritten
88 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
89 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
90 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
91 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
92 virtual OUString SAL_CALL getAccessibleDescription( ) override;
93 virtual OUString SAL_CALL getAccessibleName( ) override;
94 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
95 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
96
97 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override { return this; }
98 virtual sal_Int32 SAL_CALL getForeground( ) override;
99 virtual sal_Int32 SAL_CALL getBackground( ) override;
100
101 // XAccessibleTable
102 virtual sal_Int32 SAL_CALL getAccessibleRowCount( ) override;
103 virtual sal_Int32 SAL_CALL getAccessibleColumnCount( ) override;
104 virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
105 virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
106 virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
107 virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
108 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders( ) override;
109 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders( ) override;
110 virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows( ) override;
111 virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns( ) override;
112 virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
113 virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
114 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
115 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) override;
116 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) override;
117 virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
118 virtual sal_Int64 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override;
119 virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int64 nChildIndex ) override;
120 virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int64 nChildIndex ) override;
121
122
124 const sal_Int16 _nEventId,
125 const css::uno::Any& _rOldValue,
126 const css::uno::Any& _rNewValue
127 )
128 {
129 NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
130 }
131
132 void clearCharSetControl() { m_pParent = nullptr; }
133 private:
134
135 virtual ~SvxShowCharSetAcc() override;
136
137 // OCommonAccessibleSelection
138 // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
139 virtual bool
140 implIsSelected( sal_Int64 nAccessibleChildIndex ) override;
141
142 // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
143 virtual void
144 implSelect( sal_Int64 nAccessibleChildIndex, bool bSelect ) override;
145
146 // OCommonAccessibleComponent
148 virtual css::awt::Rectangle implGetBounds( ) override;
149 };
150
151
152 // - SvxShowCharSetItemAcc -
153
154 typedef ::cppu::ImplHelper2 < css::accessibility::XAccessible,
155 css::accessibility::XAccessibleAction
157
162 {
163 private:
165
166 virtual ~SvxShowCharSetItemAcc() override;
167
168 // OCommonAccessibleComponent
170 virtual css::awt::Rectangle implGetBounds( ) override;
171 public:
172
173 // XInterface
175 DECLARE_XTYPEPROVIDER( )
176
178
179 void ParentDestroyed();
180
181 // XAccessibleComponent
182 virtual void SAL_CALL grabFocus( ) override;
183 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
184
185 //OAccessibleContextHelper
186 // XAccessibleContext - still waiting to be overwritten
187 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
188 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
189 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
190 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
191 virtual OUString SAL_CALL getAccessibleDescription( ) override;
192 virtual OUString SAL_CALL getAccessibleName( ) override;
193 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
194 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
195
196 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override { return this; }
197
198 virtual sal_Int32 SAL_CALL getForeground( ) override { return mpParent->m_pParent->getForeground(); }
199 virtual sal_Int32 SAL_CALL getBackground( ) override { return mpParent->m_pParent->getBackground(); }
200
201 // XAccessibleAction
202 virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
203 virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
204 virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
205 virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
206
207
209 const sal_Int16 _nEventId,
210 const css::uno::Any& _rOldValue,
211 const css::uno::Any& _rNewValue
212 )
213 {
214 NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
215 }
216 };
217}
218
219
220#endif // INCLUDED_SVX_SOURCE_INC_CHARMAPACC_HXX
221
222/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void NotifyAccessibleEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
The table implementation of the vcl control.
Definition: charmapacc.hxx:72
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Definition: charmapacc.cxx:313
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
Definition: charmapacc.cxx:331
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:341
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int64 nChildIndex) override
Definition: charmapacc.cxx:360
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
Definition: charmapacc.cxx:292
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
Definition: charmapacc.cxx:336
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
Definition: charmapacc.cxx:299
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:245
virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override
Definition: charmapacc.cxx:108
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:193
virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override
Definition: charmapacc.cxx:96
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:97
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.cxx:570
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:140
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
Definition: charmapacc.cxx:306
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:164
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Definition: charmapacc.cxx:287
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:185
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:229
virtual void SAL_CALL disposing() override
Definition: charmapacc.cxx:83
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:173
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
Definition: charmapacc.cxx:262
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int64 nChildIndex) override
Definition: charmapacc.cxx:353
::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren
Definition: charmapacc.hxx:73
virtual sal_Int64 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:348
SvxShowCharSet * m_pParent
Definition: charmapacc.hxx:74
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.cxx:579
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:123
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:272
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten
Definition: charmapacc.cxx:122
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
Definition: charmapacc.cxx:282
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
Definition: charmapacc.cxx:147
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
Definition: charmapacc.cxx:257
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
Definition: charmapacc.cxx:267
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:178
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:199
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
Definition: charmapacc.cxx:252
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:277
virtual ~SvxShowCharSetAcc() override
Definition: charmapacc.cxx:78
SvxShowCharSetAcc(SvxShowCharSet *pParent)
Definition: charmapacc.cxx:68
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:320
The child implementation of the table.
Definition: charmapacc.hxx:162
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:419
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten
Definition: charmapacc.cxx:545
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.hxx:199
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:447
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
Definition: charmapacc.cxx:511
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
Definition: charmapacc.cxx:399
SvxShowCharSetItem * mpParent
Definition: charmapacc.hxx:164
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.hxx:198
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:393
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
Definition: charmapacc.cxx:532
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:465
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:565
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:405
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
Definition: charmapacc.cxx:505
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:196
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:413
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
Definition: charmapacc.cxx:524
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:471
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:208
virtual ~SvxShowCharSetItemAcc() override
Definition: charmapacc.cxx:379
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:540
::cppu::ImplHelper2< css::accessibility::XAccessible, css::accessibility::XAccessibleTable > OAccessibleHelper_Base
Definition: charmapacc.hxx:63
::cppu::ImplHelper1< css::accessibility::XAccessible > OAccessibleHelper_Base_2
Definition: charmapacc.hxx:35
::cppu::ImplHelper2< css::accessibility::XAccessible, css::accessibility::XAccessibleAction > OAccessibleHelper_Base_3
Definition: charmapacc.hxx:156
Simple struct to hold some information about the single items of the table.
Definition: charmapacc.hxx:46
tools::Rectangle maRect
Definition: charmapacc.hxx:50
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
Definition: charmapacc.cxx:58
SvxShowCharSetAcc * m_pParent
Definition: charmapacc.hxx:52
SvxShowCharSet & mrParent
Definition: charmapacc.hxx:47
SvxShowCharSetItem(SvxShowCharSet &rParent, SvxShowCharSetAcc *_pParent, sal_uInt16 _nPos)
Definition: charmapacc.cxx:42
rtl::Reference< SvxShowCharSetItemAcc > m_xItem
Definition: charmapacc.hxx:51
unsigned char sal_Bool
#define DECLARE_XINTERFACE()