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 #ifndef SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_VIEW_HXX
25 #define SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_VIEW_HXX
26 
27 #include "AccessibleDocumentViewBase.hxx"
28 #include <svx/AccessibleTextHelper.hxx>
29 
30 namespace sd {
31 class OutlineViewShell;
32 class Window;
33 }
34 
35 namespace accessibility {
36 
37 
38 /** This class makes the Impress outline view accessible.
39 
40     Please see the documentation of the base class for further
41     explanations of the individual methods. This class is a mere
42     wrapper around the AccessibleTextHelper class; as basically the
43     Outline View is a big Outliner.
44 */
45 class AccessibleOutlineView
46     : public AccessibleDocumentViewBase
47 {
48 public:
49     AccessibleOutlineView (
50         ::sd::Window* pSdWindow,
51         ::sd::OutlineViewShell* pViewShell,
52         const ::com::sun::star::uno::Reference<
53         ::com::sun::star::frame::XController>& rxController,
54         const ::com::sun::star::uno::Reference<
55         ::com::sun::star::accessibility::XAccessible>& rxParent);
56 
57     virtual ~AccessibleOutlineView	(void);
58 
59     /** Complete the initialization begun in the constructor.
60     */
61     virtual void Init (void);
62 
63 
64     //=====  IAccessibleViewForwarderListener  ================================
65 
66     virtual void ViewForwarderChanged (ChangeType aChangeType,
67         const IAccessibleViewForwarder* pViewForwarder);
68 
69     //=====  XAccessibleContext  ==============================================
70 
71     virtual sal_Int32 SAL_CALL
72         getAccessibleChildCount (void)
73         throw (::com::sun::star::uno::RuntimeException);
74 
75     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
76         getAccessibleChild (sal_Int32 nIndex)
77         throw (::com::sun::star::uno::RuntimeException);
78     virtual ::rtl::OUString SAL_CALL
79         getAccessibleName(void)
80         throw (::com::sun::star::uno::RuntimeException);
81     //=====  XAccessibleEventBroadcaster  ========================================
82 
83     virtual void SAL_CALL
84         addEventListener (
85             const ::com::sun::star::uno::Reference<
86                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
87         throw (::com::sun::star::uno::RuntimeException);
88 
89     virtual void SAL_CALL
90         removeEventListener (
91             const ::com::sun::star::uno::Reference<
92                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
93         throw (::com::sun::star::uno::RuntimeException);
94 
95 	using cppu::WeakComponentImplHelperBase::addEventListener;
96 	using cppu::WeakComponentImplHelperBase::removeEventListener;
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     //=====  lang::XEventListener  ============================================
107 
108 	virtual void SAL_CALL
109 		disposing (const ::com::sun::star::lang::EventObject& rEventObject)
110         throw (::com::sun::star::uno::RuntimeException);
111 
112     //=====  XPropertyChangeListener  =========================================
113 
114 	virtual void SAL_CALL
115 		propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject)
116         throw (::com::sun::star::uno::RuntimeException);
117 
118 
119 protected:
120 
121     // overridden, as we hold the listeners ourselves
122     virtual void FireEvent (const ::com::sun::star::accessibility::AccessibleEventObject& aEvent);
123 
124     // overridden to detect focus changes
125     virtual void Activated (void);
126 
127     // overridden to detect focus changes
128     virtual void Deactivated (void);
129 
130     // declared, but not defined
131     AccessibleOutlineView( const AccessibleOutlineView& );
132     AccessibleOutlineView& operator= ( const AccessibleOutlineView& );
133 
134     // This method is called from the component helper base class while disposing.
135     virtual void SAL_CALL disposing (void);
136 
137     ///	Create an accessible name that contains the current view mode.
138     virtual ::rtl::OUString
139     	CreateAccessibleName ()
140         throw (::com::sun::star::uno::RuntimeException);
141 
142     ///	Create an accessible description that contains the current
143     ///	view mode.
144     virtual ::rtl::OUString
145     	CreateAccessibleDescription ()
146         throw (::com::sun::star::uno::RuntimeException);
147 
148 private:
149 
150     /// Invalidate text helper, updates visible children
151     void UpdateChildren();
152 
153     AccessibleTextHelper maTextHelper;
154 
155 };
156 
157 } // end of namespace accessibility
158 
159 #endif
160