fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sdext / source / presenter / PresenterPaneFactory.hxx
blob0d7106ac4cce3afd624ed4bb4c7f9a04269d7719
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/compbase1.hxx>
24 #include <cppuhelper/basemutex.hxx>
25 #include <com/sun/star/frame/XController.hpp>
26 #include <com/sun/star/lang/XInitialization.hpp>
27 #include <com/sun/star/drawing/XPresenterHelper.hpp>
28 #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
29 #include <com/sun/star/drawing/framework/XPane.hpp>
30 #include <com/sun/star/drawing/framework/XResourceFactory.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <rtl/ref.hxx>
33 #include <boost/scoped_ptr.hpp>
34 #include <map>
36 namespace sdext { namespace presenter {
38 class PresenterController;
40 namespace {
41 typedef ::cppu::WeakComponentImplHelper1 <
42 css::drawing::framework::XResourceFactory
43 > PresenterPaneFactoryInterfaceBase;
46 /** The PresenerPaneFactory provides a fixed set of panes.
48 In order to make the presener screen more easily extendable in the
49 future the set of supported panes could be made extendable on demand.
51 class PresenterPaneFactory
52 : public ::cppu::BaseMutex,
53 public PresenterPaneFactoryInterfaceBase
55 public:
56 static const OUString msCurrentSlidePreviewPaneURL;
57 static const OUString msNextSlidePreviewPaneURL;
58 static const OUString msNotesPaneURL;
59 static const OUString msToolBarPaneURL;
60 static const OUString msSlideSorterPaneURL;
61 static const OUString msHelpPaneURL;
62 static const OUString msOverlayPaneURL;
64 /** Create a new instance of this class and register it as resource
65 factory in the drawing framework of the given controller.
66 This registration keeps it alive. When the drawing framework is
67 shut down and releases its reference to the factory then the factory
68 is destroyed.
70 static css::uno::Reference<css::drawing::framework::XResourceFactory> Create (
71 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
72 const css::uno::Reference<css::frame::XController>& rxController,
73 const ::rtl::Reference<PresenterController>& rpPresenterController);
74 virtual ~PresenterPaneFactory();
76 static OUString getImplementationName_static();
77 static css::uno::Sequence< OUString > getSupportedServiceNames_static();
78 static css::uno::Reference<css::uno::XInterface> Create(
79 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
81 virtual void SAL_CALL disposing()
82 throw (css::uno::RuntimeException) SAL_OVERRIDE;
84 // XResourceFactory
86 virtual css::uno::Reference<css::drawing::framework::XResource>
87 SAL_CALL createResource (
88 const css::uno::Reference<
89 css::drawing::framework::XResourceId>& rxPaneId)
90 throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, std::exception) SAL_OVERRIDE;
92 virtual void SAL_CALL
93 releaseResource (
94 const css::uno::Reference<css::drawing::framework::XResource>&
95 rxPane)
96 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 private:
99 css::uno::WeakReference<css::uno::XComponentContext> mxComponentContextWeak;
100 css::uno::WeakReference<css::drawing::framework::XConfigurationController>
101 mxConfigurationControllerWeak;
102 ::rtl::Reference<PresenterController> mpPresenterController;
103 typedef ::std::map<OUString, css::uno::Reference<css::drawing::framework::XResource> >
104 ResourceContainer;
105 ::boost::scoped_ptr<ResourceContainer> mpResourceCache;
107 PresenterPaneFactory (
108 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
109 const ::rtl::Reference<PresenterController>& rpPresenterController);
111 void Register (const css::uno::Reference<css::frame::XController>& rxController);
113 css::uno::Reference<css::drawing::framework::XResource> CreatePane (
114 const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
115 const OUString& rsTitle);
116 css::uno::Reference<css::drawing::framework::XResource> CreatePane (
117 const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
118 const OUString& rsTitle,
119 const css::uno::Reference<css::drawing::framework::XPane>& rxParentPane,
120 const bool bIsSpritePane);
122 void ThrowIfDisposed() const throw (css::lang::DisposedException);
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */