fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sdext / source / presenter / PresenterPaneBorderPainter.hxx
blob79d4a3dd3e4f18a942f054217719f79c9fd94b8e
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_PRESENTERPANEBORDERPAINTER_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANEBORDERPAINTER_HXX
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <com/sun/star/awt/Rectangle.hpp>
25 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
26 #include <com/sun/star/graphic/XGraphicProvider.hpp>
27 #include <com/sun/star/rendering/XCanvas.hpp>
28 #include <com/sun/star/util/XMacroExpander.hpp>
29 #include <com/sun/star/awt/XGraphics.hpp>
30 #include <cppuhelper/basemutex.hxx>
31 #include <cppuhelper/compbase1.hxx>
32 #include <boost/noncopyable.hpp>
33 #include <boost/scoped_ptr.hpp>
34 #include <boost/shared_ptr.hpp>
36 namespace sdext { namespace presenter {
38 class PresenterPane;
39 class PresenterTheme;
41 namespace {
42 typedef ::cppu::WeakComponentImplHelper1<
43 css::drawing::framework::XPaneBorderPainter
44 > PresenterPaneBorderPainterInterfaceBase;
47 /** This class is responsible for painting window borders of PresenterPane
48 objects.
50 class PresenterPaneBorderPainter
51 : private ::boost::noncopyable,
52 protected ::cppu::BaseMutex,
53 public PresenterPaneBorderPainterInterfaceBase
55 public:
56 PresenterPaneBorderPainter (
57 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
58 virtual ~PresenterPaneBorderPainter();
60 /** Transform the bounding box of the window content to the outer
61 bounding box of the border that is painted around it.
62 @param rsPaneURL
63 Specifies the pane style that is used to determine the border sizes.
64 @param rInnerBox
65 The rectangle of the inner window content.
67 css::awt::Rectangle AddBorder (
68 const OUString& rsPaneURL,
69 const css::awt::Rectangle& rInnerBox,
70 const css::drawing::framework::BorderType eBorderType) const;
72 /** Transorm the outer bounding box of a window to the bounding box of
73 the inner content area.
74 @param rsPaneURL
75 Specifies the pane style that is used to determine the border sizes.
76 @param rOuterBox
77 The bounding box of the rectangle around the window.
78 @param bIsTitleVisible
79 This flag controls whether the upper part of the frame is
80 supposed to contain the window title.
82 css::awt::Rectangle RemoveBorder (
83 const OUString& rsPaneURL,
84 const css::awt::Rectangle& rOuterBox,
85 const css::drawing::framework::BorderType eBorderType) const;
87 void SetTheme (const ::boost::shared_ptr<PresenterTheme>& rpTheme);
89 class Renderer;
91 // XPaneBorderPainter
93 virtual css::awt::Rectangle SAL_CALL addBorder (
94 const OUString& rsPaneBorderStyleName,
95 const css::awt::Rectangle& rRectangle,
96 css::drawing::framework::BorderType eBorderType)
97 throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 virtual css::awt::Rectangle SAL_CALL removeBorder (
100 const OUString& rsPaneBorderStyleName,
101 const css::awt::Rectangle& rRectangle,
102 css::drawing::framework::BorderType eBorderType)
103 throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 virtual void SAL_CALL paintBorder (
106 const OUString& rsPaneBorderStyleName,
107 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
108 const css::awt::Rectangle& rOuterBorderRectangle,
109 const css::awt::Rectangle& rRepaintArea,
110 const OUString& rsTitle)
111 throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 virtual void SAL_CALL paintBorderWithCallout (
114 const OUString& rsPaneBorderStyleName,
115 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
116 const css::awt::Rectangle& rOuterBorderRectangle,
117 const css::awt::Rectangle& rRepaintArea,
118 const OUString& rsTitle,
119 const css::awt::Point& rCalloutAnchor)
120 throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 virtual css::awt::Point SAL_CALL getCalloutOffset (
123 const OUString& rsPaneBorderStyleName)
124 throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
126 private:
127 css::uno::Reference<css::uno::XComponentContext> mxContext;
128 ::boost::shared_ptr<PresenterTheme> mpTheme;
129 ::boost::scoped_ptr<Renderer> mpRenderer;
131 /** When the theme for the border has not yet been loaded then try again
132 when this method is called.
133 @return
134 Returns <TRUE/> only one time when the theme is loaded and/or the
135 renderer is initialized.
137 bool ProvideTheme (
138 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas);
139 bool ProvideTheme();
141 void ThrowIfDisposed() const
142 throw (css::lang::DisposedException);
145 } } // end of namespace ::sd::presenter
147 #endif
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */