fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sdext / source / presenter / PresenterPaneBase.hxx
blob700c440c78bdd9b86794e8248dbe5b17d1c9cda1
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_PRESENTERPANEBASE_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANEBASE_HXX
23 #include "PresenterTheme.hxx"
24 #include <cppuhelper/basemutex.hxx>
25 #include <cppuhelper/compbase4.hxx>
26 #include <com/sun/star/awt/Point.hpp>
27 #include <com/sun/star/awt/XMouseListener.hpp>
28 #include <com/sun/star/awt/XMouseMotionListener.hpp>
29 #include <com/sun/star/awt/XWindowListener.hpp>
30 #include <com/sun/star/container/XChild.hpp>
31 #include <com/sun/star/drawing/XPresenterHelper.hpp>
32 #include <com/sun/star/drawing/framework/XPane.hpp>
33 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
34 #include <com/sun/star/lang/XInitialization.hpp>
35 #include <com/sun/star/uno/XComponentContext.hpp>
36 #include <com/sun/star/util/Color.hpp>
37 #include <com/sun/star/rendering/XCanvas.hpp>
38 #include <rtl/ref.hxx>
39 #include <boost/noncopyable.hpp>
42 namespace sdext { namespace presenter {
44 class PresenterController;
46 namespace {
47 typedef ::cppu::WeakComponentImplHelper4 <
48 css::drawing::framework::XPane,
49 css::lang::XInitialization,
50 css::awt::XWindowListener,
51 css::awt::XPaintListener
52 > PresenterPaneBaseInterfaceBase;
55 /** Base class of the panes used by the presenter screen. Pane objects are
56 stored in the PresenterPaneContainer. Sizes and positions are
57 controlled by the PresenterWindowManager. Interactive positioning and
58 resizing is managed by the PresenterPaneBorderManager. Borders around
59 panes are painted by the PresenterPaneBorderPainter.
61 class PresenterPaneBase
62 : protected ::cppu::BaseMutex,
63 private ::boost::noncopyable,
64 public PresenterPaneBaseInterfaceBase
66 public:
67 PresenterPaneBase (
68 const css::uno::Reference<css::uno::XComponentContext>& rxContext,
69 const ::rtl::Reference<PresenterController>& rpPresenterController);
70 virtual ~PresenterPaneBase();
72 virtual void SAL_CALL disposing() SAL_OVERRIDE;
74 css::uno::Reference<css::awt::XWindow> GetBorderWindow() const;
75 void SetBackground (const SharedBitmapDescriptor& rpBackground);
76 void SetTitle (const OUString& rsTitle);
77 OUString GetTitle() const;
78 css::uno::Reference<css::drawing::framework::XPaneBorderPainter> GetPaneBorderPainter() const;
79 void SetCalloutAnchor (const css::awt::Point& rAnchorPosition);
80 css::awt::Point GetCalloutAnchor() const;
82 // XInitialization
84 virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments)
85 throw (css::uno::Exception, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 // XResourceId
89 virtual css::uno::Reference<css::drawing::framework::XResourceId> SAL_CALL getResourceId()
90 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 virtual sal_Bool SAL_CALL isAnchorOnly()
93 throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 // XWindowListener
97 virtual void SAL_CALL windowResized (const css::awt::WindowEvent& rEvent)
98 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 virtual void SAL_CALL windowMoved (const css::awt::WindowEvent& rEvent)
101 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 virtual void SAL_CALL windowShown (const css::lang::EventObject& rEvent)
104 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 virtual void SAL_CALL windowHidden (const css::lang::EventObject& rEvent)
107 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 // lang::XEventListener
111 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
112 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 protected:
115 ::rtl::Reference<PresenterController> mpPresenterController;
116 css::uno::Reference<css::awt::XWindow> mxParentWindow;
117 css::uno::Reference<css::awt::XWindow> mxBorderWindow;
118 css::uno::Reference<css::rendering::XCanvas> mxBorderCanvas;
119 css::uno::Reference<css::awt::XWindow> mxContentWindow;
120 css::uno::Reference<css::rendering::XCanvas> mxContentCanvas;
121 css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId;
122 css::uno::Reference<css::drawing::framework::XPaneBorderPainter> mxBorderPainter;
123 css::uno::Reference<css::drawing::XPresenterHelper> mxPresenterHelper;
124 OUString msTitle;
125 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
126 SharedBitmapDescriptor mpViewBackground;
127 bool mbHasCallout;
128 css::awt::Point maCalloutAnchor;
130 virtual void CreateCanvases (
131 const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
132 const css::uno::Reference<css::rendering::XSpriteCanvas>& rxParentCanvas) = 0;
134 void CreateWindows (
135 const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
136 const bool bIsWindowVisibleOnCreation);
137 static void PaintBorderBackground (
138 const css::awt::Rectangle& rCenterBox,
139 const css::awt::Rectangle& rUpdateBox);
140 void PaintBorder (const css::awt::Rectangle& rUpdateRectangle);
141 void ToTop();
142 void LayoutContextWindow();
143 bool IsVisible() const;
145 /** This method throws a DisposedException when the object has already been
146 disposed.
148 void ThrowIfDisposed()
149 throw (css::lang::DisposedException);
152 } } // end of namespace ::sd::presenter
154 #endif
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */