Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sdext / source / presenter / PresenterCanvasHelper.hxx
blobd07978547ceeee39c07482e01f8b3c680f0f90f0
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_PRESENTERCANVASHELPER_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERCANVASHELPER_HXX
23 #include "PresenterTheme.hxx"
24 #include <com/sun/star/awt/Point.hpp>
25 #include <com/sun/star/awt/Rectangle.hpp>
26 #include <com/sun/star/rendering/TextDirection.hpp>
27 #include <com/sun/star/rendering/XCanvas.hpp>
28 #include <com/sun/star/rendering/XCanvasFont.hpp>
29 #include <com/sun/star/rendering/XPolyPolygon2D.hpp>
30 #include <rtl/ref.hxx>
32 namespace sdext { namespace presenter {
34 /** Collection of functions to ease the life of a canvas user.
36 class PresenterCanvasHelper
38 public:
39 PresenterCanvasHelper();
40 ~PresenterCanvasHelper();
41 PresenterCanvasHelper(const PresenterCanvasHelper&) = delete;
42 PresenterCanvasHelper& operator=(const PresenterCanvasHelper&) = delete;
44 void Paint (
45 const SharedBitmapDescriptor& rpBitmap,
46 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
47 const css::awt::Rectangle& rRepaintBox,
48 const css::awt::Rectangle& rBackgroundBoundingBox,
49 const css::awt::Rectangle& rContentBoundingBox) const;
51 static void PaintRectangle (
52 const SharedBitmapDescriptor& rpBitmap,
53 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
54 const css::awt::Rectangle& rRepaintBox,
55 const css::awt::Rectangle& rBackgroundBoundingBox,
56 const css::awt::Rectangle& rContentBoundingBox,
57 const css::rendering::ViewState& rDefaultViewState,
58 const css::rendering::RenderState& rDefaultRenderState);
60 static void SetDeviceColor(
61 css::rendering::RenderState& rRenderState,
62 const css::util::Color aColor);
64 static css::geometry::RealRectangle2D GetTextBoundingBox (
65 const css::uno::Reference<css::rendering::XCanvasFont>& rxFont,
66 const OUString& rsText,
67 const sal_Int8 = css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT);
69 static css::geometry::RealSize2D GetTextSize (
70 const css::uno::Reference<css::rendering::XCanvasFont>& rxFont,
71 const OUString& rsText );
73 private:
74 const css::rendering::ViewState maDefaultViewState;
75 const css::rendering::RenderState maDefaultRenderState;
77 static void PaintTiledBitmap (
78 const css::uno::Reference<css::rendering::XBitmap>& rxTexture,
79 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
80 const css::awt::Rectangle& rRepaintBox,
81 const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon,
82 const css::awt::Rectangle& rHole,
83 const css::rendering::ViewState& rDefaultViewState,
84 const css::rendering::RenderState& rDefaultRenderState);
86 static void PaintBitmap (
87 const css::uno::Reference<css::rendering::XBitmap>& rxBitmap,
88 const css::awt::Point& rLocation,
89 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
90 const css::awt::Rectangle& rRepaintBox,
91 const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon,
92 const css::rendering::ViewState& rDefaultViewState,
93 const css::rendering::RenderState& rDefaultRenderState);
95 static void PaintColor (
96 const css::util::Color nColor,
97 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
98 const css::awt::Rectangle& rRepaintBox,
99 const css::uno::Reference<css::rendering::XPolyPolygon2D>& rxPolygon,
100 const css::rendering::ViewState& rDefaultViewState,
101 const css::rendering::RenderState& rDefaultRenderState);
106 #endif
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */