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 
79     //=====  XAccessibleEventBroadcaster  ========================================
80 
81     virtual void SAL_CALL
82         addEventListener (
83             const ::com::sun::star::uno::Reference<
84                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
85         throw (::com::sun::star::uno::RuntimeException);
86 
87     virtual void SAL_CALL
88         removeEventListener (
89             const ::com::sun::star::uno::Reference<
90                 ::com::sun::star::accessibility::XAccessibleEventListener >& xListener)
91         throw (::com::sun::star::uno::RuntimeException);
92 
93 	using cppu::WeakComponentImplHelperBase::addEventListener;
94 	using cppu::WeakComponentImplHelperBase::removeEventListener;
95 
96     //=====  XServiceInfo  ====================================================
97 
98     /**	Returns an identifier for the implementation of this object.
99     */
100 	virtual ::rtl::OUString SAL_CALL
101     	getImplementationName (void)
102 	    throw (::com::sun::star::uno::RuntimeException);
103 
104     //=====  lang::XEventListener  ============================================
105 
106 	virtual void SAL_CALL
107 		disposing (const ::com::sun::star::lang::EventObject& rEventObject)
108         throw (::com::sun::star::uno::RuntimeException);
109 
110     //=====  XPropertyChangeListener  =========================================
111 
112 	virtual void SAL_CALL
113 		propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject)
114         throw (::com::sun::star::uno::RuntimeException);
115 
116 
117 protected:
118 
119     // overridden, as we hold the listeners ourselves
120     virtual void FireEvent (const ::com::sun::star::accessibility::AccessibleEventObject& aEvent);
121 
122     // overridden to detect focus changes
123     virtual void Activated (void);
124 
125     // overridden to detect focus changes
126     virtual void Deactivated (void);
127 
128     // declared, but not defined
129     AccessibleOutlineView( const AccessibleOutlineView& );
130     AccessibleOutlineView& operator= ( const AccessibleOutlineView& );
131 
132     // This method is called from the component helper base class while disposing.
133     virtual void SAL_CALL disposing (void);
134 
135     ///	Create an accessible name that contains the current view mode.
136     virtual ::rtl::OUString
137     	CreateAccessibleName ()
138         throw (::com::sun::star::uno::RuntimeException);
139 
140     ///	Create an accessible description that contains the current
141     ///	view mode.
142     virtual ::rtl::OUString
143     	CreateAccessibleDescription ()
144         throw (::com::sun::star::uno::RuntimeException);
145 
146 private:
147 
148     /// Invalidate text helper, updates visible children
149     void UpdateChildren();
150 
151     AccessibleTextHelper maTextHelper;
152 
153 };
154 
155 } // end of namespace accessibility
156 
157 #endif
158