Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sd / source / console / PresenterPaneFactory.hxx
blob5685dca06826409c8ffdb6bd0dca3fb84ec94cb7
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_PRESENTERPANEFACTORY_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANEFACTORY_HXX
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>
34 namespace sd { class DrawController; }
36 namespace sdext::presenter {
38 class PresenterController;
40 typedef ::cppu::WeakComponentImplHelper <
41 css::drawing::framework::XResourceFactory
42 > PresenterPaneFactoryInterfaceBase;
44 /** The PresenterPaneFactory provides a fixed set of panes.
46 In order to make the presenter screen more easily extendable in the
47 future the set of supported panes could be made extendable on demand.
49 class PresenterPaneFactory
50 : public ::cppu::BaseMutex,
51 public PresenterPaneFactoryInterfaceBase
53 public:
54 static constexpr OUStringLiteral msCurrentSlidePreviewPaneURL
55 = u"private:resource/pane/Presenter/Pane1";
56 static constexpr OUStringLiteral msNextSlidePreviewPaneURL
57 = u"private:resource/pane/Presenter/Pane2";
58 static constexpr OUStringLiteral msNotesPaneURL = u"private:resource/pane/Presenter/Pane3";
59 static constexpr OUStringLiteral msToolBarPaneURL = u"private:resource/pane/Presenter/Pane4";
60 static constexpr OUStringLiteral msSlideSorterPaneURL
61 = u"private:resource/pane/Presenter/Pane5";
63 /** Create a new instance of this class and register it as resource
64 factory in the drawing framework of the given controller.
65 This registration keeps it alive. When the drawing framework is
66 shut down and releases its reference to the factory then the factory
67 is destroyed.
69 static css::uno::Reference<css::drawing::framework::XResourceFactory> Create (
70 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
71 const rtl::Reference<::sd::DrawController>& rxController,
72 const ::rtl::Reference<PresenterController>& rpPresenterController);
73 virtual ~PresenterPaneFactory() override;
75 virtual void SAL_CALL disposing() override;
77 // XResourceFactory
79 virtual css::uno::Reference<css::drawing::framework::XResource>
80 SAL_CALL createResource (
81 const css::uno::Reference<
82 css::drawing::framework::XResourceId>& rxPaneId) override;
84 virtual void SAL_CALL
85 releaseResource (
86 const css::uno::Reference<css::drawing::framework::XResource>&
87 rxPane) override;
89 private:
90 css::uno::WeakReference<css::uno::XComponentContext> mxComponentContextWeak;
91 css::uno::WeakReference<css::drawing::framework::XConfigurationController>
92 mxConfigurationControllerWeak;
93 ::rtl::Reference<PresenterController> mpPresenterController;
94 typedef ::std::map<OUString, css::uno::Reference<css::drawing::framework::XResource> >
95 ResourceContainer;
96 std::unique_ptr<ResourceContainer> mpResourceCache;
98 PresenterPaneFactory (
99 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
100 ::rtl::Reference<PresenterController> xPresenterController);
102 void Register (const rtl::Reference<::sd::DrawController>& rxController);
104 css::uno::Reference<css::drawing::framework::XResource> CreatePane (
105 const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId);
106 css::uno::Reference<css::drawing::framework::XResource> CreatePane (
107 const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
108 const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane,
109 const bool bIsSpritePane);
111 /// @throws css::lang::DisposedException
112 void ThrowIfDisposed() const;
117 #endif
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */