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 { namespace 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 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;
59 
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;
71 
72  virtual void SAL_CALL disposing() override;
73 
74  // XResourceFactory
75 
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;
80 
81  virtual void SAL_CALL
83  const css::uno::Reference<css::drawing::framework::XResource>&
84  rxPane) override;
85 
86 private:
87  css::uno::WeakReference<css::uno::XComponentContext> mxComponentContextWeak;
88  css::uno::WeakReference<css::drawing::framework::XConfigurationController>
91  typedef ::std::map<OUString, css::uno::Reference<css::drawing::framework::XResource> >
93  std::unique_ptr<ResourceContainer> mpResourceCache;
94 
96  const css::uno::Reference<css::uno::XComponentContext>& rxContext,
97  const ::rtl::Reference<PresenterController>& rpPresenterController);
98 
99  void Register (const css::uno::Reference<css::frame::XController>& rxController);
100 
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);
107 
109  void ThrowIfDisposed() const;
110 };
111 
112 } }
113 
114 #endif
115 
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::cppu::WeakComponentImplHelper< css::drawing::framework::XResourceFactory > PresenterPaneFactoryInterfaceBase
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
::std::map< OUString, css::uno::Reference< css::drawing::framework::XResource > > ResourceContainer
::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.
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