xref: /trunk/main/sd/source/ui/inc/AccessibleDrawDocumentView.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
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 
290deba7fbSSteve Yin #include <com/sun/star/accessibility/XAccessibleGroupPosition.hpp>
300deba7fbSSteve Yin 
31cdf0e10cSrcweir namespace accessibility {
32cdf0e10cSrcweir 
33cdf0e10cSrcweir 
34cdf0e10cSrcweir /** This class makes draw documents in the general view modes
35cdf0e10cSrcweir     accessible.  It passes all shapes on the current draw page to a
36cdf0e10cSrcweir     children manager and additionally creates a new shape that
37cdf0e10cSrcweir     represents the actual draw page.
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     Please see the documentation of the base class for further
40cdf0e10cSrcweir     explanations of the individual methods.
41cdf0e10cSrcweir */
42cdf0e10cSrcweir class AccessibleDrawDocumentView :
43cdf0e10cSrcweir     public AccessibleDocumentViewBase
440deba7fbSSteve Yin     ,public ::com::sun::star::accessibility::XAccessibleGroupPosition
45cdf0e10cSrcweir {
46cdf0e10cSrcweir public:
47cdf0e10cSrcweir     //=====  internal  ========================================================
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     AccessibleDrawDocumentView (::sd::Window* pSdWindow,
50cdf0e10cSrcweir         ::sd::ViewShell* pViewShell,
51cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
52cdf0e10cSrcweir         ::com::sun::star::frame::XController>& rxController,
53cdf0e10cSrcweir         const ::com::sun::star::uno::Reference<
54cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible>& rxParent);
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     virtual ~AccessibleDrawDocumentView (void);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     /** Complete the initialization begun in the constructor.
59cdf0e10cSrcweir     */
60cdf0e10cSrcweir     virtual void Init (void);
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     //=====  IAccessibleViewForwarderListener  ================================
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     virtual void ViewForwarderChanged (ChangeType aChangeType,
66cdf0e10cSrcweir         const IAccessibleViewForwarder* pViewForwarder);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     //=====  XAccessibleContext  ==============================================
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL
71cdf0e10cSrcweir         getAccessibleChildCount (void)
72cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
75cdf0e10cSrcweir         getAccessibleChild (sal_Int32 nIndex)
76cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException,
77cdf0e10cSrcweir             ::com::sun::star::lang::IndexOutOfBoundsException);
78cdf0e10cSrcweir 
790deba7fbSSteve Yin     virtual ::rtl::OUString SAL_CALL
800deba7fbSSteve Yin         getAccessibleName(void)
810deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     //=====  lang::XEventListener  ============================================
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     virtual void SAL_CALL
86cdf0e10cSrcweir         disposing (const ::com::sun::star::lang::EventObject& rEventObject)
87cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     //=====  XPropertyChangeListener  =========================================
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     virtual void SAL_CALL
93cdf0e10cSrcweir         propertyChange (const ::com::sun::star::beans::PropertyChangeEvent& rEventObject)
94cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
950deba7fbSSteve Yin     //=====  XInterface  ======================================================
960deba7fbSSteve Yin 
970deba7fbSSteve Yin     virtual com::sun::star::uno::Any SAL_CALL
980deba7fbSSteve Yin         queryInterface (const com::sun::star::uno::Type & rType)
990deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
1000deba7fbSSteve Yin 
1010deba7fbSSteve Yin     virtual void SAL_CALL
1020deba7fbSSteve Yin         acquire (void)
1030deba7fbSSteve Yin         throw ();
1040deba7fbSSteve Yin 
1050deba7fbSSteve Yin     virtual void SAL_CALL
1060deba7fbSSteve Yin         release (void)
1070deba7fbSSteve Yin         throw ();
1080deba7fbSSteve Yin 
1090deba7fbSSteve Yin     //=====  XAccessibleGroupPosition  =========================================
1100deba7fbSSteve Yin     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL
1110deba7fbSSteve Yin         getGroupPosition( const ::com::sun::star::uno::Any& rAny )
1120deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
1130deba7fbSSteve Yin     virtual ::rtl::OUString SAL_CALL getObjectLink( const ::com::sun::star::uno::Any& accoject )
1140deba7fbSSteve Yin         throw (::com::sun::star::uno::RuntimeException);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir protected:
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     //=====  XServiceInfo  ====================================================
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL
121cdf0e10cSrcweir         getImplementationName (void)
122cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
125cdf0e10cSrcweir         getSupportedServiceNames (void)
126cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 
129cdf0e10cSrcweir     virtual sal_Bool
130cdf0e10cSrcweir         implIsSelected( sal_Int32 nAccessibleChildIndex )
131cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     /** Select or deselect the specified child or all children if the given
134cdf0e10cSrcweir         index has the special value ACCESSIBLE_SELECTION_CHILD_ALL.
135cdf0e10cSrcweir         Selecting or deselecting a child sets or resets the
136*bd9c95deSJohn Bampton         <const>SELECTED</const> state and selects or deselects the UNO shape
13730acf5e8Spfg         being made accessible by the child.
138cdf0e10cSrcweir         @param nAccessibleChildIndex
139cdf0e10cSrcweir             Index of the child to select or deselect.  If the parameter has
140cdf0e10cSrcweir             the value ACCESSIBLE_SELECTION_CHILD_ALL then all children are
141*bd9c95deSJohn Bampton             selected or deselected.
142cdf0e10cSrcweir         @param bSelect
143cdf0e10cSrcweir             Indicates whether to select or deselect the specified child
144cdf0e10cSrcweir             reps. children.
145cdf0e10cSrcweir     */
146cdf0e10cSrcweir     virtual void
147cdf0e10cSrcweir         implSelect( sal_Int32 nAccessibleChildIndex, sal_Bool bSelect )
148cdf0e10cSrcweir         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
1490deba7fbSSteve Yin private:
1500deba7fbSSteve Yin     ::sd::ViewShell* mpSdViewSh;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir protected:
153cdf0e10cSrcweir     /** This object manages the shapes of the represented draw page.  It is
154cdf0e10cSrcweir         responsible to determine the visible shapes and create on demand the
155cdf0e10cSrcweir         accessible objects representing them.
156cdf0e10cSrcweir     */
157cdf0e10cSrcweir     ChildrenManager* mpChildrenManager;
158cdf0e10cSrcweir 
159cdf0e10cSrcweir     // This method is called from the component helper base class while
160cdf0e10cSrcweir     // disposing.
161cdf0e10cSrcweir     virtual void SAL_CALL disposing (void);
162cdf0e10cSrcweir 
163cdf0e10cSrcweir     /** Create a shape the represents the page as seen on the screen.
164cdf0e10cSrcweir     */
165cdf0e10cSrcweir     AccessiblePageShape* CreateDrawPageShape (void);
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     /// Create an accessible name that contains the current view mode.
168cdf0e10cSrcweir     virtual ::rtl::OUString
169cdf0e10cSrcweir         CreateAccessibleName ()
170cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     /** Create an accessible description that contains the current
173cdf0e10cSrcweir         view mode.
174cdf0e10cSrcweir     */
175cdf0e10cSrcweir     virtual ::rtl::OUString
176cdf0e10cSrcweir         CreateAccessibleDescription ()
177cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
178cdf0e10cSrcweir 
179cdf0e10cSrcweir     /** Make sure that the currently focused shape sends a FOCUSED state
180cdf0e10cSrcweir         change event indicating that it has (regained) the focus.
181cdf0e10cSrcweir     */
182cdf0e10cSrcweir     virtual void Activated (void);
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     /** Make sure that the currently focused shape sends a FOCUSED state
185cdf0e10cSrcweir         change event indicating that it has lost the focus.
186cdf0e10cSrcweir     */
187cdf0e10cSrcweir     virtual void Deactivated (void);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir     virtual void impl_dispose (void);
190cdf0e10cSrcweir 
1910deba7fbSSteve Yin     //=====  XAccessibleGetAccFromXShape  ============================================
1920deba7fbSSteve Yin     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
1930deba7fbSSteve Yin         SAL_CALL get_AccFlowTo(const ::com::sun::star::uno::Any& rAny, sal_Int32 nType)
1940deba7fbSSteve Yin         throw ( ::com::sun::star::uno::RuntimeException );
1950deba7fbSSteve Yin     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
1960deba7fbSSteve Yin         GetSelAccContextInTable();
1970deba7fbSSteve Yin 
198cdf0e10cSrcweir private:
199cdf0e10cSrcweir     void UpdateAccessibleName (void);
200cdf0e10cSrcweir };
201cdf0e10cSrcweir 
202cdf0e10cSrcweir } // end of namespace accessibility
203cdf0e10cSrcweir 
204cdf0e10cSrcweir #endif
205