LibreOffice Module sdext (master)  1
PresenterPaneContainer.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_PRESENTERPANECONTAINER_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANECONTAINER_HXX
22 
23 #include "PresenterPaneBase.hxx"
24 #include <com/sun/star/awt/XWindow.hpp>
25 #include <com/sun/star/drawing/XPresenterHelper.hpp>
26 #include <com/sun/star/drawing/framework/XResourceId.hpp>
27 #include <com/sun/star/drawing/framework/XView.hpp>
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <cppuhelper/basemutex.hxx>
30 #include <cppuhelper/compbase.hxx>
31 #include <rtl/ref.hxx>
32 
33 #include <functional>
34 #include <memory>
35 #include <vector>
36 
37 namespace sdext { namespace presenter {
38 
39 class PresenterPaneBase;
41 
42 typedef ::cppu::WeakComponentImplHelper <
43  css::lang::XEventListener
45 
51  : private ::cppu::BaseMutex,
52  public PresenterPaneContainerInterfaceBase
53 {
54 public:
55  explicit PresenterPaneContainer (
56  const css::uno::Reference<css::uno::XComponentContext>& rxContext);
57  virtual ~PresenterPaneContainer() override;
60 
61  virtual void SAL_CALL disposing() override;
62 
63  typedef ::std::function<void (const css::uno::Reference<css::drawing::framework::XView>&)>
65 
75  {
76  public:
77  typedef ::std::function<std::shared_ptr<PresenterSprite> ()> SpriteProvider;
78  css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId;
79  OUString msViewURL;
81  css::uno::Reference<css::drawing::framework::XView> mxView;
82  css::uno::Reference<css::awt::XWindow> mxContentWindow;
83  css::uno::Reference<css::awt::XWindow> mxBorderWindow;
84  OUString msTitleTemplate;
86  OUString msTitle;
88  bool mbIsActive;
89  bool mbIsOpaque;
90  bool mbIsSprite;
91 
92  void SetActivationState (const bool bIsActive);
93  };
94  typedef std::shared_ptr<PaneDescriptor> SharedPaneDescriptor;
95  typedef ::std::vector<SharedPaneDescriptor> PaneList;
96  PaneList maPanes;
97 
98  void PreparePane (
99  const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
100  const OUString& rsViewURL,
101  const OUString& rsTitle,
102  const OUString& rsAccessibleTitle,
103  const bool bIsOpaque,
104  const ViewInitializationFunction& rViewIntialization);
105 
106  SharedPaneDescriptor StorePane (
107  const rtl::Reference<PresenterPaneBase>& rxPane);
108 
109  SharedPaneDescriptor StoreBorderWindow(
110  const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
111  const css::uno::Reference<css::awt::XWindow>& rxBorderWindow);
112 
113  SharedPaneDescriptor StoreView (
114  const css::uno::Reference<css::drawing::framework::XView>& rxView);
115 
116  SharedPaneDescriptor RemovePane (
117  const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId);
118 
119  SharedPaneDescriptor RemoveView (
120  const css::uno::Reference<css::drawing::framework::XView>& rxView);
121 
125  SharedPaneDescriptor FindBorderWindow (
126  const css::uno::Reference<css::awt::XWindow>& rxBorderWindow);
127 
131  SharedPaneDescriptor FindContentWindow (
132  const css::uno::Reference<css::awt::XWindow>& rxBorderWindow);
133 
136  SharedPaneDescriptor FindPaneURL (const OUString& rsPaneURL);
137 
140  SharedPaneDescriptor FindPaneId (const css::uno::Reference<
141  css::drawing::framework::XResourceId>& rxPaneId);
142 
143  SharedPaneDescriptor FindViewURL (const OUString& rsViewURL);
144 
145  OUString GetPaneURLForViewURL (const OUString& rsViewURL);
146 
147  void ToTop (const SharedPaneDescriptor& rpDescriptor);
148 
149  // XEventListener
150 
151  virtual void SAL_CALL disposing (
152  const css::lang::EventObject& rEvent) override;
153 
154 private:
155  css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
156 };
157 
158 } } // end of namespace ::sdext::presenter
159 
160 #endif
161 
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::drawing::framework::XView > mxView
virtual void SAL_CALL disposing() override
SharedPaneDescriptor FindPaneId(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId)
Find the pane whose resource id is identical to the given one.
css::uno::Reference< css::awt::XWindow > mxContentWindow
SharedPaneDescriptor StoreView(const css::uno::Reference< css::drawing::framework::XView > &rxView)
css::uno::Reference< css::drawing::XPresenterHelper > mxPresenterHelper
void ToTop(const SharedPaneDescriptor &rpDescriptor)
SharedPaneDescriptor RemoveView(const css::uno::Reference< css::drawing::framework::XView > &rxView)
SharedPaneDescriptor FindContentWindow(const css::uno::Reference< css::awt::XWindow > &rxBorderWindow)
Find the pane whose border window is identical to the given content window.
SharedPaneDescriptor RemovePane(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId)
::std::function< std::shared_ptr< PresenterSprite >)> SpriteProvider
css::uno::Reference< css::drawing::framework::XResourceId > mxPaneId
Each pane descriptor holds references to one pane and the view displayed in this pane as well as the ...
::std::function< void(const css::uno::Reference< css::drawing::framework::XView > &)> ViewInitializationFunction
SharedPaneDescriptor FindBorderWindow(const css::uno::Reference< css::awt::XWindow > &rxBorderWindow)
Find the pane whose border window is identical to the given border window.
PresenterPaneContainer & operator=(const PresenterPaneContainer &)=delete
SharedPaneDescriptor FindViewURL(const OUString &rsViewURL)
SharedPaneDescriptor FindPaneURL(const OUString &rsPaneURL)
Find the pane whose pane URL is identical to the given URL string.
This class could also be called PresenterPaneAndViewContainer because it stores not only references t...
SharedPaneDescriptor StorePane(const rtl::Reference< PresenterPaneBase > &rxPane)
SharedPaneDescriptor StoreBorderWindow(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId, const css::uno::Reference< css::awt::XWindow > &rxBorderWindow)
OUString GetPaneURLForViewURL(const OUString &rsViewURL)
std::shared_ptr< PaneDescriptor > SharedPaneDescriptor
::cppu::WeakComponentImplHelper< css::lang::XEventListener > PresenterPaneContainerInterfaceBase
A wrapper around a css::rendering::XCustomSprite that allows not only setting values like size...
PresenterPaneContainer(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::std::vector< SharedPaneDescriptor > PaneList
void PreparePane(const css::uno::Reference< css::drawing::framework::XResourceId > &rxPaneId, const OUString &rsViewURL, const OUString &rsTitle, const OUString &rsAccessibleTitle, const bool bIsOpaque, const ViewInitializationFunction &rViewIntialization)