Bump version to 5.0-14
[LibreOffice.git] / sdext / source / presenter / PresenterAccessibility.hxx
blobc3c429ffb755520e77ecdf3dae95fe6dff4e77f9
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 INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERACCESSIBILITY_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERACCESSIBILITY_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>
43 namespace sdext { namespace presenter {
45 class PresenterController;
46 class PresenterTextView;
48 namespace {
49 typedef ::cppu::WeakComponentImplHelper3 <
50 css::accessibility::XAccessible,
51 css::lang::XInitialization,
52 css::awt::XFocusListener
53 > PresenterAccessibleInterfaceBase;
56 class PresenterAccessible
57 : public ::cppu::BaseMutex,
58 public PresenterAccessibleInterfaceBase
60 public:
61 PresenterAccessible (
62 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
63 const ::rtl::Reference<PresenterController>& rpPresenterController,
64 const css::uno::Reference<css::drawing::framework::XPane>& rxMainPane);
65 virtual ~PresenterAccessible();
67 void SetAccessibleParent (const css::uno::Reference<css::accessibility::XAccessible>& rxAccessibleParent);
69 void UpdateAccessibilityHierarchy();
71 void NotifyCurrentSlideChange (
72 const sal_Int32 nCurrentSlideIndex,
73 const sal_Int32 nSlideCount);
75 virtual void SAL_CALL disposing() SAL_OVERRIDE;
77 //----- XAccessible -------------------------------------------------------
79 virtual css::uno::Reference<css::accessibility::XAccessibleContext> SAL_CALL
80 getAccessibleContext()
81 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 //----- XFocusListener ----------------------------------------------------
85 virtual void SAL_CALL focusGained (const css::awt::FocusEvent& rEvent)
86 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 virtual void SAL_CALL focusLost (const css::awt::FocusEvent& rEvent)
89 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 //----- XEventListener ----------------------------------------------------
93 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
94 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 //----- XInitialization ---------------------------------------------------
98 virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments)
99 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 class AccessibleObject;
102 class AccessibleParagraph;
104 private:
105 const css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
106 ::rtl::Reference<PresenterController> mpPresenterController;
107 css::uno::Reference<css::drawing::framework::XResourceId> mxMainPaneId;
108 css::uno::Reference<css::drawing::framework::XPane2> mxMainPane;
109 css::uno::Reference<css::awt::XWindow> mxMainWindow;
110 css::uno::Reference<css::awt::XWindow> mxPreviewContentWindow;
111 css::uno::Reference<css::awt::XWindow> mxPreviewBorderWindow;
112 css::uno::Reference<css::awt::XWindow> mxNotesContentWindow;
113 css::uno::Reference<css::awt::XWindow> mxNotesBorderWindow;
114 ::rtl::Reference<AccessibleObject> mpAccessibleConsole;
115 ::rtl::Reference<AccessibleObject> mpAccessiblePreview;
116 ::rtl::Reference<AccessibleObject> mpAccessibleNotes;
117 css::uno::Reference<css::accessibility::XAccessible> mxAccessibleParent;
119 void UpdateAccessibilityHierarchy (
120 const css::uno::Reference<css::awt::XWindow>& rxPreviewContentWindow,
121 const css::uno::Reference<css::awt::XWindow>& rxPreviewBorderWindow,
122 const OUString& rsTitle,
123 const css::uno::Reference<css::awt::XWindow>& rxNotesContentWindow,
124 const css::uno::Reference<css::awt::XWindow>& rxNotesBorderWindow,
125 const ::boost::shared_ptr<PresenterTextView>& rpNotesTextView);
126 PresenterPaneContainer::SharedPaneDescriptor GetPreviewPane() const;
129 } } // end of namespace ::sd::presenter
131 #endif
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */