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>
27#include <tools/gen.hxx>
28#include <rtl/ref.hxx>
29
30#include <vector>
31class SvxShowCharSet;
32
33namespace svx
34{
35 class SvxShowCharSetAcc;
36
37 class SvxShowCharSetItemAcc;
38
39 // - SvxShowCharSetItem -
40
44 {
46 sal_uInt16 mnId;
47 OUString maText;
51
52 SvxShowCharSetItem( SvxShowCharSet& rParent, SvxShowCharSetAcc* _pParent, sal_uInt16 _nPos );
54
55 css::uno::Reference< css::accessibility::XAccessible > GetAccessible();
56 };
57
58
59 // - SvxShowCharSetAcc -
60
64 class SvxShowCharSetAcc final : public cppu::ImplInheritanceHelper<
65 ::comphelper::OAccessibleSelectionHelper,
66 css::accessibility::XAccessible,
67 css::accessibility::XAccessibleTable>
68 {
69 ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren;
70 SvxShowCharSet* m_pParent; // the vcl control
71 virtual void SAL_CALL disposing() override;
72 public:
74
75 // XAccessibleComponent
76 virtual void SAL_CALL grabFocus( ) override;
77 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
78
79 //OCommonAccessibleComponent
80 // XAccessibleContext - still waiting to be overwritten
81 virtual sal_Int64 SAL_CALL getAccessibleChildCount() override;
82 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
83 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
84 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
85 virtual OUString SAL_CALL getAccessibleDescription( ) override;
86 virtual OUString SAL_CALL getAccessibleName( ) override;
87 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
88 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
89
90 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override { return this; }
91 virtual sal_Int32 SAL_CALL getForeground( ) override;
92 virtual sal_Int32 SAL_CALL getBackground( ) override;
93
94 // XAccessibleTable
95 virtual sal_Int32 SAL_CALL getAccessibleRowCount( ) override;
96 virtual sal_Int32 SAL_CALL getAccessibleColumnCount( ) override;
97 virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
98 virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
99 virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
100 virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
101 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders( ) override;
102 virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders( ) override;
103 virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows( ) override;
104 virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns( ) override;
105 virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
106 virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
107 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
108 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) override;
109 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) override;
110 virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
111 virtual sal_Int64 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override;
112 virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int64 nChildIndex ) override;
113 virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int64 nChildIndex ) override;
114
115
117 const sal_Int16 _nEventId,
118 const css::uno::Any& _rOldValue,
119 const css::uno::Any& _rNewValue
120 )
121 {
122 NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
123 }
124
125 void clearCharSetControl() { m_pParent = nullptr; }
126 private:
127
128 virtual ~SvxShowCharSetAcc() override;
129
130 // OCommonAccessibleSelection
131 // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
132 virtual bool
133 implIsSelected( sal_Int64 nAccessibleChildIndex ) override;
134
135 // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
136 virtual void
137 implSelect( sal_Int64 nAccessibleChildIndex, bool bSelect ) override;
138
139 // OCommonAccessibleComponent
141 virtual css::awt::Rectangle implGetBounds( ) override;
142 };
143
144
145 // - SvxShowCharSetItemAcc -
146
149 class SvxShowCharSetItemAcc final : public cppu::ImplInheritanceHelper<
150 ::comphelper::OAccessibleComponentHelper,
151 css::accessibility::XAccessible,
152 css::accessibility::XAccessibleAction>
153 {
154 private:
156
157 virtual ~SvxShowCharSetItemAcc() override;
158
159 // OCommonAccessibleComponent
161 virtual css::awt::Rectangle implGetBounds( ) override;
162 public:
163
165
166 void ParentDestroyed();
167
168 // XAccessibleComponent
169 virtual void SAL_CALL grabFocus( ) override;
170 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
171
172 //OCommonAccessibleComponent
173 // XAccessibleContext - still waiting to be overwritten
174 virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
175 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
176 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
177 virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
178 virtual OUString SAL_CALL getAccessibleDescription( ) override;
179 virtual OUString SAL_CALL getAccessibleName( ) override;
180 virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
181 virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
182
183 virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override { return this; }
184
185 virtual sal_Int32 SAL_CALL getForeground( ) override { return mpParent->m_pParent->getForeground(); }
186 virtual sal_Int32 SAL_CALL getBackground( ) override { return mpParent->m_pParent->getBackground(); }
187
188 // XAccessibleAction
189 virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
190 virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
191 virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
192 virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
193
194
196 const sal_Int16 _nEventId,
197 const css::uno::Any& _rOldValue,
198 const css::uno::Any& _rNewValue
199 )
200 {
201 NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
202 }
203 };
204}
205
206
207#endif // INCLUDED_SVX_SOURCE_INC_CHARMAPACC_HXX
208
209/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The table implementation of the vcl control.
Definition: charmapacc.hxx:68
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Definition: charmapacc.cxx:311
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
Definition: charmapacc.cxx:329
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:339
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int64 nChildIndex) override
Definition: charmapacc.cxx:358
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
Definition: charmapacc.cxx:290
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
Definition: charmapacc.cxx:334
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
Definition: charmapacc.cxx:297
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:243
virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override
Definition: charmapacc.cxx:106
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:191
virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override
Definition: charmapacc.cxx:94
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:90
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.cxx:566
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:138
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
Definition: charmapacc.cxx:304
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:162
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Definition: charmapacc.cxx:285
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:183
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:227
virtual void SAL_CALL disposing() override
Definition: charmapacc.cxx:84
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:171
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
Definition: charmapacc.cxx:260
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int64 nChildIndex) override
Definition: charmapacc.cxx:351
::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren
Definition: charmapacc.hxx:69
virtual sal_Int64 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:346
SvxShowCharSet * m_pParent
Definition: charmapacc.hxx:70
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.cxx:575
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:116
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:270
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten
Definition: charmapacc.cxx:120
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
Definition: charmapacc.cxx:280
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
Definition: charmapacc.cxx:145
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
Definition: charmapacc.cxx:255
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
Definition: charmapacc.cxx:265
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:176
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:197
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
Definition: charmapacc.cxx:250
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:275
virtual ~SvxShowCharSetAcc() override
Definition: charmapacc.cxx:79
SvxShowCharSetAcc(SvxShowCharSet *pParent)
Definition: charmapacc.cxx:69
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:318
The child implementation of the table.
Definition: charmapacc.hxx:153
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:414
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten
Definition: charmapacc.cxx:541
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.hxx:186
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:442
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
Definition: charmapacc.cxx:507
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
Definition: charmapacc.cxx:394
SvxShowCharSetItem * mpParent
Definition: charmapacc.hxx:155
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.hxx:185
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:388
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
Definition: charmapacc.cxx:528
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:460
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:561
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:400
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
Definition: charmapacc.cxx:501
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:183
SvxShowCharSetItemAcc(SvxShowCharSetItem *pParent)
Definition: charmapacc.cxx:366
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:408
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
Definition: charmapacc.cxx:520
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:466
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:195
virtual ~SvxShowCharSetItemAcc() override
Definition: charmapacc.cxx:377
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:536
Simple struct to hold some information about the single items of the table.
Definition: charmapacc.hxx:44
tools::Rectangle maRect
Definition: charmapacc.hxx:48
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
Definition: charmapacc.cxx:59
SvxShowCharSetAcc * m_pParent
Definition: charmapacc.hxx:50
SvxShowCharSet & mrParent
Definition: charmapacc.hxx:45
SvxShowCharSetItem(SvxShowCharSet &rParent, SvxShowCharSetAcc *_pParent, sal_uInt16 _nPos)
Definition: charmapacc.cxx:43
rtl::Reference< SvxShowCharSetItemAcc > m_xItem
Definition: charmapacc.hxx:49
unsigned char sal_Bool