1*06bcd5d2SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*06bcd5d2SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*06bcd5d2SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*06bcd5d2SAndrew Rist * distributed with this work for additional information 6*06bcd5d2SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*06bcd5d2SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*06bcd5d2SAndrew Rist * "License"); you may not use this file except in compliance 9*06bcd5d2SAndrew Rist * with the License. You may obtain a copy of the License at 10*06bcd5d2SAndrew Rist * 11*06bcd5d2SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*06bcd5d2SAndrew Rist * 13*06bcd5d2SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*06bcd5d2SAndrew Rist * software distributed under the License is distributed on an 15*06bcd5d2SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*06bcd5d2SAndrew Rist * KIND, either express or implied. See the License for the 17*06bcd5d2SAndrew Rist * specific language governing permissions and limitations 18*06bcd5d2SAndrew Rist * under the License. 19*06bcd5d2SAndrew Rist * 20*06bcd5d2SAndrew Rist *************************************************************/ 21*06bcd5d2SAndrew Rist 22*06bcd5d2SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SDEXT_PRESENTER_PRESENTER_ACCESSIBILITY_HXX 25cdf0e10cSrcweir #define SDEXT_PRESENTER_PRESENTER_ACCESSIBILITY_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "PresenterPaneContainer.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleStateType.hpp> 30cdf0e10cSrcweir #include <com/sun/star/accessibility/TextSegment.hpp> 31cdf0e10cSrcweir #include <com/sun/star/accessibility/XAccessible.hpp> 32cdf0e10cSrcweir #include <com/sun/star/awt/XFocusListener.hpp> 33cdf0e10cSrcweir #include <com/sun/star/awt/XWindow2.hpp> 34cdf0e10cSrcweir #include <com/sun/star/awt/WindowEvent.hpp> 35cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 36cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfigurationController.hpp> 37cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XPane.hpp> 38cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XPane2.hpp> 39cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp> 40cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 41cdf0e10cSrcweir #include <cppuhelper/compbase3.hxx> 42cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx> 43cdf0e10cSrcweir #include <rtl/ref.hxx> 44cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 45cdf0e10cSrcweir 46cdf0e10cSrcweir namespace css = ::com::sun::star; 47cdf0e10cSrcweir namespace cssu = ::com::sun::star::uno; 48cdf0e10cSrcweir namespace cssa = ::com::sun::star::accessibility; 49cdf0e10cSrcweir 50cdf0e10cSrcweir 51cdf0e10cSrcweir namespace sdext { namespace presenter { 52cdf0e10cSrcweir 53cdf0e10cSrcweir class PresenterController; 54cdf0e10cSrcweir class PresenterTextView; 55cdf0e10cSrcweir 56cdf0e10cSrcweir namespace { 57cdf0e10cSrcweir typedef ::cppu::WeakComponentImplHelper3 < 58cdf0e10cSrcweir css::accessibility::XAccessible, 59cdf0e10cSrcweir css::lang::XInitialization, 60cdf0e10cSrcweir css::awt::XFocusListener 61cdf0e10cSrcweir > PresenterAccessibleInterfaceBase; 62cdf0e10cSrcweir } 63cdf0e10cSrcweir 64cdf0e10cSrcweir class PresenterAccessible 65cdf0e10cSrcweir : public ::cppu::BaseMutex, 66cdf0e10cSrcweir public PresenterAccessibleInterfaceBase 67cdf0e10cSrcweir { 68cdf0e10cSrcweir public: 69cdf0e10cSrcweir PresenterAccessible ( 70cdf0e10cSrcweir const css::uno::Reference<css::uno::XComponentContext>& rxContext, 71cdf0e10cSrcweir const ::rtl::Reference<PresenterController>& rpPresenterController, 72cdf0e10cSrcweir const css::uno::Reference<css::drawing::framework::XPane>& rxMainPane); 73cdf0e10cSrcweir virtual ~PresenterAccessible (void); 74cdf0e10cSrcweir 75cdf0e10cSrcweir void SetAccessibleParent (const cssu::Reference<cssa::XAccessible>& rxAccessibleParent); 76cdf0e10cSrcweir 77cdf0e10cSrcweir void UpdateAccessibilityHierarchy (void); 78cdf0e10cSrcweir 79cdf0e10cSrcweir void NotifyCurrentSlideChange ( 80cdf0e10cSrcweir const sal_Int32 nCurrentSlideIndex, 81cdf0e10cSrcweir const sal_Int32 nSlideCount); 82cdf0e10cSrcweir 83cdf0e10cSrcweir /** Return whether accessibility support is active, i.e. whether 84cdf0e10cSrcweir somebody has called getAccessibleContext() yet. 85cdf0e10cSrcweir */ 86cdf0e10cSrcweir bool IsAccessibilityActive (void) const; 87cdf0e10cSrcweir 88cdf0e10cSrcweir virtual void SAL_CALL disposing (void); 89cdf0e10cSrcweir 90cdf0e10cSrcweir 91cdf0e10cSrcweir //----- XAccessible ------------------------------------------------------- 92cdf0e10cSrcweir 93cdf0e10cSrcweir virtual cssu::Reference<cssa::XAccessibleContext> SAL_CALL 94cdf0e10cSrcweir getAccessibleContext (void) 95cdf0e10cSrcweir throw (cssu::RuntimeException); 96cdf0e10cSrcweir 97cdf0e10cSrcweir 98cdf0e10cSrcweir //----- XFocusListener ---------------------------------------------------- 99cdf0e10cSrcweir 100cdf0e10cSrcweir virtual void SAL_CALL focusGained (const css::awt::FocusEvent& rEvent) 101cdf0e10cSrcweir throw (cssu::RuntimeException); 102cdf0e10cSrcweir 103cdf0e10cSrcweir virtual void SAL_CALL focusLost (const css::awt::FocusEvent& rEvent) 104cdf0e10cSrcweir throw (cssu::RuntimeException); 105cdf0e10cSrcweir 106cdf0e10cSrcweir 107cdf0e10cSrcweir //----- XEventListener ---------------------------------------------------- 108cdf0e10cSrcweir 109cdf0e10cSrcweir virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) 110cdf0e10cSrcweir throw (cssu::RuntimeException); 111cdf0e10cSrcweir 112cdf0e10cSrcweir 113cdf0e10cSrcweir //----- XInitialization --------------------------------------------------- 114cdf0e10cSrcweir 115cdf0e10cSrcweir virtual void SAL_CALL initialize (const cssu::Sequence<cssu::Any>& rArguments) 116cdf0e10cSrcweir throw (cssu::RuntimeException); 117cdf0e10cSrcweir 118cdf0e10cSrcweir 119cdf0e10cSrcweir class AccessibleObject; 120cdf0e10cSrcweir class AccessibleParagraph; 121cdf0e10cSrcweir 122cdf0e10cSrcweir private: 123cdf0e10cSrcweir const css::uno::Reference<css::uno::XComponentContext> mxComponentContext; 124cdf0e10cSrcweir ::rtl::Reference<PresenterController> mpPresenterController; 125cdf0e10cSrcweir css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId; 126cdf0e10cSrcweir css::uno::Reference<css::drawing::framework::XPane2> mxMainPane; 127cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxMainWindow; 128cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxPreviewContentWindow; 129cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxPreviewBorderWindow; 130cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxNotesContentWindow; 131cdf0e10cSrcweir css::uno::Reference<css::awt::XWindow> mxNotesBorderWindow; 132cdf0e10cSrcweir ::rtl::Reference<AccessibleObject> mpAccessibleConsole; 133cdf0e10cSrcweir ::rtl::Reference<AccessibleObject> mpAccessiblePreview; 134cdf0e10cSrcweir ::rtl::Reference<AccessibleObject> mpAccessibleNotes; 135cdf0e10cSrcweir css::uno::Reference<css::accessibility::XAccessible> mxAccessibleParent; 136cdf0e10cSrcweir 137cdf0e10cSrcweir void UpdateAccessibilityHierarchy ( 138cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxPreviewContentWindow, 139cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxPreviewBorderWindow, 140cdf0e10cSrcweir const ::rtl::OUString& rsTitle, 141cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxNotesContentWindow, 142cdf0e10cSrcweir const css::uno::Reference<css::awt::XWindow>& rxNotesBorderWindow, 143cdf0e10cSrcweir const ::boost::shared_ptr<PresenterTextView>& rpNotesTextView); 144cdf0e10cSrcweir PresenterPaneContainer::SharedPaneDescriptor GetPreviewPane (void) const; 145cdf0e10cSrcweir }; 146cdf0e10cSrcweir 147cdf0e10cSrcweir 148cdf0e10cSrcweir 149cdf0e10cSrcweir 150cdf0e10cSrcweir } } // end of namespace ::sd::presenter 151cdf0e10cSrcweir 152cdf0e10cSrcweir #endif 153