fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / svx / source / svdraw / svdfmtf.hxx
blobc7c32f4619e29406b48ed4e216f9ce095958a862
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_SVX_SOURCE_SVDRAW_SVDFMTF_HXX
21 #define INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX
23 #include <tools/contnr.hxx>
24 #include <tools/fract.hxx>
25 #include <vcl/metaact.hxx>
26 #include <vcl/virdev.hxx>
27 #include <svx/svdobj.hxx>
28 #include <svx/xdash.hxx>
30 // Forward Declarations
33 class SfxItemSet;
34 class SdrObjList;
35 class SdrModel;
36 class SdrPage;
37 class SdrObject;
38 class SvdProgressInfo;
41 // Helper Class ImpSdrGDIMetaFileImport
44 class ImpSdrGDIMetaFileImport
46 protected:
47 ::std::vector< SdrObject* > maTmpList;
48 ScopedVclPtr<VirtualDevice> mpVD;
49 Rectangle maScaleRect;
50 size_t mnMapScalingOfs; // from here on, not edited with MapScaling
51 SfxItemSet* mpLineAttr;
52 SfxItemSet* mpFillAttr;
53 SfxItemSet* mpTextAttr;
54 SdrModel* mpModel;
55 SdrLayerID mnLayer;
56 Color maOldLineColor;
57 sal_Int32 mnLineWidth;
58 basegfx::B2DLineJoin maLineJoin;
59 com::sun::star::drawing::LineCap maLineCap;
60 XDash maDash;
62 bool mbMov;
63 bool mbSize;
64 Point maOfs;
65 double mfScaleX;
66 double mfScaleY;
67 Fraction maScaleX;
68 Fraction maScaleY;
70 bool mbFntDirty;
72 // to optimize (PenNULL,Brush,DrawPoly),(Pen,BrushNULL,DrawPoly) -> two-in-one
73 bool mbLastObjWasPolyWithoutLine;
74 bool mbNoLine;
75 bool mbNoFill;
77 // to optimize multiple lines into a Polyline
78 bool mbLastObjWasLine;
80 // clipregion
81 basegfx::B2DPolyPolygon maClip;
83 protected:
84 // check for clip and evtl. fill maClip
85 void checkClip();
86 bool isClip() const;
88 // actions
89 void DoAction(MetaLineAction & rAct);
90 void DoAction(MetaRectAction & rAct);
91 void DoAction(MetaRoundRectAction & rAct);
92 void DoAction(MetaEllipseAction & rAct);
93 void DoAction(MetaArcAction & rAct);
94 void DoAction(MetaPieAction & rAct);
95 void DoAction(MetaChordAction & rAct);
96 void DoAction(MetaPolyLineAction & rAct);
97 void DoAction(MetaPolygonAction & rAct);
98 void DoAction(MetaPolyPolygonAction & rAct);
99 void DoAction(MetaTextAction & rAct);
100 void DoAction(MetaTextArrayAction & rAct);
101 void DoAction(MetaStretchTextAction & rAct);
102 void DoAction(MetaBmpAction & rAct);
103 void DoAction(MetaBmpScaleAction & rAct);
104 void DoAction(MetaBmpExAction & rAct);
105 void DoAction(MetaBmpExScaleAction & rAct);
106 void DoAction(MetaHatchAction & rAct);
107 void DoAction(MetaLineColorAction & rAct);
108 void DoAction(MetaMapModeAction & rAct);
109 void DoAction(MetaFillColorAction & rAct) { rAct.Execute(mpVD); }
110 void DoAction(MetaTextColorAction & rAct) { rAct.Execute(mpVD); }
111 void DoAction(MetaTextFillColorAction & rAct) { rAct.Execute(mpVD); }
112 void DoAction(MetaFontAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
113 void DoAction(MetaTextAlignAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
114 void DoAction(MetaClipRegionAction & rAct) { rAct.Execute(mpVD); checkClip(); }
115 void DoAction(MetaRasterOpAction & rAct) { rAct.Execute(mpVD); }
116 void DoAction(MetaPushAction & rAct) { rAct.Execute(mpVD); checkClip(); }
117 void DoAction(MetaPopAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; checkClip(); }
118 void DoAction(MetaMoveClipRegionAction & rAct) { rAct.Execute(mpVD); checkClip(); }
119 void DoAction(MetaISectRectClipRegionAction& rAct) { rAct.Execute(mpVD); checkClip(); }
120 void DoAction(MetaISectRegionClipRegionAction& rAct) { rAct.Execute(mpVD); checkClip(); }
122 // #i125211# The MetaCommentAction needs to advance (if used), thus
123 // give current metafile and index which may be changed
124 void DoAction(MetaCommentAction& rAct, GDIMetaFile& rMtf, sal_uLong& a);
126 // missing actions added
127 void DoAction(MetaTextRectAction& rAct);
128 void DoAction(MetaBmpScalePartAction& rAct);
129 void DoAction(MetaBmpExScalePartAction& rAct);
130 void DoAction(MetaMaskAction& rAct);
131 void DoAction(MetaMaskScaleAction& rAct);
132 void DoAction(MetaMaskScalePartAction& rAct);
133 void DoAction(MetaGradientAction& rAct);
134 static void DoAction(MetaWallpaperAction& rAct);
135 void DoAction(MetaTransparentAction& rAct);
136 static void DoAction(MetaEPSAction& rAct);
137 void DoAction(MetaRefPointAction& rAct) { rAct.Execute(mpVD); }
138 void DoAction(MetaTextLineColorAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
139 static void DoAction(MetaTextLineAction& rAct);
140 void DoAction(MetaFloatTransparentAction& rAct);
141 void DoAction(MetaGradientExAction& rAct);
142 void DoAction(MetaLayoutModeAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
143 void DoAction(MetaTextLanguageAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
144 void DoAction(MetaOverlineColorAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; }
146 void ImportText(const Point& rPos, const OUString& rStr, const MetaAction& rAct);
147 void SetAttributes(SdrObject* pObj, bool bForceTextAttr = false);
148 void InsertObj(SdrObject* pObj, bool bScale = true);
149 void MapScaling();
151 // #i73407# reformulation to use new B2DPolygon classes
152 bool CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly);
153 bool CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygon& rPolyPolygon);
155 void DoLoopActions(GDIMetaFile& rMtf, SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport);
157 public:
158 ImpSdrGDIMetaFileImport(
159 SdrModel& rModel,
160 SdrLayerID nLay,
161 const Rectangle& rRect);
162 ~ImpSdrGDIMetaFileImport();
164 size_t DoImport(
165 const GDIMetaFile& rMtf,
166 SdrObjList& rDestList,
167 size_t nInsPos = SAL_MAX_SIZE,
168 SvdProgressInfo* pProgrInfo = 0);
171 #endif // INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX
173 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */