vcl: allow for overriding the default PDF rendering resolution
[LibreOffice.git] / sdext / source / presenter / PresenterPaneFactory.hxx
blob9350bf0d47ac4afa02eee7f1c4d3be3b5367dbb0
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 sdext { namespace presenter {
36 class PresenterController;
38 typedef ::cppu::WeakComponentImplHelper <
39 css::drawing::framework::XResourceFactory
40 > PresenterPaneFactoryInterfaceBase;
42 /** The PresenterPaneFactory provides a fixed set of panes.
44 In order to make the presenter screen more easily extendable in the
45 future the set of supported panes could be made extendable on demand.
47 class PresenterPaneFactory
48 : public ::cppu::BaseMutex,
49 public PresenterPaneFactoryInterfaceBase
51 public:
52 static const OUString msCurrentSlidePreviewPaneURL;
53 static const OUString msNextSlidePreviewPaneURL;
54 static const OUString msNotesPaneURL;
55 static const OUString msToolBarPaneURL;
56 static const OUString msSlideSorterPaneURL;
57 static const OUString msHelpPaneURL;
58 static const OUString msOverlayPaneURL;
60 /** Create a new instance of this class and register it as resource
61 factory in the drawing framework of the given controller.
62 This registration keeps it alive. When the drawing framework is
63 shut down and releases its reference to the factory then the factory
64 is destroyed.
66 static css::uno::Reference<css::drawing::framework::XResourceFactory> Create (
67 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
68 const css::uno::Reference<css::frame::XController>& rxController,
69 const ::rtl::Reference<PresenterController>& rpPresenterController);
70 virtual ~PresenterPaneFactory() override;
72 virtual void SAL_CALL disposing() override;
74 // XResourceFactory
76 virtual css::uno::Reference<css::drawing::framework::XResource>
77 SAL_CALL createResource (
78 const css::uno::Reference<
79 css::drawing::framework::XResourceId>& rxPaneId) override;
81 virtual void SAL_CALL
82 releaseResource (
83 const css::uno::Reference<css::drawing::framework::XResource>&
84 rxPane) override;
86 private:
87 css::uno::WeakReference<css::uno::XComponentContext> mxComponentContextWeak;
88 css::uno::WeakReference<css::drawing::framework::XConfigurationController>
89 mxConfigurationControllerWeak;
90 ::rtl::Reference<PresenterController> mpPresenterController;
91 typedef ::std::map<OUString, css::uno::Reference<css::drawing::framework::XResource> >
92 ResourceContainer;
93 std::unique_ptr<ResourceContainer> mpResourceCache;
95 PresenterPaneFactory (
96 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
97 const ::rtl::Reference<PresenterController>& rpPresenterController);
99 void Register (const css::uno::Reference<css::frame::XController>& rxController);
101 css::uno::Reference<css::drawing::framework::XResource> CreatePane (
102 const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId);
103 css::uno::Reference<css::drawing::framework::XResource> CreatePane (
104 const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
105 const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane,
106 const bool bIsSpritePane);
108 /// @throws css::lang::DisposedException
109 void ThrowIfDisposed() const;
114 #endif
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */