1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_PRESENTERPANECONTAINER_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANECONTAINER_HXX
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>
37 namespace sdext::presenter
{
39 class PresenterPaneBase
;
40 class PresenterSprite
;
42 typedef ::cppu::WeakComponentImplHelper
<
43 css::lang::XEventListener
44 > PresenterPaneContainerInterfaceBase
;
46 /** This class could also be called PresenterPaneAndViewContainer because it
47 stores not only references to all panes that belong to the presenter
48 screen but stores the views displayed in these panes as well.
50 class PresenterPaneContainer
51 : private ::cppu::BaseMutex
,
52 public PresenterPaneContainerInterfaceBase
55 explicit PresenterPaneContainer (
56 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
);
57 virtual ~PresenterPaneContainer() override
;
58 PresenterPaneContainer(const PresenterPaneContainer
&) = delete;
59 PresenterPaneContainer
& operator=(const PresenterPaneContainer
&) = delete;
61 virtual void SAL_CALL
disposing() override
;
63 typedef ::std::function
<void (const css::uno::Reference
<css::drawing::framework::XView
>&)>
64 ViewInitializationFunction
;
66 /** Each pane descriptor holds references to one pane and the view
67 displayed in this pane as well as the other information that is used
68 to manage the pane window like an XWindow reference, the title, and
71 A initialization function for the view is stored as well. This
72 function is executed as soon as a view is created.
77 css::uno::Reference
<css::drawing::framework::XResourceId
> mxPaneId
;
79 ::rtl::Reference
<PresenterPaneBase
> mxPane
;
80 css::uno::Reference
<css::drawing::framework::XView
> mxView
;
81 css::uno::Reference
<css::awt::XWindow
> mxContentWindow
;
82 css::uno::Reference
<css::awt::XWindow
> mxBorderWindow
;
83 OUString msTitleTemplate
;
84 OUString msAccessibleTitleTemplate
;
86 ViewInitializationFunction maViewInitialization
;
91 void SetActivationState (const bool bIsActive
);
93 typedef std::shared_ptr
<PaneDescriptor
> SharedPaneDescriptor
;
94 typedef ::std::vector
<SharedPaneDescriptor
> PaneList
;
98 const css::uno::Reference
<css::drawing::framework::XResourceId
>& rxPaneId
,
99 const OUString
& rsViewURL
,
100 const OUString
& rsTitle
,
101 const OUString
& rsAccessibleTitle
,
102 const bool bIsOpaque
,
103 const ViewInitializationFunction
& rViewInitialization
);
105 SharedPaneDescriptor
StorePane (
106 const rtl::Reference
<PresenterPaneBase
>& rxPane
);
108 SharedPaneDescriptor
StoreBorderWindow(
109 const css::uno::Reference
<css::drawing::framework::XResourceId
>& rxPaneId
,
110 const css::uno::Reference
<css::awt::XWindow
>& rxBorderWindow
);
112 SharedPaneDescriptor
StoreView (
113 const css::uno::Reference
<css::drawing::framework::XView
>& rxView
);
115 SharedPaneDescriptor
RemovePane (
116 const css::uno::Reference
<css::drawing::framework::XResourceId
>& rxPaneId
);
118 SharedPaneDescriptor
RemoveView (
119 const css::uno::Reference
<css::drawing::framework::XView
>& rxView
);
121 /** Find the pane whose border window is identical to the given border
124 SharedPaneDescriptor
FindBorderWindow (
125 const css::uno::Reference
<css::awt::XWindow
>& rxBorderWindow
);
127 /** Find the pane whose border window is identical to the given content
130 SharedPaneDescriptor
FindContentWindow (
131 const css::uno::Reference
<css::awt::XWindow
>& rxBorderWindow
);
133 /** Find the pane whose pane URL is identical to the given URL string.
135 SharedPaneDescriptor
FindPaneURL (const OUString
& rsPaneURL
);
137 /** Find the pane whose resource id is identical to the given one.
139 SharedPaneDescriptor
FindPaneId (const css::uno::Reference
<
140 css::drawing::framework::XResourceId
>& rxPaneId
);
142 SharedPaneDescriptor
FindViewURL (const OUString
& rsViewURL
);
144 OUString
GetPaneURLForViewURL (const OUString
& rsViewURL
);
146 void ToTop (const SharedPaneDescriptor
& rpDescriptor
);
150 virtual void SAL_CALL
disposing (
151 const css::lang::EventObject
& rEvent
) override
;
154 css::uno::Reference
<css::drawing::XPresenterHelper
> mxPresenterHelper
;
157 } // end of namespace ::sdext::presenter
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */