Update ooo320-m1
[ooovba.git] / sdext / source / presenter / PresenterAccessibility.hxx
blob8c4c3b021e85a88bfd6f74dafa241f4c82a2b4a2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PresenterPane.hxx,v $
11 * $Revision: 1.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SDEXT_PRESENTER_PRESENTER_ACCESSIBILITY_HXX
33 #define SDEXT_PRESENTER_PRESENTER_ACCESSIBILITY_HXX
35 #include "PresenterPaneContainer.hxx"
37 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
38 #include <com/sun/star/accessibility/TextSegment.hpp>
39 #include <com/sun/star/accessibility/XAccessible.hpp>
40 #include <com/sun/star/awt/XFocusListener.hpp>
41 #include <com/sun/star/awt/XWindow2.hpp>
42 #include <com/sun/star/awt/WindowEvent.hpp>
43 #include <com/sun/star/beans/XPropertySet.hpp>
44 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
45 #include <com/sun/star/drawing/framework/XPane.hpp>
46 #include <com/sun/star/drawing/framework/XPane2.hpp>
47 #include <com/sun/star/lang/XInitialization.hpp>
48 #include <com/sun/star/uno/XComponentContext.hpp>
49 #include <cppuhelper/compbase3.hxx>
50 #include <cppuhelper/basemutex.hxx>
51 #include <rtl/ref.hxx>
52 #include <boost/shared_ptr.hpp>
54 namespace css = ::com::sun::star;
55 namespace cssu = ::com::sun::star::uno;
56 namespace cssa = ::com::sun::star::accessibility;
59 namespace sdext { namespace presenter {
61 class PresenterController;
62 class PresenterTextView;
64 namespace {
65 typedef ::cppu::WeakComponentImplHelper3 <
66 css::accessibility::XAccessible,
67 css::lang::XInitialization,
68 css::awt::XFocusListener
69 > PresenterAccessibleInterfaceBase;
72 class PresenterAccessible
73 : public ::cppu::BaseMutex,
74 public PresenterAccessibleInterfaceBase
76 public:
77 PresenterAccessible (
78 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
79 const ::rtl::Reference<PresenterController>& rpPresenterController,
80 const css::uno::Reference<css::drawing::framework::XPane>& rxMainPane);
81 virtual ~PresenterAccessible (void);
83 void SetAccessibleParent (const cssu::Reference<cssa::XAccessible>& rxAccessibleParent);
85 void UpdateAccessibilityHierarchy (void);
87 void NotifyCurrentSlideChange (
88 const sal_Int32 nCurrentSlideIndex,
89 const sal_Int32 nSlideCount);
91 /** Return whether accessibility support is active, i.e. whether
92 somebody has called getAccessibleContext() yet.
94 bool IsAccessibilityActive (void) const;
96 virtual void SAL_CALL disposing (void);
99 //----- XAccessible -------------------------------------------------------
101 virtual cssu::Reference<cssa::XAccessibleContext> SAL_CALL
102 getAccessibleContext (void)
103 throw (cssu::RuntimeException);
106 //----- XFocusListener ----------------------------------------------------
108 virtual void SAL_CALL focusGained (const css::awt::FocusEvent& rEvent)
109 throw (cssu::RuntimeException);
111 virtual void SAL_CALL focusLost (const css::awt::FocusEvent& rEvent)
112 throw (cssu::RuntimeException);
115 //----- XEventListener ----------------------------------------------------
117 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
118 throw (cssu::RuntimeException);
121 //----- XInitialization ---------------------------------------------------
123 virtual void SAL_CALL initialize (const cssu::Sequence<cssu::Any>& rArguments)
124 throw (cssu::RuntimeException);
127 class AccessibleObject;
128 class AccessibleParagraph;
130 private:
131 const css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
132 ::rtl::Reference<PresenterController> mpPresenterController;
133 css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId;
134 css::uno::Reference<css::drawing::framework::XPane2> mxMainPane;
135 css::uno::Reference<css::awt::XWindow> mxMainWindow;
136 css::uno::Reference<css::awt::XWindow> mxPreviewContentWindow;
137 css::uno::Reference<css::awt::XWindow> mxPreviewBorderWindow;
138 css::uno::Reference<css::awt::XWindow> mxNotesContentWindow;
139 css::uno::Reference<css::awt::XWindow> mxNotesBorderWindow;
140 ::rtl::Reference<AccessibleObject> mpAccessibleConsole;
141 ::rtl::Reference<AccessibleObject> mpAccessiblePreview;
142 ::rtl::Reference<AccessibleObject> mpAccessibleNotes;
143 css::uno::Reference<css::accessibility::XAccessible> mxAccessibleParent;
145 void UpdateAccessibilityHierarchy (
146 const css::uno::Reference<css::awt::XWindow>& rxPreviewContentWindow,
147 const css::uno::Reference<css::awt::XWindow>& rxPreviewBorderWindow,
148 const ::rtl::OUString& rsTitle,
149 const css::uno::Reference<css::awt::XWindow>& rxNotesContentWindow,
150 const css::uno::Reference<css::awt::XWindow>& rxNotesBorderWindow,
151 const ::boost::shared_ptr<PresenterTextView>& rpNotesTextView);
152 PresenterPaneContainer::SharedPaneDescriptor GetPreviewPane (void) const;
158 } } // end of namespace ::sd::presenter
160 #endif