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