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