LibreOffice Module sdext (master)  1
PresenterPaneFactory.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_PRESENTERPANEFACTORY_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANEFACTORY_HXX
22 
23 #include <cppuhelper/compbase.hxx>
24 #include <cppuhelper/basemutex.hxx>
25 #include <com/sun/star/frame/XController.hpp>
26 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
27 #include <com/sun/star/drawing/framework/XPane.hpp>
28 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <rtl/ref.hxx>
31 #include <map>
32 #include <memory>
33 
34 namespace sdext::presenter {
35 
37 
38 typedef ::cppu::WeakComponentImplHelper <
39  css::drawing::framework::XResourceFactory
41 
48  : public ::cppu::BaseMutex,
49  public PresenterPaneFactoryInterfaceBase
50 {
51 public:
52  static constexpr OUStringLiteral msCurrentSlidePreviewPaneURL
53  = u"private:resource/pane/Presenter/Pane1";
54  static constexpr OUStringLiteral msNextSlidePreviewPaneURL
55  = u"private:resource/pane/Presenter/Pane2";
56  static constexpr OUStringLiteral msNotesPaneURL = u"private:resource/pane/Presenter/Pane3";
57  static constexpr OUStringLiteral msToolBarPaneURL = u"private:resource/pane/Presenter/Pane4";
58  static constexpr OUStringLiteral msSlideSorterPaneURL
59  = u"private:resource/pane/Presenter/Pane5";
60 
67  static css::uno::Reference<css::drawing::framework::XResourceFactory> Create (
68  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
69  const css::uno::Reference<css::frame::XController>& rxController,
70  const ::rtl::Reference<PresenterController>& rpPresenterController);
71  virtual ~PresenterPaneFactory() override;
72 
73  virtual void SAL_CALL disposing() override;
74 
75  // XResourceFactory
76 
77  virtual css::uno::Reference<css::drawing::framework::XResource>
78  SAL_CALL createResource (
79  const css::uno::Reference<
80  css::drawing::framework::XResourceId>& rxPaneId) override;
81 
82  virtual void SAL_CALL
84  const css::uno::Reference<css::drawing::framework::XResource>&
85  rxPane) override;
86 
87 private:
88  css::uno::WeakReference<css::uno::XComponentContext> mxComponentContextWeak;
89  css::uno::WeakReference<css::drawing::framework::XConfigurationController>
92  typedef ::std::map<OUString, css::uno::Reference<css::drawing::framework::XResource> >
94  std::unique_ptr<ResourceContainer> mpResourceCache;
95 
97  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
98  const ::rtl::Reference<PresenterController>& rpPresenterController);
99 
100  void Register (const css::uno::Reference<css::frame::XController>& rxController);
101 
102  css::uno::Reference<css::drawing::framework::XResource> CreatePane (
103  const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId);
104  css::uno::Reference<css::drawing::framework::XResource> CreatePane (
105  const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
106  const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane,
107  const bool bIsSpritePane);
108 
110  void ThrowIfDisposed() const;
111 };
112 
113 }
114 
115 #endif
116 
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static constexpr OUStringLiteral msCurrentSlidePreviewPaneURL
::cppu::WeakComponentImplHelper< css::drawing::framework::XResourceFactory > PresenterPaneFactoryInterfaceBase
static constexpr OUStringLiteral msToolBarPaneURL
PresenterPaneFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const ::rtl::Reference< PresenterController > &rpPresenterController)
The controller of the presenter screen is responsible for telling the individual views which slides t...
virtual void SAL_CALL disposing() override
static constexpr OUStringLiteral msNotesPaneURL
::std::map< OUString, css::uno::Reference< css::drawing::framework::XResource > > ResourceContainer
static constexpr OUStringLiteral msNextSlidePreviewPaneURL
float u
::rtl::Reference< PresenterController > mpPresenterController
std::unique_ptr< ResourceContainer > mpResourceCache
css::uno::Reference< css::drawing::framework::XResource > CreatePane(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId)
css::uno::WeakReference< css::uno::XComponentContext > mxComponentContextWeak
The PresenterPaneFactory provides a fixed set of panes.
static constexpr OUStringLiteral msSlideSorterPaneURL
void Register(const css::uno::Reference< css::frame::XController > &rxController)
static css::uno::Reference< css::drawing::framework::XResourceFactory > Create(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XController > &rxController, const ::rtl::Reference< PresenterController > &rpPresenterController)
Create a new instance of this class and register it as resource factory in the drawing framework of t...
css::uno::WeakReference< css::drawing::framework::XConfigurationController > mxConfigurationControllerWeak
virtual void SAL_CALL releaseResource(const css::uno::Reference< css::drawing::framework::XResource > &rxPane) override
virtual css::uno::Reference< css::drawing::framework::XResource > SAL_CALL createResource(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId) override