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