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