LibreOffice Module sd (master) 1
PresenterPaneBorderPainter.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_PRESENTERPANEBORDERPAINTER_HXX
21#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERPANEBORDERPAINTER_HXX
22
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/rendering/XCanvas.hpp>
29#include <memory>
30
31namespace sdext::presenter {
32
33class PresenterPane;
34class PresenterTheme;
35
36typedef ::cppu::WeakComponentImplHelper<
37 css::drawing::framework::XPaneBorderPainter
39
44 : protected ::cppu::BaseMutex,
46{
47public:
49 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
50 virtual ~PresenterPaneBorderPainter() override;
53
61 css::awt::Rectangle AddBorder (
62 const OUString& rsPaneURL,
63 const css::awt::Rectangle& rInnerBox,
64 const css::drawing::framework::BorderType eBorderType) const;
65
76 css::awt::Rectangle RemoveBorder (
77 const OUString& rsPaneURL,
78 const css::awt::Rectangle& rOuterBox,
79 const css::drawing::framework::BorderType eBorderType) const;
80
81 void SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme);
82
83 class Renderer;
84
85 // XPaneBorderPainter
86
87 virtual css::awt::Rectangle SAL_CALL addBorder (
88 const OUString& rsPaneBorderStyleName,
89 const css::awt::Rectangle& rRectangle,
90 css::drawing::framework::BorderType eBorderType) override;
91
92 virtual css::awt::Rectangle SAL_CALL removeBorder (
93 const OUString& rsPaneBorderStyleName,
94 const css::awt::Rectangle& rRectangle,
95 css::drawing::framework::BorderType eBorderType) override;
96
97 virtual void SAL_CALL paintBorder (
98 const OUString& rsPaneBorderStyleName,
99 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
100 const css::awt::Rectangle& rOuterBorderRectangle,
101 const css::awt::Rectangle& rRepaintArea,
102 const OUString& rsTitle) override;
103
104 virtual void SAL_CALL paintBorderWithCallout (
105 const OUString& rsPaneBorderStyleName,
106 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
107 const css::awt::Rectangle& rOuterBorderRectangle,
108 const css::awt::Rectangle& rRepaintArea,
109 const OUString& rsTitle,
110 const css::awt::Point& rCalloutAnchor) override;
111
112 virtual css::awt::Point SAL_CALL getCalloutOffset (
113 const OUString& rsPaneBorderStyleName) override;
114
115private:
116 css::uno::Reference<css::uno::XComponentContext> mxContext;
117 std::shared_ptr<PresenterTheme> mpTheme;
118 std::unique_ptr<Renderer> mpRenderer;
119
127 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas);
128 void ProvideTheme();
129
131 void ThrowIfDisposed() const;
132};
133
134} // end of namespace ::sd::presenter
135
136#endif
137
138/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class is responsible for painting window borders of PresenterPane objects.
PresenterPaneBorderPainter(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::awt::Point SAL_CALL getCalloutOffset(const OUString &rsPaneBorderStyleName) override
css::awt::Rectangle AddBorder(const OUString &rsPaneURL, const css::awt::Rectangle &rInnerBox, const css::drawing::framework::BorderType eBorderType) const
Transform the bounding box of the window content to the outer bounding box of the border that is pain...
void SetTheme(const std::shared_ptr< PresenterTheme > &rpTheme)
PresenterPaneBorderPainter & operator=(const PresenterPaneBorderPainter &)=delete
css::awt::Rectangle RemoveBorder(const OUString &rsPaneURL, const css::awt::Rectangle &rOuterBox, const css::drawing::framework::BorderType eBorderType) const
Transform the outer bounding box of a window to the bounding box of the inner content area.
PresenterPaneBorderPainter(const PresenterPaneBorderPainter &)=delete
virtual void SAL_CALL paintBorder(const OUString &rsPaneBorderStyleName, const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const css::awt::Rectangle &rOuterBorderRectangle, const css::awt::Rectangle &rRepaintArea, const OUString &rsTitle) override
virtual css::awt::Rectangle SAL_CALL removeBorder(const OUString &rsPaneBorderStyleName, const css::awt::Rectangle &rRectangle, css::drawing::framework::BorderType eBorderType) override
virtual css::awt::Rectangle SAL_CALL addBorder(const OUString &rsPaneBorderStyleName, const css::awt::Rectangle &rRectangle, css::drawing::framework::BorderType eBorderType) override
bool ProvideTheme(const css::uno::Reference< css::rendering::XCanvas > &rxCanvas)
When the theme for the border has not yet been loaded then try again when this method is called.
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual void SAL_CALL paintBorderWithCallout(const OUString &rsPaneBorderStyleName, const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const css::awt::Rectangle &rOuterBorderRectangle, const css::awt::Rectangle &rRepaintArea, const OUString &rsTitle, const css::awt::Point &rCalloutAnchor) override
::cppu::WeakComponentImplHelper< css::drawing::framework::XPaneBorderPainter > PresenterPaneBorderPainterInterfaceBase