LibreOffice Module sw (master)  1
acccell.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_SW_SOURCE_CORE_ACCESS_ACCCELL_HXX
21 #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCCELL_HXX
22 
23 #include "acccontext.hxx"
24 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
25 #include "accselectionhelper.hxx"
26 
27 class SwCellFrame;
28 class SwAccessibleTable;
29 class SwFrameFormat;
30 
32  public css::accessibility::XAccessibleValue,
33  public css::accessibility::XAccessibleSelection,
34  public css::accessibility::XAccessibleExtendedAttributes
35 {
36  // Implementation for XAccessibleSelection interface
38  bool m_bIsSelected; // protected by base class mutex
39 
40  bool IsSelected();
41 
42  bool InvalidateMyCursorPos();
43  bool InvalidateChildrenCursorPos( const SwFrame *pFrame );
44 
46 
47 protected:
48  // Set states for getAccessibleStateSet.
49  // This derived class additionally sets SELECTABLE(1) and SELECTED(+)
50  virtual void GetStates( ::utl::AccessibleStateSetHelper& rStateSet ) override;
51 
52  virtual void InvalidateCursorPos_() override;
53 
54  virtual ~SwAccessibleCell() override;
55 
56 public:
57  SwAccessibleCell(std::shared_ptr<SwAccessibleMap> const& pInitMap,
58  const SwCellFrame *pCellFrame);
59 
60  virtual bool HasCursor() override; // required by map to remember that object
61 
62  // XAccessibleContext
63 
65  virtual OUString SAL_CALL
66  getAccessibleDescription() override;
67 
68  // XServiceInfo
69 
70  // Returns an identifier for the implementation of this object.
71  virtual OUString SAL_CALL
72  getImplementationName() override;
73 
74  // Return whether the specified service is supported by this class.
75  virtual sal_Bool SAL_CALL
76  supportsService (const OUString& sServiceName) override;
77 
78  // Returns a list of all supported services. In this case that is just
79  // the AccessibleContext service.
80  virtual css::uno::Sequence< OUString> SAL_CALL
81  getSupportedServiceNames() override;
82 
83  virtual void Dispose(bool bRecursive, bool bCanSkipInvisible = true) override;
84 
85  virtual void InvalidatePosOrSize( const SwRect& rFrame ) override;
86 
87  // XInterface
88 
89  // (XInterface methods need to be implemented to disambiguate
90  // between those inherited through SwAccessibleContext and
91  // XAccessibleValue).
92 
93  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
94 
95  virtual void SAL_CALL acquire( ) throw () override
96  { SwAccessibleContext::acquire(); };
97 
98  virtual void SAL_CALL release( ) throw () override
99  { SwAccessibleContext::release(); };
100 
101  // XTypeProvider
102  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
103  virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
104 
105  // XAccessibleValue
106 
107  // XAccessibleExtendedAttributes
108  css::uno::Any SAL_CALL getExtendedAttributes() override ;
109 private:
111 
112 public:
113  virtual css::uno::Any SAL_CALL getCurrentValue( ) override;
114 
115  virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber ) override;
116 
117  virtual css::uno::Any SAL_CALL getMaximumValue( ) override;
118 
119  virtual css::uno::Any SAL_CALL getMinimumValue( ) override;
120  // XAccessibleComponent
121  sal_Int32 SAL_CALL getBackground() override;
122 
123  // XAccessibleSelection
124  virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override;
125 
126  virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override;
127  virtual void SAL_CALL clearAccessibleSelection( ) override;
128  virtual void SAL_CALL selectAllAccessibleChildren( ) override;
129  virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override;
130  virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
131  sal_Int32 nSelectedChildIndex ) override;
132 
133  virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
134 };
135 
136 #endif
137 
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:295
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true) override
Definition: acccell.cxx:254
virtual bool HasCursor() override
Definition: acccell.cxx:224
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
Definition: acccell.cxx:447
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nSelectedChildIndex) override
Definition: acccell.cxx:458
virtual void SAL_CALL clearAccessibleSelection() override
Definition: acccell.cxx:438
virtual css::uno::Any SAL_CALL getMaximumValue() override
Definition: acccell.cxx:354
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: acccell.cxx:305
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
virtual void SAL_CALL release() override
Definition: acccell.hxx:98
bool IsSelected()
Definition: acccell.cxx:54
virtual void InvalidatePosOrSize(const SwRect &rFrame) override
Definition: acccell.cxx:264
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
Definition: acccell.cxx:426
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: acccell.cxx:312
virtual css::uno::Any SAL_CALL getCurrentValue() override
Definition: acccell.cxx:329
Style of a layout element.
Definition: frmfmt.hxx:57
virtual sal_Bool SAL_CALL setCurrentValue(const css::uno::Any &aNumber) override
Definition: acccell.cxx:338
rtl::Reference< SwAccessibleTable > m_pAccTable
Definition: acccell.hxx:45
SwFrameFormat * GetTableBoxFormat() const
Definition: acccell.cxx:319
SwAccessibleCell(std::shared_ptr< SwAccessibleMap > const &pInitMap, const SwCellFrame *pCellFrame)
Definition: acccell.cxx:99
virtual OUString SAL_CALL getImplementationName() override
Definition: acccell.cxx:239
unsigned char sal_Bool
virtual void InvalidateCursorPos_() override
Definition: acccell.cxx:189
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
Definition: acccell.cxx:452
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: acccell.cxx:249
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet) override
Definition: acccell.cxx:77
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
Definition: acccell.cxx:432
bool m_bIsSelected
Definition: acccell.hxx:38
virtual css::uno::Any SAL_CALL getMinimumValue() override
Definition: acccell.cxx:359
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: acccell.cxx:276
sal_Int32 SAL_CALL getBackground() override
Definition: acccell.cxx:403
bool InvalidateMyCursorPos()
Definition: acccell.cxx:121
css::uno::Any SAL_CALL getExtendedAttributes() override
Definition: acccell.cxx:386
virtual ~SwAccessibleCell() override
Definition: acccell.cxx:230
virtual OUString SAL_CALL getAccessibleDescription() override
Return this object's description.
Definition: acccell.cxx:234
virtual void SAL_CALL acquire() override
Definition: acccell.hxx:95
virtual void SAL_CALL selectAllAccessibleChildren() override
Definition: acccell.cxx:442
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
Definition: acccell.cxx:244
bool InvalidateChildrenCursorPos(const SwFrame *pFrame)
Definition: acccell.cxx:150
SwAccessibleSelectionHelper m_aSelectionHelper
Definition: acccell.hxx:37
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
const sal_Char sServiceName[]
Definition: accdoc.cxx:57