1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 
29 #ifndef _SC_ACCESSIBLECELLBASE_HXX
30 #define _SC_ACCESSIBLECELLBASE_HXX
31 
32 #include "AccessibleContextBase.hxx"
33 #include "global.hxx"
34 #include "address.hxx"
35 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
36 #include <cppuhelper/implbase1.hxx>
37 
38 class ScTabViewShell;
39 
40 typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleValue>
41 					ScAccessibleCellBaseImpl;
42 
43 class ScAccessibleCellBase
44 	:	public ScAccessibleContextBase,
45 		public ScAccessibleCellBaseImpl
46 {
47 public:
48 	//=====  internal  ========================================================
49 	ScAccessibleCellBase(
50         const ::com::sun::star::uno::Reference<
51         ::com::sun::star::accessibility::XAccessible>& rxParent,
52 		ScDocument* pDoc,
53 		const ScAddress& rCellAddress,
54 		sal_Int32 nIndex);
55 protected:
56 	virtual ~ScAccessibleCellBase();
57 public:
58 
59 	///=====  XInterface  =====================================================
60 
61 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
62 		::com::sun::star::uno::Type const & rType )
63 		throw (::com::sun::star::uno::RuntimeException);
64 
65 	virtual void SAL_CALL acquire() throw ();
66 
67 	virtual void SAL_CALL release() throw ();
68 
69 	///=====  XAccessibleComponent  ============================================
70 
71     virtual sal_Bool SAL_CALL isVisible(  )
72 		throw (::com::sun::star::uno::RuntimeException);
73 
74     virtual sal_Int32 SAL_CALL getForeground(  )
75         throw (::com::sun::star::uno::RuntimeException);
76 
77     virtual sal_Int32 SAL_CALL getBackground(  )
78         throw (::com::sun::star::uno::RuntimeException);
79 
80     ///=====  XAccessibleContext  ==============================================
81 
82     ///	Return this objects index among the parents children.
83 	virtual	sal_Int32 SAL_CALL
84     	getAccessibleIndexInParent(void)
85         throw (::com::sun::star::uno::RuntimeException);
86 
87 protected:
88     ///	Return this object's description.
89 	virtual ::rtl::OUString SAL_CALL
90     	createAccessibleDescription(void)
91         throw (::com::sun::star::uno::RuntimeException);
92 
93     ///	Return the object's current name.
94 	virtual ::rtl::OUString SAL_CALL
95     	createAccessibleName(void)
96         throw (::com::sun::star::uno::RuntimeException);
97 
98 public:
99 	///=====  XAccessibleValue  ================================================
100 
101     virtual ::com::sun::star::uno::Any SAL_CALL
102 		getCurrentValue(  )
103 		throw (::com::sun::star::uno::RuntimeException);
104 
105     virtual sal_Bool SAL_CALL
106 		setCurrentValue( const ::com::sun::star::uno::Any& aNumber )
107 		throw (::com::sun::star::uno::RuntimeException);
108 
109     virtual ::com::sun::star::uno::Any SAL_CALL
110 		getMaximumValue(  )
111 		throw (::com::sun::star::uno::RuntimeException);
112 
113     virtual ::com::sun::star::uno::Any SAL_CALL
114 		getMinimumValue(  )
115 		throw (::com::sun::star::uno::RuntimeException);
116 
117 	///=====  XServiceInfo  ====================================================
118 
119     /**	Returns an identifier for the implementation of this object.
120     */
121 	virtual ::rtl::OUString SAL_CALL
122     	getImplementationName(void)
123         throw (::com::sun::star::uno::RuntimeException);
124 
125 	///=====  XTypeProvider  ===================================================
126 
127 	/// returns the possible types
128     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL
129 		getTypes()
130 		throw (::com::sun::star::uno::RuntimeException);
131 
132 	/**	Returns a implementation id.
133     */
134     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
135         getImplementationId(void)
136         throw (::com::sun::star::uno::RuntimeException);
137 
138 protected:
139 	ScAddress maCellAddress;
140 
141 	ScDocument* mpDoc;
142 
143 	sal_Int32 mnIndex;
144 
145 private:
146 	virtual sal_Bool IsEditable(
147 		const com::sun::star::uno::Reference<
148 		::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
149 };
150 
151 
152 
153 #endif
154