xref: /AOO41X/main/sd/source/ui/inc/AccessibleDrawDocumentView.hxx (revision 0deba7fbda3d9908785c25a443701a293b6f4e71)
1c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c45d927aSAndrew Rist  * distributed with this work for additional information
6c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17c45d927aSAndrew Rist  * specific language governing permissions and limitations
18c45d927aSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20c45d927aSAndrew Rist  *************************************************************/
21c45d927aSAndrew Rist 
22c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SD_ACCESSIBILITY_ACCESSIBLE_DRAW_DOCUMENT_VIEW_HXX
25cdf0e10cSrcweir #define _SD_ACCESSIBILITY_ACCESSIBLE_DRAW_DOCUMENT_VIEW_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "AccessibleDocumentViewBase.hxx"
28cdf0e10cSrcweir 
29*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
30*0deba7fbSSteve Yin #include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
31*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
32*0deba7fbSSteve Yin 
33cdf0e10cSrcweir namespace accessibility {
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir /** This class makes draw documents in the general view modes
37cdf0e10cSrcweir     accessible.  It passes all shapes on the current draw page to a
38cdf0e10cSrcweir     children manager and additionally creates a new shape that
39cdf0e10cSrcweir     represents the actual draw page.
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     Please see the documentation of the base class for further
42cdf0e10cSrcweir     explanations of the individual methods.
43cdf0e10cSrcweir */
44cdf0e10cSrcweir class AccessibleDrawDocumentView :
45cdf0e10cSrcweir     public AccessibleDocumentViewBase
46*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
47*0deba7fbSSteve Yin     ,public ::com::sun::star::accessibility::XAccessibleGroupPosition
48*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
49cdf0e10cSrcweir {
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir     //=====  internal  ========================================================
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     AccessibleDrawDocumentView (::sd::Window* pSdWindow,
54cdf0e10cSrcweir         ::sd::ViewShell* pViewShell,
55cdf0e10cSrcweir 	    const ::com::sun::star::uno::Reference<
56cdf0e10cSrcweir 	    ::com::sun::star::frame::XController>& rxController,
57cdf0e10cSrcweir 	    const ::com::sun::star::uno::Reference<
58cdf0e10cSrcweir 	    ::com::sun::star::accessibility::XAccessible>& rxParent);
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     virtual ~AccessibleDrawDocumentView	(void);
61cdf0e10cSrcweir 
62cdf0e10cSrcweir     /** Complete the initialization begun in the constructor.
63cdf0e10cSrcweir     */
64cdf0e10cSrcweir     virtual void Init (void);
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     //=====  IAccessibleViewForwarderListener  ================================
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     virtual void ViewForwarderChanged (ChangeType aChangeType,
70cdf0e10cSrcweir         const IAccessibleViewForwarder* pViewForwarder);
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     //=====  XAccessibleContext  ==============================================
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL
75cdf0e10cSrcweir         getAccessibleChildCount (void)
76cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
79cdf0e10cSrcweir         getAccessibleChild (sal_Int32 nIndex)
80cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException,
81cdf0e10cSrcweir             ::com::sun::star::lang::IndexOutOfBoundsException);
82cdf0e10cSrcweir 
83*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
84*0deba7fbSSteve Yin 	virtual ::rtl::OUString SAL_CALL
85*0deba7fbSSteve Yin 		getAccessibleName(void)
86*0deba7fbSSteve Yin 		throw (::com::sun::star::uno::RuntimeException);
87*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     //=====  lang::XEventListener  ============================================
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	virtual void SAL_CALL
92cdf0e10cSrcweir 		disposing (const ::com::sun::star::lang::EventObject& rEventObject)
93cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     //=====  XPropertyChangeListener  =========================================
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	virtual void SAL_CALL
99cdf0e10cSrcweir 		propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject)
100cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
101*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
102*0deba7fbSSteve Yin     //=====  XInterface  ======================================================
103*0deba7fbSSteve Yin 
104*0deba7fbSSteve Yin     virtual com::sun::star::uno::Any SAL_CALL
105*0deba7fbSSteve Yin 		queryInterface (const com::sun::star::uno::Type & rType)
106*0deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
107*0deba7fbSSteve Yin 
108*0deba7fbSSteve Yin     virtual void SAL_CALL
109*0deba7fbSSteve Yin         acquire (void)
110*0deba7fbSSteve Yin         throw ();
111*0deba7fbSSteve Yin 
112*0deba7fbSSteve Yin     virtual void SAL_CALL
113*0deba7fbSSteve Yin         release (void)
114*0deba7fbSSteve Yin         throw ();
115*0deba7fbSSteve Yin 
116*0deba7fbSSteve Yin     //=====  XAccessibleGroupPosition  =========================================
117*0deba7fbSSteve Yin 	virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
118*0deba7fbSSteve Yin 		getGroupPosition( const ::com::sun::star::uno::Any& rAny )
119*0deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
120*0deba7fbSSteve Yin 	virtual ::rtl::OUString SAL_CALL getObjectLink( const ::com::sun::star::uno::Any& accoject )
121*0deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
122*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
123cdf0e10cSrcweir 
124cdf0e10cSrcweir protected:
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     //=====  XServiceInfo  ====================================================
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL
129cdf0e10cSrcweir     	getImplementationName (void)
130cdf0e10cSrcweir 	    throw (::com::sun::star::uno::RuntimeException);
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
133cdf0e10cSrcweir         getSupportedServiceNames (void)
134cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	virtual sal_Bool
138cdf0e10cSrcweir         implIsSelected( sal_Int32 nAccessibleChildIndex )
139cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     /** Select or deselect the specified child or all children if the given
142cdf0e10cSrcweir         index has the special value ACCESSIBLE_SELECTION_CHILD_ALL.
143cdf0e10cSrcweir         Selecting or deselecting a child sets or resets the
144cdf0e10cSrcweir         <const>SELECTED</const> state and selects or deslects the UNO shape
145cdf0e10cSrcweir         beeing made accessible by the child.
146cdf0e10cSrcweir         @param nAccessibleChildIndex
147cdf0e10cSrcweir             Index of the child to select or deselect.  If the parameter has
148cdf0e10cSrcweir             the value ACCESSIBLE_SELECTION_CHILD_ALL then all children are
149cdf0e10cSrcweir             selected or deslected.
150cdf0e10cSrcweir         @param bSelect
151cdf0e10cSrcweir             Indicates whether to select or deselect the specified child
152cdf0e10cSrcweir             reps. children.
153cdf0e10cSrcweir     */
154cdf0e10cSrcweir     virtual void
155cdf0e10cSrcweir         implSelect( sal_Int32 nAccessibleChildIndex, sal_Bool bSelect )
156cdf0e10cSrcweir         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
157*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
158*0deba7fbSSteve Yin private:
159*0deba7fbSSteve Yin 	::sd::ViewShell* mpSdViewSh;
160*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
161cdf0e10cSrcweir 
162cdf0e10cSrcweir protected:
163cdf0e10cSrcweir     /** This object manages the shapes of the represented draw page.  It is
164cdf0e10cSrcweir         responsible to determine the visible shapes and create on demand the
165cdf0e10cSrcweir         accessible objects representing them.
166cdf0e10cSrcweir     */
167cdf0e10cSrcweir     ChildrenManager* mpChildrenManager;
168cdf0e10cSrcweir 
169cdf0e10cSrcweir     // This method is called from the component helper base class while
170cdf0e10cSrcweir     // disposing.
171cdf0e10cSrcweir     virtual void SAL_CALL disposing (void);
172cdf0e10cSrcweir 
173cdf0e10cSrcweir     /** Create a shape the represents the page as seen on the screen.
174cdf0e10cSrcweir     */
175cdf0e10cSrcweir     AccessiblePageShape* CreateDrawPageShape (void);
176cdf0e10cSrcweir 
177cdf0e10cSrcweir     ///	Create an accessible name that contains the current view mode.
178cdf0e10cSrcweir     virtual ::rtl::OUString
179cdf0e10cSrcweir     	CreateAccessibleName ()
180cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
181cdf0e10cSrcweir 
182cdf0e10cSrcweir     /**	Create an accessible description that contains the current
183cdf0e10cSrcweir     	view mode.
184cdf0e10cSrcweir     */
185cdf0e10cSrcweir     virtual ::rtl::OUString
186cdf0e10cSrcweir     	CreateAccessibleDescription ()
187cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir     /** Make sure that the currently focused shape sends a FOCUSED state
190cdf0e10cSrcweir         change event indicating that it has (regained) the focus.
191cdf0e10cSrcweir     */
192cdf0e10cSrcweir     virtual void Activated (void);
193cdf0e10cSrcweir 
194cdf0e10cSrcweir     /** Make sure that the currently focused shape sends a FOCUSED state
195cdf0e10cSrcweir         change event indicating that it has lost the focus.
196cdf0e10cSrcweir     */
197cdf0e10cSrcweir     virtual void Deactivated (void);
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     virtual void impl_dispose (void);
200cdf0e10cSrcweir 
201*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009-----
202*0deba7fbSSteve Yin     //=====  XAccessibleGetAccFromXShape  ============================================
203*0deba7fbSSteve Yin 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
204*0deba7fbSSteve Yin 		SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
205*0deba7fbSSteve Yin 		throw ( ::com::sun::star::uno::RuntimeException );
206*0deba7fbSSteve Yin 	::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
207*0deba7fbSSteve Yin 		GetSelAccContextInTable();
208*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009
209*0deba7fbSSteve Yin 
210cdf0e10cSrcweir private:
211cdf0e10cSrcweir     void UpdateAccessibleName (void);
212cdf0e10cSrcweir };
213cdf0e10cSrcweir 
214cdf0e10cSrcweir } // end of namespace accessibility
215cdf0e10cSrcweir 
216cdf0e10cSrcweir #endif
217