1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/compbase.hxx>
38 #include <cppuhelper/basemutex.hxx>
39 #include <rtl/ref.hxx>
43 namespace sdext
{ namespace presenter
{
45 class PresenterController
;
46 class PresenterTextView
;
48 typedef ::cppu::WeakComponentImplHelper
<
49 css::accessibility::XAccessible
,
50 css::lang::XInitialization
,
51 css::awt::XFocusListener
52 > PresenterAccessibleInterfaceBase
;
54 class PresenterAccessible
55 : public ::cppu::BaseMutex
,
56 public PresenterAccessibleInterfaceBase
60 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
61 const ::rtl::Reference
<PresenterController
>& rpPresenterController
,
62 const css::uno::Reference
<css::drawing::framework::XPane
>& rxMainPane
);
63 virtual ~PresenterAccessible() override
;
65 void UpdateAccessibilityHierarchy();
67 void NotifyCurrentSlideChange ();
69 virtual void SAL_CALL
disposing() override
;
71 //----- XAccessible -------------------------------------------------------
73 virtual css::uno::Reference
<css::accessibility::XAccessibleContext
> SAL_CALL
74 getAccessibleContext() override
;
76 //----- XFocusListener ----------------------------------------------------
78 virtual void SAL_CALL
focusGained (const css::awt::FocusEvent
& rEvent
) override
;
80 virtual void SAL_CALL
focusLost (const css::awt::FocusEvent
& rEvent
) override
;
82 //----- XEventListener ----------------------------------------------------
84 virtual void SAL_CALL
disposing (const css::lang::EventObject
& rEvent
) override
;
86 //----- XInitialization ---------------------------------------------------
88 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
) override
;
90 class AccessibleObject
;
91 class AccessibleParagraph
;
94 const css::uno::Reference
<css::uno::XComponentContext
> mxComponentContext
;
95 ::rtl::Reference
<PresenterController
> mpPresenterController
;
96 css::uno::Reference
<css::drawing::framework::XPane2
> mxMainPane
;
97 css::uno::Reference
<css::awt::XWindow
> mxMainWindow
;
98 css::uno::Reference
<css::awt::XWindow
> mxPreviewContentWindow
;
99 css::uno::Reference
<css::awt::XWindow
> mxPreviewBorderWindow
;
100 css::uno::Reference
<css::awt::XWindow
> mxNotesContentWindow
;
101 css::uno::Reference
<css::awt::XWindow
> mxNotesBorderWindow
;
102 ::rtl::Reference
<AccessibleObject
> mpAccessibleConsole
;
103 ::rtl::Reference
<AccessibleObject
> mpAccessiblePreview
;
104 ::rtl::Reference
<AccessibleObject
> mpAccessibleNotes
;
105 css::uno::Reference
<css::accessibility::XAccessible
> mxAccessibleParent
;
107 void UpdateAccessibilityHierarchy (
108 const css::uno::Reference
<css::awt::XWindow
>& rxPreviewContentWindow
,
109 const css::uno::Reference
<css::awt::XWindow
>& rxPreviewBorderWindow
,
110 const OUString
& rsTitle
,
111 const css::uno::Reference
<css::awt::XWindow
>& rxNotesContentWindow
,
112 const css::uno::Reference
<css::awt::XWindow
>& rxNotesBorderWindow
,
113 const std::shared_ptr
<PresenterTextView
>& rpNotesTextView
);
114 PresenterPaneContainer::SharedPaneDescriptor
GetPreviewPane() const;
117 } } // end of namespace ::sd::presenter
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */