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_ACCESSIBLEDATAPILOTCONTROL_HXX
30 #define _SC_ACCESSIBLEDATAPILOTCONTROL_HXX
31 
32 #include "AccessibleContextBase.hxx"
33 
34 class ScPivotFieldWindow;
35 class ScAccessibleDataPilotButton;
36 
37 class ScAccessibleDataPilotControl
38 	:	public ScAccessibleContextBase
39 {
40 public:
41 	//=====  internal  ========================================================
42 	ScAccessibleDataPilotControl(
43         const ::com::sun::star::uno::Reference<
44         ::com::sun::star::accessibility::XAccessible>& rxParent,
45         ScPivotFieldWindow* pFieldWindow);
46 
47 	virtual void Init();
48 
49     using ScAccessibleContextBase::disposing;
50     virtual void SAL_CALL disposing();
51 
52     void AddField(sal_Int32 nNewIndex);
53     void RemoveField(sal_Int32 nOldIndex);
54     void FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex);
55     void FieldNameChange(sal_Int32 nIndex);
56     void GotFocus();
57     void LostFocus();
58 protected:
59 	virtual ~ScAccessibleDataPilotControl(void);
60 public:
61 	///=====  XAccessibleComponent  ============================================
62 
63     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
64 		SAL_CALL getAccessibleAtPoint(
65 		const ::com::sun::star::awt::Point& rPoint )
66 		throw (::com::sun::star::uno::RuntimeException);
67 
68     virtual sal_Bool SAL_CALL isVisible(  )
69 		throw (::com::sun::star::uno::RuntimeException);
70 
71     virtual void SAL_CALL grabFocus(  )
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 the number of currently visible children.
83     virtual sal_Int32 SAL_CALL
84     	getAccessibleChildCount(void) throw (::com::sun::star::uno::RuntimeException);
85 
86     ///	Return the specified child or NULL if index is invalid.
87     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
88     	getAccessibleChild(sal_Int32 nIndex)
89         throw (::com::sun::star::uno::RuntimeException,
90 				::com::sun::star::lang::IndexOutOfBoundsException);
91 
92     ///	Return the set of current states.
93 	virtual ::com::sun::star::uno::Reference<
94             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
95     	getAccessibleStateSet(void)
96         throw (::com::sun::star::uno::RuntimeException);
97 
98 	///=====  XServiceInfo  ====================================================
99 
100     /**	Returns an identifier for the implementation of this object.
101     */
102 	virtual ::rtl::OUString SAL_CALL
103     	getImplementationName(void)
104         throw (::com::sun::star::uno::RuntimeException);
105 
106 	///=====  XTypeProvider  ===================================================
107 
108 	/**	Returns a implementation id.
109     */
110     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
111         getImplementationId(void)
112         throw (::com::sun::star::uno::RuntimeException);
113 
114 protected:
115     ///	Return this object's description.
116 	virtual ::rtl::OUString SAL_CALL
117     	createAccessibleDescription(void)
118         throw (::com::sun::star::uno::RuntimeException);
119 
120     ///	Return the object's current name.
121 	virtual ::rtl::OUString SAL_CALL
122     	createAccessibleName(void)
123         throw (::com::sun::star::uno::RuntimeException);
124 
125     ///	Return the object's current bounding box relative to the desktop.
126 	virtual Rectangle GetBoundingBoxOnScreen(void) const
127 		throw (::com::sun::star::uno::RuntimeException);
128 
129 	///	Return the object's current bounding box relative to the parent object.
130 	virtual Rectangle GetBoundingBox(void) const
131 		throw (::com::sun::star::uno::RuntimeException);
132 
133 private:
134     ScPivotFieldWindow* mpFieldWindow;
135     struct AccessibleWeak
136     {
137         ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xWeakAcc;
138         ScAccessibleDataPilotButton* pAcc;
139         AccessibleWeak() : pAcc(NULL) {}
140     };
141     ::std::vector< AccessibleWeak > maChildren;
142 };
143 
144 
145 #endif
146