106bcd5d2SAndrew Rist /************************************************************** 2*6d8c2cf3Smseidel * 306bcd5d2SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 406bcd5d2SAndrew Rist * or more contributor license agreements. See the NOTICE file 506bcd5d2SAndrew Rist * distributed with this work for additional information 606bcd5d2SAndrew Rist * regarding copyright ownership. The ASF licenses this file 706bcd5d2SAndrew Rist * to you under the Apache License, Version 2.0 (the 806bcd5d2SAndrew Rist * "License"); you may not use this file except in compliance 906bcd5d2SAndrew Rist * with the License. You may obtain a copy of the License at 10*6d8c2cf3Smseidel * 1106bcd5d2SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*6d8c2cf3Smseidel * 1306bcd5d2SAndrew Rist * Unless required by applicable law or agreed to in writing, 1406bcd5d2SAndrew Rist * software distributed under the License is distributed on an 1506bcd5d2SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1606bcd5d2SAndrew Rist * KIND, either express or implied. See the License for the 1706bcd5d2SAndrew Rist * specific language governing permissions and limitations 1806bcd5d2SAndrew Rist * under the License. 19*6d8c2cf3Smseidel * 2006bcd5d2SAndrew Rist *************************************************************/ 2106bcd5d2SAndrew Rist 2206bcd5d2SAndrew 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 { 57*6d8c2cf3Smseidel typedef ::cppu::WeakComponentImplHelper3 < 58*6d8c2cf3Smseidel css::accessibility::XAccessible, 59*6d8c2cf3Smseidel css::lang::XInitialization, 60*6d8c2cf3Smseidel css::awt::XFocusListener 61*6d8c2cf3Smseidel > PresenterAccessibleInterfaceBase; 62cdf0e10cSrcweir } 63cdf0e10cSrcweir 64cdf0e10cSrcweir class PresenterAccessible 65*6d8c2cf3Smseidel : public ::cppu::BaseMutex, 66*6d8c2cf3Smseidel public PresenterAccessibleInterfaceBase 67cdf0e10cSrcweir { 68cdf0e10cSrcweir public: 69*6d8c2cf3Smseidel PresenterAccessible ( 70*6d8c2cf3Smseidel const css::uno::Reference<css::uno::XComponentContext>& rxContext, 71*6d8c2cf3Smseidel const ::rtl::Reference<PresenterController>& rpPresenterController, 72*6d8c2cf3Smseidel const css::uno::Reference<css::drawing::framework::XPane>& rxMainPane); 73*6d8c2cf3Smseidel virtual ~PresenterAccessible (void); 74cdf0e10cSrcweir 75*6d8c2cf3Smseidel void SetAccessibleParent (const cssu::Reference<cssa::XAccessible>& rxAccessibleParent); 76cdf0e10cSrcweir 77*6d8c2cf3Smseidel void UpdateAccessibilityHierarchy (void); 78cdf0e10cSrcweir 79*6d8c2cf3Smseidel void NotifyCurrentSlideChange ( 80*6d8c2cf3Smseidel const sal_Int32 nCurrentSlideIndex, 81*6d8c2cf3Smseidel const sal_Int32 nSlideCount); 82cdf0e10cSrcweir 83*6d8c2cf3Smseidel /** Return whether accessibility support is active, i.e. whether 84*6d8c2cf3Smseidel somebody has called getAccessibleContext() yet. 85*6d8c2cf3Smseidel */ 86*6d8c2cf3Smseidel bool IsAccessibilityActive (void) const; 87cdf0e10cSrcweir 88*6d8c2cf3Smseidel virtual void SAL_CALL disposing (void); 89cdf0e10cSrcweir 90cdf0e10cSrcweir 91*6d8c2cf3Smseidel //----- XAccessible ------------------------------------------------------- 92cdf0e10cSrcweir 93*6d8c2cf3Smseidel virtual cssu::Reference<cssa::XAccessibleContext> SAL_CALL 94*6d8c2cf3Smseidel getAccessibleContext (void) 95*6d8c2cf3Smseidel throw (cssu::RuntimeException); 96cdf0e10cSrcweir 97cdf0e10cSrcweir 98*6d8c2cf3Smseidel //----- XFocusListener ---------------------------------------------------- 99cdf0e10cSrcweir 100*6d8c2cf3Smseidel virtual void SAL_CALL focusGained (const css::awt::FocusEvent& rEvent) 101*6d8c2cf3Smseidel throw (cssu::RuntimeException); 102cdf0e10cSrcweir 103*6d8c2cf3Smseidel virtual void SAL_CALL focusLost (const css::awt::FocusEvent& rEvent) 104*6d8c2cf3Smseidel throw (cssu::RuntimeException); 105cdf0e10cSrcweir 106cdf0e10cSrcweir 107*6d8c2cf3Smseidel //----- XEventListener ---------------------------------------------------- 108cdf0e10cSrcweir 109*6d8c2cf3Smseidel virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) 110*6d8c2cf3Smseidel throw (cssu::RuntimeException); 111cdf0e10cSrcweir 112cdf0e10cSrcweir 113*6d8c2cf3Smseidel //----- XInitialization --------------------------------------------------- 114*6d8c2cf3Smseidel 115*6d8c2cf3Smseidel virtual void SAL_CALL initialize (const cssu::Sequence<cssu::Any>& rArguments) 116*6d8c2cf3Smseidel throw (cssu::RuntimeException); 117*6d8c2cf3Smseidel 118*6d8c2cf3Smseidel 119*6d8c2cf3Smseidel class AccessibleObject; 120*6d8c2cf3Smseidel class AccessibleParagraph; 121cdf0e10cSrcweir 122cdf0e10cSrcweir private: 123*6d8c2cf3Smseidel const css::uno::Reference<css::uno::XComponentContext> mxComponentContext; 124*6d8c2cf3Smseidel ::rtl::Reference<PresenterController> mpPresenterController; 125*6d8c2cf3Smseidel css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId; 126*6d8c2cf3Smseidel css::uno::Reference<css::drawing::framework::XPane2> mxMainPane; 127*6d8c2cf3Smseidel css::uno::Reference<css::awt::XWindow> mxMainWindow; 128*6d8c2cf3Smseidel css::uno::Reference<css::awt::XWindow> mxPreviewContentWindow; 129*6d8c2cf3Smseidel css::uno::Reference<css::awt::XWindow> mxPreviewBorderWindow; 130*6d8c2cf3Smseidel css::uno::Reference<css::awt::XWindow> mxNotesContentWindow; 131*6d8c2cf3Smseidel css::uno::Reference<css::awt::XWindow> mxNotesBorderWindow; 132*6d8c2cf3Smseidel ::rtl::Reference<AccessibleObject> mpAccessibleConsole; 133*6d8c2cf3Smseidel ::rtl::Reference<AccessibleObject> mpAccessiblePreview; 134*6d8c2cf3Smseidel ::rtl::Reference<AccessibleObject> mpAccessibleNotes; 135*6d8c2cf3Smseidel css::uno::Reference<css::accessibility::XAccessible> mxAccessibleParent; 136*6d8c2cf3Smseidel 137*6d8c2cf3Smseidel void UpdateAccessibilityHierarchy ( 138*6d8c2cf3Smseidel const css::uno::Reference<css::awt::XWindow>& rxPreviewContentWindow, 139*6d8c2cf3Smseidel const css::uno::Reference<css::awt::XWindow>& rxPreviewBorderWindow, 140*6d8c2cf3Smseidel const ::rtl::OUString& rsTitle, 141*6d8c2cf3Smseidel const css::uno::Reference<css::awt::XWindow>& rxNotesContentWindow, 142*6d8c2cf3Smseidel const css::uno::Reference<css::awt::XWindow>& rxNotesBorderWindow, 143*6d8c2cf3Smseidel const ::boost::shared_ptr<PresenterTextView>& rpNotesTextView); 144*6d8c2cf3Smseidel PresenterPaneContainer::SharedPaneDescriptor GetPreviewPane (void) const; 145cdf0e10cSrcweir }; 146cdf0e10cSrcweir 147cdf0e10cSrcweir 148cdf0e10cSrcweir 149cdf0e10cSrcweir 150cdf0e10cSrcweir } } // end of namespace ::sd::presenter 151cdf0e10cSrcweir 152cdf0e10cSrcweir #endif 153