LibreOffice Module drawinglayer (master) 1
wmfemfhelper.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#pragma once
21
22#include <sal/config.h>
24#include <vcl/font.hxx>
25#include <rtl/ref.hxx>
29
30// predefines
31namespace drawinglayer::geometry { class ViewInformation2D; }
32class GDIMetaFile;
33namespace wmfemfhelper { class PropertyHolder; }
34
35namespace wmfemfhelper
36{
44 {
45 private:
47
48 public:
51 sal_uInt32 size() const;
53 {
54 append(pCandidate.get());
55 }
57 {
58 aTargets.append(std::move(xCandidate));
59 }
62 };
63
66 {
67 private:
68 std::vector< TargetHolder* > maTargetHolders;
69
70 public:
72 sal_uInt32 size() const;
73 void Push();
74 void Pop();
77 };
78
86 {
87 private:
91
99
102
109
111 bool mbLineColor : 1;
112 bool mbFillColor : 1;
113 bool mbTextColor : 1;
118
119 public:
121
125
126 MapUnit getMapUnit() const { return maMapUnit; }
127 void setMapUnit(MapUnit eNew) { if (eNew != maMapUnit) maMapUnit = eNew; }
128
129 const basegfx::BColor& getLineColor() const { return maLineColor; }
130 void setLineColor(const basegfx::BColor& rNew) { if (rNew != maLineColor) maLineColor = rNew; }
131 bool getLineColorActive() const { return mbLineColor; }
132 void setLineColorActive(bool bNew) { if (bNew != mbLineColor) mbLineColor = bNew; }
133
134 const basegfx::BColor& getFillColor() const { return maFillColor; }
135 void setFillColor(const basegfx::BColor& rNew) { if (rNew != maFillColor) maFillColor = rNew; }
136 bool getFillColorActive() const { return mbFillColor; }
137 void setFillColorActive(bool bNew) { if (bNew != mbFillColor) mbFillColor = bNew; }
138
139 const basegfx::BColor& getTextColor() const { return maTextColor; }
140 void setTextColor(const basegfx::BColor& rNew) { if (rNew != maTextColor) maTextColor = rNew; }
141 bool getTextColorActive() const { return mbTextColor; }
142 void setTextColorActive(bool bNew) { if (bNew != mbTextColor) mbTextColor = bNew; }
143
145 void setTextFillColor(const basegfx::BColor& rNew) { if (rNew != maTextFillColor) maTextFillColor = rNew; }
147 void setTextFillColorActive(bool bNew) { if (bNew != mbTextFillColor) mbTextFillColor = bNew; }
148
150 void setTextLineColor(const basegfx::BColor& rNew) { if (rNew != maTextLineColor) maTextLineColor = rNew; }
152 void setTextLineColorActive(bool bNew) { if (bNew != mbTextLineColor) mbTextLineColor = bNew; }
153
155 void setOverlineColor(const basegfx::BColor& rNew) { if (rNew != maOverlineColor) maOverlineColor = rNew; }
157 void setOverlineColorActive(bool bNew) { if (bNew != mbOverlineColor) mbOverlineColor = bNew; }
158
163
164 const vcl::Font& getFont() const { return maFont; }
165 void setFont(const vcl::Font& rFont) { if (rFont != maFont) maFont = rFont; }
166
167 const RasterOp& getRasterOp() const { return maRasterOp; }
168 void setRasterOp(const RasterOp& rRasterOp) { if (rRasterOp != maRasterOp) maRasterOp = rRasterOp; }
169 bool isRasterOpInvert() const { return (RasterOp::Xor == maRasterOp || RasterOp::Invert == maRasterOp); }
170 bool isRasterOpForceBlack() const { return RasterOp::N0 == maRasterOp; }
172
175
177 void setLanguageType(LanguageType aNew) { if (aNew != maLanguageType) maLanguageType = aNew; }
178
180 void setPushFlags(vcl::PushFlags nNew) { if (nNew != mnPushFlags) mnPushFlags = nNew; }
181
182 bool getLineOrFillActive() const { return (mbLineColor || mbFillColor); }
183 };
184
195 {
196 private:
197 std::vector< PropertyHolder* > maPropertyHolders;
198
199 public:
201 void PushDefault();
202 void Push(vcl::PushFlags nPushFlags);
203 void Pop();
206 };
207
209 const GDIMetaFile& rMetaFile,
210 const drawinglayer::geometry::ViewInformation2D& rViewInformation);
211
213 const basegfx::B2DPolyPolygon& rClipPolyPolygon,
214 TargetHolders& rTargetHolders,
215 PropertyHolders& rPropertyHolders);
216}
217
218/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
RasterOp
helper class for graphic context
void setLayoutMode(vcl::text::ComplexTextLayoutFlags nNew)
void setFont(const vcl::Font &rFont)
const basegfx::B2DHomMatrix & getTransformation() const
read/write accesses
const basegfx::B2DPolyPolygon & getClipPolyPolygon() const
void setClipPolyPolygon(const basegfx::B2DPolyPolygon &rNew)
void setClipPolyPolygonActive(bool bNew)
void setLineColorActive(bool bNew)
void setTransformation(const basegfx::B2DHomMatrix &rNew)
const basegfx::BColor & getLineColor() const
basegfx::BColor maOverlineColor
void setFillColorActive(bool bNew)
vcl::text::ComplexTextLayoutFlags getLayoutMode() const
basegfx::B2DHomMatrix maTransformation
current transformation (aka MapMode)
void setMapUnit(MapUnit eNew)
const basegfx::BColor & getFillColor() const
void setFillColor(const basegfx::BColor &rNew)
basegfx::BColor maTextFillColor
void setOverlineColorActive(bool bNew)
vcl::Font maFont
font, etc.
basegfx::BColor maLineColor
current colors
void setOverlineColor(const basegfx::BColor &rNew)
vcl::PushFlags getPushFlags() const
void setTextFillColorActive(bool bNew)
const basegfx::BColor & getTextLineColor() const
basegfx::BColor maTextLineColor
LanguageType getLanguageType() const
void setRasterOp(const RasterOp &rRasterOp)
void setLineColor(const basegfx::BColor &rNew)
const basegfx::BColor & getTextColor() const
const basegfx::BColor & getOverlineColor() const
void setTextLineColorActive(bool bNew)
void setTextLineColor(const basegfx::BColor &rNew)
const RasterOp & getRasterOp() const
void setTextColor(const basegfx::BColor &rNew)
basegfx::B2DPolyPolygon maClipPolyPolygon
clipping
PropertyHolder()
helper class for graphic context
const basegfx::BColor & getTextFillColor() const
const vcl::Font & getFont() const
void setTextFillColor(const basegfx::BColor &rNew)
vcl::text::ComplexTextLayoutFlags mnLayoutMode
void setTextColorActive(bool bNew)
void setPushFlags(vcl::PushFlags nNew)
void setLanguageType(LanguageType aNew)
bool mbLineColor
contains all active markers
void Push(vcl::PushFlags nPushFlags)
std::vector< PropertyHolder * > maPropertyHolders
PropertyHolders()
stack for properties
Helper class to buffer and hold a Primitive target vector.
void append(const rtl::Reference< drawinglayer::primitive2d::BasePrimitive2D > &pCandidate)
void append(drawinglayer::primitive2d::Primitive2DContainer xCandidate)
TargetHolder()
Helper class to buffer and hold a Primitive target vector.
drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequence(const PropertyHolder &rPropertyHolder)
sal_uInt32 size() const
drawinglayer::primitive2d::Primitive2DContainer aTargets
Helper class which builds a stack on the TargetHolder class.
TargetHolders()
Helper class which builds a stack on the TargetHolder class.
std::vector< TargetHolder * > maTargetHolders
MapUnit
ComplexTextLayoutFlags
drawinglayer::primitive2d::Primitive2DContainer interpretMetafile(const GDIMetaFile &rMetaFile, const drawinglayer::geometry::ViewInformation2D &rViewInformation)
void HandleNewClipRegion(const basegfx::B2DPolyPolygon &rClipPolyPolygon, TargetHolders &rTargetHolders, PropertyHolders &rPropertyHolders)
helper to take needed action on ClipRegion change.