LibreOffice Module sd (master) 1
PresenterScreen.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSCREEN_HXX
21#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSCREEN_HXX
22
27#include <com/sun/star/frame/XController.hpp>
28#include <com/sun/star/frame/XModel2.hpp>
29#include <com/sun/star/task/XJob.hpp>
30#include <com/sun/star/lang/XServiceInfo.hpp>
31#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
32#include <com/sun/star/presentation/XPresentation2.hpp>
33#include <rtl/ref.hxx>
34
35#include <map>
36#include <string_view>
37
38namespace sd { class DrawController; }
39
40namespace sdext::presenter {
41
42class PresenterController;
43
44typedef ::cppu::WeakComponentImplHelper <
45 css::task::XJob, css::lang::XServiceInfo
47
54 : private ::cppu::BaseMutex,
56{
57public:
60
61 virtual void SAL_CALL disposing() override;
62
63 // XServiceInfo
64 virtual OUString SAL_CALL getImplementationName() override;
65 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
66 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override;
67
68 // XJob
69 virtual css::uno::Any SAL_CALL execute(
70 const css::uno::Sequence<css::beans::NamedValue >& Arguments) override;
71
72 explicit PresenterScreenJob (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
73 virtual ~PresenterScreenJob() override;
74
75private:
76 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
77};
78
90typedef ::cppu::WeakComponentImplHelper <
91 css::lang::XEventListener
94 : private ::cppu::BaseMutex,
96{
97public:
99 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
100 css::uno::Reference<css::frame::XModel2> xModel);
101 virtual ~PresenterScreen() override;
104
105 virtual void SAL_CALL disposing() override;
106
107 static bool isPresenterScreenEnabled(
108 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
109 static bool isPresenterScreenFullScreen(
110 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
111
115
121
124 void SwitchMonitors();
125
126 // XEventListener
127
128 virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) override;
129
130private:
131 css::uno::Reference<css::frame::XModel2 > mxModel;
133 css::uno::WeakReference<css::drawing::framework::XConfigurationController>
135 css::uno::WeakReference<css::uno::XComponentContext> mxContextWeak;
137 css::uno::Reference<css::drawing::framework::XConfiguration> mxSavedConfiguration;
139 css::uno::Reference<css::drawing::framework::XResourceFactory> mxPaneFactory;
140 css::uno::Reference<css::drawing::framework::XResourceFactory> mxViewFactory;
141
143 {
144 public:
145 OUString msTitle;
149 : mbIsOpaque(false)
150 {
151 }
152 };
153 typedef ::std::map<OUString,ViewDescriptor> ViewDescriptorContainer;
155
157
160 void SetupPaneFactory (
161 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
162
165 void SetupViewFactory (
166 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
167
171 void SetupConfiguration (
172 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
173 const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId);
174
179 void ProcessLayout (
180 PresenterConfigurationAccess& rConfiguration,
181 std::u16string_view rsLayoutName,
182 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
183 const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId);
184
188 void ProcessComponent (
189 const ::std::vector<css::uno::Any>& rValues,
190 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
191 const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId);
192
196 PresenterConfigurationAccess& rConfiguration);
197
201 const ::std::vector<css::uno::Any>& rValues);
202
203 void SetupView (
204 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
205 const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId,
206 const OUString& rsPaneURL,
207 const OUString& rsViewURL,
208 const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization);
209
216 sal_Int32 GetPresenterScreenNumber (
217 const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const;
218
219 static sal_Int32 GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen );
220
224 css::uno::Reference<css::drawing::framework::XResourceId> GetMainPaneId (
225 const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation,
226 const css::uno::Reference<com::sun::star::uno::XComponentContext>& xContext) const;
227};
228
229}
230
231#endif
232
233/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class gives access to the configuration.
::std::function< void(const css::uno::Reference< css::drawing::framework::XView > &)> ViewInitializationFunction
The PresenterScreenJob service is instantiated every time a document is created or loaded.
virtual void SAL_CALL disposing() override
virtual css::uno::Any SAL_CALL execute(const css::uno::Sequence< css::beans::NamedValue > &Arguments) override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
PresenterScreenJob(const PresenterScreenJob &)=delete
PresenterScreenJob & operator=(const PresenterScreenJob &)=delete
css::uno::Reference< css::uno::XComponentContext > mxComponentContext
PresenterScreenJob(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
rtl::Reference<::sd::DrawController > mxController
css::uno::Reference< css::drawing::framework::XConfiguration > mxSavedConfiguration
void SetupConfiguration(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId)
Read the current layout from the configuration and call ProcessLayout to bring it on to the screen.
virtual void SAL_CALL disposing() override
PresenterScreen(const PresenterScreen &)=delete
css::uno::Reference< css::frame::XModel2 > mxModel
static bool isPresenterScreenFullScreen(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
static bool isPresenterScreenEnabled(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::rtl::Reference< PresenterController > mpPresenterController
void RequestShutdownPresenterScreen()
Do not call ShutdownPresenterScreen() directly.
void SetupView(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId, const OUString &rsPaneURL, const OUString &rsViewURL, const PresenterPaneContainer::ViewInitializationFunction &rViewInitialization)
void ProcessLayout(PresenterConfigurationAccess &rConfiguration, std::u16string_view rsLayoutName, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId)
Read one layout from the configuration and make resource activation requests to bring it on to the sc...
::std::map< OUString, ViewDescriptor > ViewDescriptorContainer
ViewDescriptorContainer maViewDescriptors
void InitializePresenterScreen()
Make the presenter screen visible.
css::uno::WeakReference< css::uno::XComponentContext > mxContextWeak
void ProcessComponent(const ::std::vector< css::uno::Any > &rValues, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::drawing::framework::XResourceId > &rxAnchorId)
Called by ProcessLayout for a single entry of a Layouts configuration list.
void ProcessViewDescription(const ::std::vector< css::uno::Any > &rValues)
Called by ProcessViewDescriptions for a single entry.
css::uno::Reference< css::drawing::framework::XResourceFactory > mxPaneFactory
void SetupPaneFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Create and initialize the factory for presenter view specific panes.
void ProcessViewDescriptions(PresenterConfigurationAccess &rConfiguration)
Read the view descriptions from the configuration.
static sal_Int32 GetPresenterScreenFromScreen(sal_Int32 nPresentationScreen)
css::uno::Reference< css::drawing::framework::XResourceId > GetMainPaneId(const css::uno::Reference< css::presentation::XPresentation2 > &rxPresentation, const css::uno::Reference< com::sun::star::uno::XComponentContext > &xContext) const
Create a resource id for the full screen background pane so that it is displayed on another screen th...
PresenterScreen(const css::uno::Reference< css::uno::XComponentContext > &rxContext, css::uno::Reference< css::frame::XModel2 > xModel)
sal_Int32 GetPresenterScreenNumber(const css::uno::Reference< css::presentation::XPresentation2 > &rxPresentation) const
Return the built-in screen number on the presentation will normally display the presenter console.
void SetupViewFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Create and initialize the factory for presenter view specific views.
virtual void SAL_CALL disposing(const css::lang::EventObject &rEvent) override
void SwitchMonitors()
Switch / converse monitors between presenter view and slide output.
css::uno::Reference< css::drawing::framework::XResourceFactory > mxViewFactory
PresenterScreen & operator=(const PresenterScreen &)=delete
::rtl::Reference< PresenterPaneContainer > mpPaneContainer
css::uno::WeakReference< css::drawing::framework::XConfigurationController > mxConfigurationControllerWeak
::cppu::WeakComponentImplHelper< css::task::XJob, css::lang::XServiceInfo > PresenterScreenJobInterfaceBase
::cppu::WeakComponentImplHelper< css::lang::XEventListener > PresenterScreenInterfaceBase
This is the bootstrap class of the presenter screen.
unsigned char sal_Bool