xref: /trunk/main/sd/source/ui/inc/AccessibleDrawDocumentView.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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_DRAW_DOCUMENT_VIEW_HXX
25 #define _SD_ACCESSIBILITY_ACCESSIBLE_DRAW_DOCUMENT_VIEW_HXX
26 
27 #include "AccessibleDocumentViewBase.hxx"
28 
29 #include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
30 
31 namespace accessibility {
32 
33 
34 /** This class makes draw documents in the general view modes
35     accessible.  It passes all shapes on the current draw page to a
36     children manager and additionally creates a new shape that
37     represents the actual draw page.
38 
39     Please see the documentation of the base class for further
40     explanations of the individual methods.
41 */
42 class AccessibleDrawDocumentView :
43     public AccessibleDocumentViewBase
44     ,public ::com::sun::star::accessibility::XAccessibleGroupPosition
45 {
46 public:
47     //=====  internal  ========================================================
48 
49     AccessibleDrawDocumentView (::sd::Window* pSdWindow,
50         ::sd::ViewShell* pViewShell,
51         const ::com::sun::star::uno::Reference<
52         ::com::sun::star::frame::XController>& rxController,
53         const ::com::sun::star::uno::Reference<
54         ::com::sun::star::accessibility::XAccessible>& rxParent);
55 
56     virtual ~AccessibleDrawDocumentView (void);
57 
58     /** Complete the initialization begun in the constructor.
59     */
60     virtual void Init (void);
61 
62 
63     //=====  IAccessibleViewForwarderListener  ================================
64 
65     virtual void ViewForwarderChanged (ChangeType aChangeType,
66         const IAccessibleViewForwarder* pViewForwarder);
67 
68     //=====  XAccessibleContext  ==============================================
69 
70     virtual sal_Int32 SAL_CALL
71         getAccessibleChildCount (void);
72 
73     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
74         getAccessibleChild (sal_Int32 nIndex);
75 
76     virtual ::rtl::OUString SAL_CALL
77         getAccessibleName(void);
78 
79     //=====  lang::XEventListener  ============================================
80 
81     virtual void SAL_CALL
82         disposing (const ::com::sun::star::lang::EventObject& rEventObject);
83 
84 
85     //=====  XPropertyChangeListener  =========================================
86 
87     virtual void SAL_CALL
88         propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject);
89     //=====  XInterface  ======================================================
90 
91     virtual com::sun::star::uno::Any SAL_CALL
92         queryInterface (const com::sun::star::uno::Type & rType);
93 
94     virtual void SAL_CALL
95         acquire (void)
96         throw ();
97 
98     virtual void SAL_CALL
99         release (void)
100         throw ();
101 
102     //=====  XAccessibleGroupPosition  =========================================
103     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
104         getGroupPosition( const ::com::sun::star::uno::Any& rAny );
105     virtual ::rtl::OUString SAL_CALL getObjectLink( const ::com::sun::star::uno::Any& accoject );
106 
107 protected:
108 
109     //=====  XServiceInfo  ====================================================
110 
111     virtual ::rtl::OUString SAL_CALL
112         getImplementationName (void);
113 
114     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
115         getSupportedServiceNames (void);
116 
117 
118     virtual sal_Bool
119         implIsSelected( sal_Int32 nAccessibleChildIndex );
120 
121     /** Select or deselect the specified child or all children if the given
122         index has the special value ACCESSIBLE_SELECTION_CHILD_ALL.
123         Selecting or deselecting a child sets or resets the
124         <const>SELECTED</const> state and selects or deselects the UNO shape
125         being made accessible by the child.
126         @param nAccessibleChildIndex
127             Index of the child to select or deselect.  If the parameter has
128             the value ACCESSIBLE_SELECTION_CHILD_ALL then all children are
129             selected or deselected.
130         @param bSelect
131             Indicates whether to select or deselect the specified child
132             reps. children.
133     */
134     virtual void
135         implSelect( sal_Int32 nAccessibleChildIndex, sal_Bool bSelect );
136 private:
137     ::sd::ViewShell* mpSdViewSh;
138 
139 protected:
140     /** This object manages the shapes of the represented draw page.  It is
141         responsible to determine the visible shapes and create on demand the
142         accessible objects representing them.
143     */
144     ChildrenManager* mpChildrenManager;
145 
146     // This method is called from the component helper base class while
147     // disposing.
148     virtual void SAL_CALL disposing (void);
149 
150     /** Create a shape the represents the page as seen on the screen.
151     */
152     AccessiblePageShape* CreateDrawPageShape (void);
153 
154     /// Create an accessible name that contains the current view mode.
155     virtual ::rtl::OUString
156         CreateAccessibleName ();
157 
158     /** Create an accessible description that contains the current
159         view mode.
160     */
161     virtual ::rtl::OUString
162         CreateAccessibleDescription ();
163 
164     /** Make sure that the currently focused shape sends a FOCUSED state
165         change event indicating that it has (regained) the focus.
166     */
167     virtual void Activated (void);
168 
169     /** Make sure that the currently focused shape sends a FOCUSED state
170         change event indicating that it has lost the focus.
171     */
172     virtual void Deactivated (void);
173 
174     virtual void impl_dispose (void);
175 
176     //=====  XAccessibleGetAccFromXShape  ============================================
177     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
178         SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType);
179     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
180         GetSelAccContextInTable();
181 
182 private:
183     void UpdateAccessibleName (void);
184 };
185 
186 } // end of namespace accessibility
187 
188 #endif
189