Updated core
[LibreOffice.git] / sdext / source / presenter / PresenterAccessibility.hxx
blob10740d193d935c6aa0658c19ee71bfe1fba6895f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SDEXT_PRESENTER_PRESENTER_ACCESSIBILITY_HXX
21 #define SDEXT_PRESENTER_PRESENTER_ACCESSIBILITY_HXX
23 #include "PresenterPaneContainer.hxx"
25 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
26 #include <com/sun/star/accessibility/TextSegment.hpp>
27 #include <com/sun/star/accessibility/XAccessible.hpp>
28 #include <com/sun/star/awt/XFocusListener.hpp>
29 #include <com/sun/star/awt/XWindow2.hpp>
30 #include <com/sun/star/awt/WindowEvent.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
33 #include <com/sun/star/drawing/framework/XPane.hpp>
34 #include <com/sun/star/drawing/framework/XPane2.hpp>
35 #include <com/sun/star/lang/XInitialization.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <cppuhelper/compbase3.hxx>
38 #include <cppuhelper/basemutex.hxx>
39 #include <rtl/ref.hxx>
40 #include <boost/shared_ptr.hpp>
42 namespace cssu = ::com::sun::star::uno;
43 namespace cssa = ::com::sun::star::accessibility;
45 namespace sdext { namespace presenter {
47 class PresenterController;
48 class PresenterTextView;
50 namespace {
51 typedef ::cppu::WeakComponentImplHelper3 <
52 css::accessibility::XAccessible,
53 css::lang::XInitialization,
54 css::awt::XFocusListener
55 > PresenterAccessibleInterfaceBase;
58 class PresenterAccessible
59 : public ::cppu::BaseMutex,
60 public PresenterAccessibleInterfaceBase
62 public:
63 PresenterAccessible (
64 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
65 const ::rtl::Reference<PresenterController>& rpPresenterController,
66 const css::uno::Reference<css::drawing::framework::XPane>& rxMainPane);
67 virtual ~PresenterAccessible (void);
69 void SetAccessibleParent (const cssu::Reference<cssa::XAccessible>& rxAccessibleParent);
71 void UpdateAccessibilityHierarchy (void);
73 void NotifyCurrentSlideChange (
74 const sal_Int32 nCurrentSlideIndex,
75 const sal_Int32 nSlideCount);
77 virtual void SAL_CALL disposing (void);
79 //----- XAccessible -------------------------------------------------------
81 virtual cssu::Reference<cssa::XAccessibleContext> SAL_CALL
82 getAccessibleContext (void)
83 throw (cssu::RuntimeException);
85 //----- XFocusListener ----------------------------------------------------
87 virtual void SAL_CALL focusGained (const css::awt::FocusEvent& rEvent)
88 throw (cssu::RuntimeException);
90 virtual void SAL_CALL focusLost (const css::awt::FocusEvent& rEvent)
91 throw (cssu::RuntimeException);
93 //----- XEventListener ----------------------------------------------------
95 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
96 throw (cssu::RuntimeException);
98 //----- XInitialization ---------------------------------------------------
100 virtual void SAL_CALL initialize (const cssu::Sequence<cssu::Any>& rArguments)
101 throw (cssu::RuntimeException);
103 class AccessibleObject;
104 class AccessibleParagraph;
106 private:
107 const css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
108 ::rtl::Reference<PresenterController> mpPresenterController;
109 css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId;
110 css::uno::Reference<css::drawing::framework::XPane2> mxMainPane;
111 css::uno::Reference<css::awt::XWindow> mxMainWindow;
112 css::uno::Reference<css::awt::XWindow> mxPreviewContentWindow;
113 css::uno::Reference<css::awt::XWindow> mxPreviewBorderWindow;
114 css::uno::Reference<css::awt::XWindow> mxNotesContentWindow;
115 css::uno::Reference<css::awt::XWindow> mxNotesBorderWindow;
116 ::rtl::Reference<AccessibleObject> mpAccessibleConsole;
117 ::rtl::Reference<AccessibleObject> mpAccessiblePreview;
118 ::rtl::Reference<AccessibleObject> mpAccessibleNotes;
119 css::uno::Reference<css::accessibility::XAccessible> mxAccessibleParent;
121 void UpdateAccessibilityHierarchy (
122 const css::uno::Reference<css::awt::XWindow>& rxPreviewContentWindow,
123 const css::uno::Reference<css::awt::XWindow>& rxPreviewBorderWindow,
124 const OUString& rsTitle,
125 const css::uno::Reference<css::awt::XWindow>& rxNotesContentWindow,
126 const css::uno::Reference<css::awt::XWindow>& rxNotesBorderWindow,
127 const ::boost::shared_ptr<PresenterTextView>& rpNotesTextView);
128 PresenterPaneContainer::SharedPaneDescriptor GetPreviewPane (void) const;
131 } } // end of namespace ::sd::presenter
133 #endif
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */