Line data Source code
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 :
21 : #ifndef _SC_ACCESSIBLECELLBASE_HXX
22 : #define _SC_ACCESSIBLECELLBASE_HXX
23 :
24 : #include "AccessibleContextBase.hxx"
25 : #include "global.hxx"
26 : #include "address.hxx"
27 : #include <com/sun/star/accessibility/XAccessibleValue.hpp>
28 : #include <cppuhelper/implbase1.hxx>
29 :
30 : typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleValue>
31 : ScAccessibleCellBaseImpl;
32 :
33 : class ScAccessibleCellBase
34 : : public ScAccessibleContextBase,
35 : public ScAccessibleCellBaseImpl
36 : {
37 : public:
38 : //===== internal ========================================================
39 : ScAccessibleCellBase(
40 : const ::com::sun::star::uno::Reference<
41 : ::com::sun::star::accessibility::XAccessible>& rxParent,
42 : ScDocument* pDoc,
43 : const ScAddress& rCellAddress,
44 : sal_Int32 nIndex);
45 : protected:
46 : virtual ~ScAccessibleCellBase();
47 : public:
48 :
49 : ///===== XInterface =====================================================
50 :
51 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
52 : ::com::sun::star::uno::Type const & rType )
53 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
54 :
55 : virtual void SAL_CALL acquire() throw () SAL_OVERRIDE;
56 :
57 : virtual void SAL_CALL release() throw () SAL_OVERRIDE;
58 :
59 : ///===== XAccessibleComponent ============================================
60 :
61 : virtual sal_Bool SAL_CALL isVisible()
62 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
63 :
64 : virtual sal_Int32 SAL_CALL getForeground( )
65 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
66 :
67 : virtual sal_Int32 SAL_CALL getBackground( )
68 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
69 :
70 : ///===== XAccessibleContext ==============================================
71 :
72 : /// Return this objects index among the parents children.
73 : virtual sal_Int32 SAL_CALL
74 : getAccessibleIndexInParent(void)
75 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 :
77 : protected:
78 : /// Return this object's description.
79 : virtual OUString SAL_CALL
80 : createAccessibleDescription(void)
81 : throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
82 :
83 : /// Return the object's current name.
84 : virtual OUString SAL_CALL
85 : createAccessibleName(void)
86 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 :
88 : public:
89 : ///===== XAccessibleValue ================================================
90 :
91 : virtual ::com::sun::star::uno::Any SAL_CALL
92 : getCurrentValue()
93 : throw (::com::sun::star::uno::RuntimeException,
94 : std::exception) SAL_OVERRIDE;
95 :
96 : virtual sal_Bool SAL_CALL
97 : setCurrentValue( const ::com::sun::star::uno::Any& aNumber )
98 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 :
100 : virtual ::com::sun::star::uno::Any SAL_CALL
101 : getMaximumValue( )
102 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 :
104 : virtual ::com::sun::star::uno::Any SAL_CALL
105 : getMinimumValue( )
106 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
107 :
108 : ///===== XServiceInfo ====================================================
109 :
110 : /** Returns an identifier for the implementation of this object.
111 : */
112 : virtual OUString SAL_CALL
113 : getImplementationName(void)
114 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
115 :
116 : ///===== XTypeProvider ===================================================
117 :
118 : /// returns the possible types
119 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
120 : getTypes()
121 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 :
123 : /** Returns a implementation id.
124 : */
125 : virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
126 : getImplementationId(void)
127 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
128 :
129 : protected:
130 : ScAddress maCellAddress;
131 :
132 : ScDocument* mpDoc;
133 :
134 : sal_Int32 mnIndex;
135 :
136 : private:
137 : virtual bool IsEditable(
138 : const com::sun::star::uno::Reference<
139 : ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
140 : protected:
141 : virtual OUString SAL_CALL GetNote(void)
142 : throw (::com::sun::star::uno::RuntimeException);
143 :
144 : virtual OUString SAL_CALL GetAllDisplayNote(void)
145 : throw (::com::sun::star::uno::RuntimeException);
146 : virtual OUString SAL_CALL getShadowAttrs(void)
147 : throw (::com::sun::star::uno::RuntimeException);
148 : virtual OUString SAL_CALL getBorderAttrs(void)
149 : throw (::com::sun::star::uno::RuntimeException);
150 : public:
151 0 : const ScAddress& GetCellAddress() const { return maCellAddress; }
152 : bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBoder);
153 : };
154 :
155 : #endif
156 :
157 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|