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>
30 class SvxShowCharSet;
31 
32 namespace svx
33 {
34  typedef ::cppu::ImplHelper1 < css::accessibility::XAccessible
36 
37  class SvxShowCharSetAcc;
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_Int32 SAL_CALL getAccessibleChildCount() override;
89  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 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 css::uno::Reference< css::accessibility::XAccessibleStateSet > 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_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override;
119  virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) override;
120  virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) override;
121 
122 
123  void fireEvent(
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_Int32 nAccessibleChildIndex ) override;
141 
142  // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
143  virtual void
144  implSelect( sal_Int32 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_Int32 SAL_CALL getAccessibleChildCount( ) override;
188  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 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 css::uno::Reference< css::accessibility::XAccessibleStateSet > 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 
208  void fireEvent(
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: */
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:459
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.hxx:199
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.cxx:564
The child implementation of the table.
Definition: charmapacc.hxx:160
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:193
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
Definition: charmapacc.cxx:300
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
Definition: charmapacc.cxx:256
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:134
The table implementation of the vcl control.
Definition: charmapacc.hxx:70
virtual sal_Int32 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:342
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten ...
Definition: charmapacc.cxx:116
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:465
virtual ~SvxShowCharSetItemAcc() override
Definition: charmapacc.cxx:373
SvxShowCharSetAcc * m_pParent
Definition: charmapacc.hxx:52
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
Definition: charmapacc.cxx:246
SvxShowCharSetItem * mpParent
Definition: charmapacc.hxx:164
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:158
::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren
Definition: charmapacc.hxx:73
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:167
SvxShowCharSetItem(SvxShowCharSet &rParent, SvxShowCharSetAcc *_pParent, sal_uInt16 _nPos)
Definition: charmapacc.cxx:43
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:97
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:266
tools::Rectangle maRect
Definition: charmapacc.hxx:50
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:239
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:196
::cppu::ImplHelper2< css::accessibility::XAccessible, css::accessibility::XAccessibleTable > OAccessibleHelper_Base
Definition: charmapacc.hxx:63
virtual ~SvxShowCharSetAcc() override
Definition: charmapacc.cxx:79
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
Definition: charmapacc.cxx:505
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.hxx:198
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:399
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:335
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:314
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
Definition: charmapacc.cxx:325
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:123
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten ...
Definition: charmapacc.cxx:539
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
Definition: charmapacc.cxx:286
rtl::Reference< SvxShowCharSetItemAcc > m_xItem
Definition: charmapacc.hxx:51
unsigned char sal_Bool
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
Definition: charmapacc.cxx:499
::cppu::ImplHelper1< css::accessibility::XAccessible > OAccessibleHelper_Base_2
Definition: charmapacc.hxx:35
SvxShowCharSet * m_pParent
Definition: charmapacc.hxx:74
virtual OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) override
Definition: charmapacc.cxx:518
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:208
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
Definition: charmapacc.cxx:276
virtual void implSelect(sal_Int32 nAccessibleChildIndex, bool bSelect) override
Definition: charmapacc.cxx:105
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
Definition: charmapacc.cxx:330
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
Definition: charmapacc.cxx:59
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
Definition: charmapacc.cxx:526
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:407
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:223
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:413
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:559
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:271
virtual void SAL_CALL disposing() override
Definition: charmapacc.cxx:84
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
Definition: charmapacc.cxx:141
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
Definition: charmapacc.cxx:347
SvxShowCharSet & mrParent
Definition: charmapacc.hxx:47
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.cxx:573
SvxShowCharSetAcc(SvxShowCharSet *pParent)
Definition: charmapacc.cxx:69
virtual bool implIsSelected(sal_Int32 nAccessibleChildIndex) override
Definition: charmapacc.cxx:98
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:187
Simple struct to hold some information about the single items of the table.
Definition: charmapacc.hxx:45
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
Definition: charmapacc.cxx:261
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
Definition: charmapacc.cxx:251
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
Definition: charmapacc.cxx:293
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
Definition: charmapacc.cxx:354
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:441
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Definition: charmapacc.cxx:307
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:534
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:179
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
Definition: charmapacc.cxx:393
::cppu::ImplHelper2< css::accessibility::XAccessible, css::accessibility::XAccessibleAction > OAccessibleHelper_Base_3
Definition: charmapacc.hxx:156
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:172
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:387
#define DECLARE_XINTERFACE()
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Definition: charmapacc.cxx:281
void NotifyAccessibleEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)