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