LibreOffice Module cppcanvas (master) 1
renderer.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_CPPCANVAS_RENDERER_HXX
21#define INCLUDED_CPPCANVAS_RENDERER_HXX
22
23#include <sal/types.h>
24#include <rtl/ustring.hxx>
25#include <optional>
28#include <cppcanvas/color.hxx>
29#include <memory>
30
31namespace basegfx
32{
33 class B2DRange;
34}
35
36/* Definition of Renderer interface */
37
38namespace cppcanvas
39{
40
41 class Renderer : public virtual CanvasGraphic
42 {
43 public:
68 virtual bool drawSubset( sal_Int32 nStartIndex,
69 sal_Int32 nEndIndex ) const = 0;
70
95 virtual ::basegfx::B2DRange getSubsetArea( sal_Int32 nStartIndex,
96 sal_Int32 nEndIndex ) const = 0;
97
101 {
103 ::std::optional< IntSRGBA > maFillColor;
104
106 ::std::optional< IntSRGBA > maLineColor;
107
109 ::std::optional< IntSRGBA > maTextColor;
110
112 ::std::optional< OUString > maFontName;
113
122 ::std::optional< ::basegfx::B2DHomMatrix > maTextTransformation;
123
125 ::std::optional< sal_Int8 > maFontWeight;
126
128 ::std::optional< sal_Int8 > maFontLetterForm;
129
131 ::std::optional< bool > maFontUnderline;
132 };
133 };
134
135 typedef std::shared_ptr< ::cppcanvas::Renderer > RendererSharedPtr;
136}
137
138#endif // INCLUDED_CPPCANVAS_RENDERER_HXX
139
140/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This interface defines basic properties of objects that can be painted on a Canvas.
virtual ::basegfx::B2DRange getSubsetArea(sal_Int32 nStartIndex, sal_Int32 nEndIndex) const =0
Query bounding box of metafile subset.
virtual bool drawSubset(sal_Int32 nStartIndex, sal_Int32 nEndIndex) const =0
Render subset of metafile to given canvas.
std::shared_ptr< ::cppcanvas::Renderer > RendererSharedPtr
Definition: renderer.hxx:135
Parameters for the Renderer.
Definition: renderer.hxx:101
::std::optional< IntSRGBA > maFillColor
Optionally forces the fill color attribute for all actions.
Definition: renderer.hxx:103
::std::optional< IntSRGBA > maTextColor
Optionally forces the text color attribute for all actions.
Definition: renderer.hxx:109
::std::optional< ::basegfx::B2DHomMatrix > maTextTransformation
Optionally transforms all text output actions with the given matrix (in addition to the overall canva...
Definition: renderer.hxx:122
::std::optional< IntSRGBA > maLineColor
Optionally forces the line color attribute for all actions.
Definition: renderer.hxx:106
::std::optional< OUString > maFontName
Optionally forces the given fontname for all text actions.
Definition: renderer.hxx:112
::std::optional< sal_Int8 > maFontWeight
Optionally forces the given font weight for all text actions.
Definition: renderer.hxx:125
::std::optional< bool > maFontUnderline
Optionally forces underlining for all text actions.
Definition: renderer.hxx:131
::std::optional< sal_Int8 > maFontLetterForm
Optionally forces the given font letter form (italics etc.) for all text actions.
Definition: renderer.hxx:128