xref: /trunk/main/sc/source/ui/inc/AccessibleDataPilotControl.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #ifndef _SC_ACCESSIBLEDATAPILOTCONTROL_HXX
26 #define _SC_ACCESSIBLEDATAPILOTCONTROL_HXX
27 
28 #include "AccessibleContextBase.hxx"
29 
30 class ScPivotFieldWindow;
31 class ScAccessibleDataPilotButton;
32 
33 class ScAccessibleDataPilotControl
34     :   public ScAccessibleContextBase
35 {
36 public:
37     //=====  internal  ========================================================
38     ScAccessibleDataPilotControl(
39         const ::com::sun::star::uno::Reference<
40         ::com::sun::star::accessibility::XAccessible>& rxParent,
41         ScPivotFieldWindow* pFieldWindow);
42 
43     virtual void Init();
44 
45     using ScAccessibleContextBase::disposing;
46     virtual void SAL_CALL disposing();
47 
48     void AddField(sal_Int32 nNewIndex);
49     void RemoveField(sal_Int32 nOldIndex);
50     void FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex);
51     void FieldNameChange(sal_Int32 nIndex);
52     void GotFocus();
53     void LostFocus();
54 protected:
55     virtual ~ScAccessibleDataPilotControl(void);
56 public:
57     ///=====  XAccessibleComponent  ============================================
58 
59     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
60         SAL_CALL getAccessibleAtPoint(
61         const ::com::sun::star::awt::Point& rPoint );
62 
63     virtual sal_Bool SAL_CALL isVisible(  );
64 
65     virtual void SAL_CALL grabFocus(  );
66 
67     virtual sal_Int32 SAL_CALL getForeground(  );
68 
69     virtual sal_Int32 SAL_CALL getBackground(  );
70 
71     ///=====  XAccessibleContext  ==============================================
72 
73     /// Return the number of currently visible children.
74     virtual sal_Int32 SAL_CALL
75         getAccessibleChildCount(void);
76 
77     /// Return the specified child or NULL if index is invalid.
78     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
79         getAccessibleChild(sal_Int32 nIndex);
80 
81     /// Return the set of current states.
82     virtual ::com::sun::star::uno::Reference<
83             ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
84         getAccessibleStateSet(void);
85 
86     ///=====  XServiceInfo  ====================================================
87 
88     /** Returns an identifier for the implementation of this object.
89     */
90     virtual ::rtl::OUString SAL_CALL
91         getImplementationName(void);
92 
93     ///=====  XTypeProvider  ===================================================
94 
95     /** Returns a implementation id.
96     */
97     virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
98         getImplementationId(void);
99 
100 protected:
101     /// Return this object's description.
102     virtual ::rtl::OUString SAL_CALL
103         createAccessibleDescription(void);
104 
105     /// Return the object's current name.
106     virtual ::rtl::OUString SAL_CALL
107         createAccessibleName(void);
108 
109     /// Return the object's current bounding box relative to the desktop.
110     virtual Rectangle GetBoundingBoxOnScreen(void) const;
111 
112     /// Return the object's current bounding box relative to the parent object.
113     virtual Rectangle GetBoundingBox(void) const;
114 
115 private:
116     ScPivotFieldWindow* mpFieldWindow;
117     struct AccessibleWeak
118     {
119         ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xWeakAcc;
120         ScAccessibleDataPilotButton* pAcc;
AccessibleWeakScAccessibleDataPilotControl::AccessibleWeak121         AccessibleWeak() : pAcc(NULL) {}
122     };
123     ::std::vector< AccessibleWeak > maChildren;
124 };
125 
126 
127 #endif
128