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_PRESENTERPANEBASE_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANEBASE_HXX
23 #include <cppuhelper/basemutex.hxx>
24 #include <cppuhelper/compbase.hxx>
25 #include <com/sun/star/awt/XWindowListener.hpp>
26 #include <com/sun/star/drawing/XPresenterHelper.hpp>
27 #include <com/sun/star/drawing/framework/XPane.hpp>
28 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <com/sun/star/rendering/XCanvas.hpp>
32 #include <rtl/ref.hxx>
35 namespace sdext::presenter
{
37 class PresenterController
;
39 typedef ::cppu::WeakComponentImplHelper
<
40 css::drawing::framework::XPane
,
41 css::lang::XInitialization
,
42 css::awt::XWindowListener
,
43 css::awt::XPaintListener
44 > PresenterPaneBaseInterfaceBase
;
46 /** Base class of the panes used by the presenter screen. Pane objects are
47 stored in the PresenterPaneContainer. Sizes and positions are
48 controlled by the PresenterWindowManager. Interactive positioning and
49 resizing is managed by the PresenterPaneBorderManager. Borders around
50 panes are painted by the PresenterPaneBorderPainter.
52 class PresenterPaneBase
53 : protected ::cppu::BaseMutex
,
54 public PresenterPaneBaseInterfaceBase
58 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
59 ::rtl::Reference
<PresenterController
> xPresenterController
);
60 virtual ~PresenterPaneBase() override
;
61 PresenterPaneBase(const PresenterPaneBase
&) = delete;
62 PresenterPaneBase
& operator=(const PresenterPaneBase
&) = delete;
64 virtual void SAL_CALL
disposing() override
;
66 const css::uno::Reference
<css::awt::XWindow
>& GetBorderWindow() const;
67 void SetTitle (const OUString
& rsTitle
);
68 const OUString
& GetTitle() const;
69 const css::uno::Reference
<css::drawing::framework::XPaneBorderPainter
>& GetPaneBorderPainter() const;
73 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
) override
;
77 virtual css::uno::Reference
<css::drawing::framework::XResourceId
> SAL_CALL
getResourceId() override
;
79 virtual sal_Bool SAL_CALL
isAnchorOnly() override
;
83 virtual void SAL_CALL
windowResized (const css::awt::WindowEvent
& rEvent
) override
;
85 virtual void SAL_CALL
windowMoved (const css::awt::WindowEvent
& rEvent
) override
;
87 virtual void SAL_CALL
windowShown (const css::lang::EventObject
& rEvent
) override
;
89 virtual void SAL_CALL
windowHidden (const css::lang::EventObject
& rEvent
) override
;
91 // lang::XEventListener
93 virtual void SAL_CALL
disposing (const css::lang::EventObject
& rEvent
) override
;
96 ::rtl::Reference
<PresenterController
> mpPresenterController
;
97 css::uno::Reference
<css::awt::XWindow
> mxParentWindow
;
98 css::uno::Reference
<css::awt::XWindow
> mxBorderWindow
;
99 css::uno::Reference
<css::rendering::XCanvas
> mxBorderCanvas
;
100 css::uno::Reference
<css::awt::XWindow
> mxContentWindow
;
101 css::uno::Reference
<css::rendering::XCanvas
> mxContentCanvas
;
102 css::uno::Reference
<css::drawing::framework::XResourceId
> mxPaneId
;
103 css::uno::Reference
<css::drawing::framework::XPaneBorderPainter
> mxBorderPainter
;
104 css::uno::Reference
<css::drawing::XPresenterHelper
> mxPresenterHelper
;
106 css::uno::Reference
<css::uno::XComponentContext
> mxComponentContext
;
108 virtual void CreateCanvases (
109 const css::uno::Reference
<css::rendering::XSpriteCanvas
>& rxParentCanvas
) = 0;
112 const bool bIsWindowVisibleOnCreation
);
113 void PaintBorder (const css::awt::Rectangle
& rUpdateRectangle
);
115 void LayoutContextWindow();
116 bool IsVisible() const;
118 /** @throws css::lang::DisposedException when the object has already been
121 void ThrowIfDisposed();
124 } // end of namespace ::sd::presenter
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */