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 #ifndef SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_VIEW_HXX
29 #define SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_VIEW_HXX
30 
31 #include "AccessibleDocumentViewBase.hxx"
32 #include <svx/AccessibleTextHelper.hxx>
33 
34 namespace sd {
35 class OutlineViewShell;
36 class Window;
37 }
38 
39 namespace accessibility {
40 
41 
42 /** This class makes the Impress outline view accessible.
43 
44     Please see the documentation of the base class for further
45     explanations of the individual methods. This class is a mere
46     wrapper around the AccessibleTextHelper class; as basically the
47     Outline View is a big Outliner.
48 */
49 class AccessibleOutlineView
50     : public AccessibleDocumentViewBase
51 {
52 public:
53     AccessibleOutlineView (
54         ::sd::Window* pSdWindow,
55         ::sd::OutlineViewShell* pViewShell,
56         const ::com::sun::star::uno::Reference<
57         ::com::sun::star::frame::XController>& rxController,
58         const ::com::sun::star::uno::Reference<
59         ::com::sun::star::accessibility::XAccessible>& rxParent);
60 
61     virtual ~AccessibleOutlineView	(void);
62 
63     /** Complete the initialization begun in the constructor.
64     */
65     virtual void Init (void);
66 
67 
68     //=====  IAccessibleViewForwarderListener  ================================
69 
70     virtual void ViewForwarderChanged (ChangeType aChangeType,
71         const IAccessibleViewForwarder* pViewForwarder);
72 
73     //=====  XAccessibleContext  ==============================================
74 
75     virtual sal_Int32 SAL_CALL
76         getAccessibleChildCount (void)
77         throw (::com::sun::star::uno::RuntimeException);
78 
79     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
80         getAccessibleChild (sal_Int32 nIndex)
81         throw (::com::sun::star::uno::RuntimeException);
82 
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