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 : public ::comphelper::OAccessibleSelectionHelper,
72  {
73  ::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren;
74  SvxShowCharSet* m_pParent; // the vcl control
75  protected:
76  virtual void SAL_CALL disposing() override;
77  public:
79 
81  DECLARE_XTYPEPROVIDER( )
82 
83  // XAccessibleComponent
84  virtual void SAL_CALL grabFocus( ) override;
85  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
86 
87  //OAccessibleContextHelper
88  // XAccessibleContext - still waiting to be overwritten
89  virtual sal_Int32 SAL_CALL getAccessibleChildCount() override;
90  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
91  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
92  virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
93  virtual OUString SAL_CALL getAccessibleDescription( ) override;
94  virtual OUString SAL_CALL getAccessibleName( ) override;
95  virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
96  virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override;
97 
98  virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override { return this; }
99  virtual sal_Int32 SAL_CALL getForeground( ) override;
100  virtual sal_Int32 SAL_CALL getBackground( ) override;
101 
102  // XAccessibleTable
103  virtual sal_Int32 SAL_CALL getAccessibleRowCount( ) override;
104  virtual sal_Int32 SAL_CALL getAccessibleColumnCount( ) override;
105  virtual OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) override;
106  virtual OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) override;
107  virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
108  virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
109  virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders( ) override;
110  virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders( ) override;
111  virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows( ) override;
112  virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns( ) override;
113  virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) override;
114  virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) override;
115  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) override;
116  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption( ) override;
117  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary( ) override;
118  virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) override;
119  virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) override;
120  virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) override;
121  virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) override;
122 
123 
124  void fireEvent(
125  const sal_Int16 _nEventId,
126  const css::uno::Any& _rOldValue,
127  const css::uno::Any& _rNewValue
128  )
129  {
130  NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
131  }
132 
133  void clearCharSetControl() { m_pParent = nullptr; }
134  protected:
135 
136  virtual ~SvxShowCharSetAcc() override;
137 
138  // OCommonAccessibleSelection
139  // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
140  virtual bool
141  implIsSelected( sal_Int32 nAccessibleChildIndex ) override;
142 
143  // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
144  virtual void
145  implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect ) override;
146 
147  // OCommonAccessibleComponent
149  virtual css::awt::Rectangle implGetBounds( ) override;
150  };
151 
152 
153  // - SvxShowCharSetItemAcc -
154 
155  typedef ::cppu::ImplHelper2 < css::accessibility::XAccessible,
156  css::accessibility::XAccessibleAction
158 
163  {
164  private:
166  protected:
167  virtual ~SvxShowCharSetItemAcc() override;
168 
169  // OCommonAccessibleComponent
171  virtual css::awt::Rectangle implGetBounds( ) override;
172  public:
173 
174  // XInterface
176  DECLARE_XTYPEPROVIDER( )
177 
179 
180  void ParentDestroyed();
181 
182  // XAccessibleComponent
183  virtual void SAL_CALL grabFocus( ) override;
184  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
185 
186  //OAccessibleContextHelper
187  // XAccessibleContext - still waiting to be overwritten
188  virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) override;
189  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) override;
190  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
191  virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
192  virtual OUString SAL_CALL getAccessibleDescription( ) override;
193  virtual OUString SAL_CALL getAccessibleName( ) override;
194  virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
195  virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) override;
196 
197  virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override { return this; }
198 
199  virtual sal_Int32 SAL_CALL getForeground( ) override { return mpParent->m_pParent->getForeground(); }
200  virtual sal_Int32 SAL_CALL getBackground( ) override { return mpParent->m_pParent->getBackground(); }
201 
202  // XAccessibleAction
203  virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
204  virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
205  virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
206  virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
207 
208 
209  void fireEvent(
210  const sal_Int16 _nEventId,
211  const css::uno::Any& _rOldValue,
212  const css::uno::Any& _rNewValue
213  )
214  {
215  NotifyAccessibleEvent(_nEventId,_rOldValue,_rNewValue);
216  }
217  };
218 }
219 
220 
221 #endif // INCLUDED_SVX_SOURCE_INC_CHARMAPACC_HXX
222 
223 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:463
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.hxx:200
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.cxx:568
The child implementation of the table.
Definition: charmapacc.hxx:161
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:192
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
Definition: charmapacc.cxx:303
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
Definition: charmapacc.cxx:255
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:133
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:345
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten ...
Definition: charmapacc.cxx:115
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Definition: charmapacc.cxx:469
virtual ~SvxShowCharSetItemAcc() override
Definition: charmapacc.cxx:376
SvxShowCharSetAcc * m_pParent
Definition: charmapacc.hxx:52
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
Definition: charmapacc.cxx:245
SvxShowCharSetItem * mpParent
Definition: charmapacc.hxx:165
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:157
::std::vector< css::uno::Reference< css::accessibility::XAccessible > > m_aChildren
Definition: charmapacc.hxx:73
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:166
SvxShowCharSetItem(SvxShowCharSet &rParent, SvxShowCharSetAcc *_pParent, sal_uInt16 _nPos)
Definition: charmapacc.cxx:42
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:98
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:265
tools::Rectangle maRect
Definition: charmapacc.hxx:50
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:238
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
Definition: charmapacc.hxx:197
::cppu::ImplHelper2< css::accessibility::XAccessible, css::accessibility::XAccessibleTable > OAccessibleHelper_Base
Definition: charmapacc.hxx:63
virtual ~SvxShowCharSetAcc() override
Definition: charmapacc.cxx:78
virtual sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) override
Definition: charmapacc.cxx:509
virtual sal_Int32 SAL_CALL getForeground() override
Definition: charmapacc.hxx:199
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: charmapacc.cxx:402
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:338
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:317
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
Definition: charmapacc.cxx:328
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:124
virtual css::awt::Rectangle implGetBounds() override
implements the calculation of the bounding rectangle - still waiting to be overwritten ...
Definition: charmapacc.cxx:543
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
Definition: charmapacc.cxx:285
rtl::Reference< SvxShowCharSetItemAcc > m_xItem
Definition: charmapacc.hxx:51
unsigned char sal_Bool
virtual sal_Int32 SAL_CALL getAccessibleActionCount() override
Definition: charmapacc.cxx:503
::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:522
void fireEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
Definition: charmapacc.hxx:209
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
Definition: charmapacc.cxx:275
virtual void implSelect(sal_Int32 nAccessibleChildIndex, bool bSelect) override
Definition: charmapacc.cxx:104
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
Definition: charmapacc.cxx:333
css::uno::Reference< css::accessibility::XAccessible > GetAccessible()
Definition: charmapacc.cxx:58
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding(sal_Int32 nIndex) override
Definition: charmapacc.cxx:530
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Definition: charmapacc.cxx:410
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:222
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:416
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Definition: charmapacc.cxx:563
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: charmapacc.cxx:270
virtual void SAL_CALL disposing() override
Definition: charmapacc.cxx:83
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
Definition: charmapacc.cxx:140
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
Definition: charmapacc.cxx:350
SvxShowCharSet & mrParent
Definition: charmapacc.hxx:47
virtual sal_Int32 SAL_CALL getBackground() override
Definition: charmapacc.cxx:577
SvxShowCharSetAcc(SvxShowCharSet *pParent)
Definition: charmapacc.cxx:68
virtual bool implIsSelected(sal_Int32 nAccessibleChildIndex) override
Definition: charmapacc.cxx:97
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Definition: charmapacc.cxx:186
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:260
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
Definition: charmapacc.cxx:250
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
Definition: charmapacc.cxx:294
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
Definition: charmapacc.cxx:357
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:445
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Definition: charmapacc.cxx:310
virtual void SAL_CALL grabFocus() override
Definition: charmapacc.cxx:538
virtual OUString SAL_CALL getAccessibleName() override
Definition: charmapacc.cxx:178
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 i) override
Definition: charmapacc.cxx:396
::cppu::ImplHelper2< css::accessibility::XAccessible, css::accessibility::XAccessibleAction > OAccessibleHelper_Base_3
Definition: charmapacc.hxx:157
virtual OUString SAL_CALL getAccessibleDescription() override
Definition: charmapacc.cxx:171
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: charmapacc.cxx:390
#define DECLARE_XINTERFACE()
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Definition: charmapacc.cxx:280
void NotifyAccessibleEvent(const sal_Int16 _nEventId, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)