Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / AccessibleCellBase.hxx
blob558aea6fab0b800ff89597e0e2716138ec58767b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLECELLBASE_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLECELLBASE_HXX
23 #include "AccessibleContextBase.hxx"
24 #include "global.hxx"
25 #include "address.hxx"
26 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
27 #include <cppuhelper/implbase1.hxx>
29 typedef cppu::ImplHelper1< css::accessibility::XAccessibleValue>
30 ScAccessibleCellBaseImpl;
32 class ScAccessibleCellBase
33 : public ScAccessibleContextBase,
34 public ScAccessibleCellBaseImpl
36 public:
37 //===== internal ========================================================
38 ScAccessibleCellBase(
39 const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
40 ScDocument* pDoc,
41 const ScAddress& rCellAddress,
42 sal_Int32 nIndex);
43 protected:
44 virtual ~ScAccessibleCellBase();
45 public:
47 virtual bool SAL_CALL isVisible()
48 throw (css::uno::RuntimeException, std::exception) override;
50 ///===== XInterface =====================================================
52 virtual css::uno::Any SAL_CALL queryInterface(
53 css::uno::Type const & rType )
54 throw (css::uno::RuntimeException, std::exception) override;
56 virtual void SAL_CALL acquire() throw () override;
58 virtual void SAL_CALL release() throw () override;
60 ///===== XAccessibleComponent ============================================
62 virtual sal_Int32 SAL_CALL getForeground( )
63 throw (css::uno::RuntimeException, std::exception) override;
65 virtual sal_Int32 SAL_CALL getBackground( )
66 throw (css::uno::RuntimeException, std::exception) override;
68 ///===== XAccessibleContext ==============================================
70 /// Return this objects index among the parents children.
71 virtual sal_Int32 SAL_CALL
72 getAccessibleIndexInParent()
73 throw (css::uno::RuntimeException, std::exception) override;
75 protected:
76 /// Return this object's description.
77 virtual OUString SAL_CALL
78 createAccessibleDescription()
79 throw (css::uno::RuntimeException, std::exception) override;
81 /// Return the object's current name.
82 virtual OUString SAL_CALL
83 createAccessibleName()
84 throw (css::uno::RuntimeException, std::exception) override;
86 public:
87 ///===== XAccessibleValue ================================================
89 virtual css::uno::Any SAL_CALL
90 getCurrentValue()
91 throw (css::uno::RuntimeException,
92 std::exception) override;
94 virtual sal_Bool SAL_CALL
95 setCurrentValue( const css::uno::Any& aNumber )
96 throw (css::uno::RuntimeException, std::exception) override;
98 virtual css::uno::Any SAL_CALL
99 getMaximumValue( )
100 throw (css::uno::RuntimeException, std::exception) override;
102 virtual css::uno::Any SAL_CALL
103 getMinimumValue( )
104 throw (css::uno::RuntimeException, std::exception) override;
106 ///===== XServiceInfo ====================================================
108 /** Returns an identifier for the implementation of this object.
110 virtual OUString SAL_CALL
111 getImplementationName()
112 throw (css::uno::RuntimeException, std::exception) override;
114 ///===== XTypeProvider ===================================================
116 /// returns the possible types
117 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
118 getTypes()
119 throw (css::uno::RuntimeException, std::exception) override;
121 /** Returns a implementation id.
123 virtual css::uno::Sequence<sal_Int8> SAL_CALL
124 getImplementationId()
125 throw (css::uno::RuntimeException, std::exception) override;
127 protected:
128 ScAddress maCellAddress;
130 ScDocument* mpDoc;
132 sal_Int32 mnIndex;
134 private:
135 virtual bool IsEditable(
136 const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
137 protected:
138 OUString SAL_CALL GetNote()
139 throw (css::uno::RuntimeException);
141 OUString SAL_CALL GetAllDisplayNote()
142 throw (css::uno::RuntimeException, std::exception);
143 OUString SAL_CALL getShadowAttrs()
144 throw (css::uno::RuntimeException, std::exception);
145 OUString SAL_CALL getBorderAttrs()
146 throw (css::uno::RuntimeException, std::exception);
147 public:
148 const ScAddress& GetCellAddress() const { return maCellAddress; }
151 #endif
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */