/src/libreoffice/svx/source/svdraw/svdfmtf.hxx
Line | Count | Source |
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_SVX_SOURCE_SVDRAW_SVDFMTF_HXX |
21 | | #define INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX |
22 | | |
23 | | #include <sal/config.h> |
24 | | |
25 | | #include <memory> |
26 | | |
27 | | #include <svl/itemset.hxx> |
28 | | #include <tools/fract.hxx> |
29 | | #include <vcl/metaact.hxx> |
30 | | #include <vcl/virdev.hxx> |
31 | | #include <svdimportbase.hxx> |
32 | | #include <svx/svdobj.hxx> |
33 | | #include <svx/xdash.hxx> |
34 | | |
35 | | // Forward Declarations |
36 | | |
37 | | |
38 | | class SdrObjList; |
39 | | class SdrModel; |
40 | | class SvdProgressInfo; |
41 | | |
42 | | |
43 | | // Helper Class ImpSdrGDIMetaFileImport |
44 | | class ImpSdrGDIMetaFileImport final : public ImpSdrImportBase |
45 | | { |
46 | | MapMode maPrefMapMode; |
47 | | Color maOldLineColor; |
48 | | basegfx::B2DLineJoin maLineJoin; |
49 | | css::drawing::LineCap maLineCap; |
50 | | |
51 | | // to optimize multiple lines into a Polyline |
52 | | bool mbLastObjWasLine; |
53 | | |
54 | | // clipregion |
55 | | basegfx::B2DPolyPolygon maClip; |
56 | | |
57 | | // check for clip and evtl. fill maClip |
58 | | void checkClip(); |
59 | | bool isClip() const; |
60 | | |
61 | | // actions |
62 | | void DoAction(MetaLineAction const & rAct); |
63 | | void DoAction(MetaRectAction const & rAct); |
64 | | void DoAction(MetaRoundRectAction const & rAct); |
65 | | void DoAction(MetaEllipseAction const & rAct); |
66 | | void DoAction(MetaArcAction const & rAct); |
67 | | void DoAction(MetaPieAction const & rAct); |
68 | | void DoAction(MetaChordAction const & rAct); |
69 | | void DoAction(MetaPolyLineAction const & rAct); |
70 | | void DoAction(MetaPolygonAction const & rAct); |
71 | | void DoAction(MetaPolyPolygonAction const & rAct); |
72 | | void DoAction(MetaTextAction const & rAct); |
73 | | void DoAction(MetaTextArrayAction const & rAct); |
74 | | void DoAction(MetaStretchTextAction const & rAct); |
75 | | void DoAction(MetaBmpAction const & rAct); |
76 | | void DoAction(MetaBmpScaleAction const & rAct); |
77 | | void DoAction(MetaBmpExAction const & rAct); |
78 | | void DoAction(MetaBmpExScaleAction const & rAct); |
79 | | void DoAction(MetaHatchAction const & rAct); |
80 | | void DoAction(MetaLineColorAction & rAct); |
81 | | void DoAction(MetaMapModeAction & rAct); |
82 | 0 | void DoAction(MetaFillColorAction & rAct) { rAct.Execute(mpVD); } |
83 | 0 | void DoAction(MetaTextColorAction & rAct) { rAct.Execute(mpVD); } |
84 | 0 | void DoAction(MetaTextFillColorAction & rAct) { rAct.Execute(mpVD); } |
85 | 0 | void DoAction(MetaFontAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; } |
86 | 0 | void DoAction(MetaTextAlignAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; } |
87 | 0 | void DoAction(MetaClipRegionAction & rAct) { rAct.Execute(mpVD); checkClip(); } |
88 | 0 | void DoAction(MetaRasterOpAction & rAct) { rAct.Execute(mpVD); } |
89 | 0 | void DoAction(MetaPushAction & rAct) { rAct.Execute(mpVD); checkClip(); } |
90 | 0 | void DoAction(MetaPopAction & rAct) { rAct.Execute(mpVD); mbFntDirty = true; checkClip(); } |
91 | 0 | void DoAction(MetaMoveClipRegionAction & rAct) { rAct.Execute(mpVD); checkClip(); } |
92 | 0 | void DoAction(MetaISectRectClipRegionAction& rAct) { rAct.Execute(mpVD); checkClip(); } |
93 | 0 | void DoAction(MetaISectRegionClipRegionAction& rAct) { rAct.Execute(mpVD); checkClip(); } |
94 | | |
95 | | // #i125211# The MetaCommentAction needs to advance (if used), thus |
96 | | // give current metafile and index which may be changed |
97 | | void DoAction(MetaCommentAction const & rAct, GDIMetaFile const & rMtf, size_t& a); |
98 | | |
99 | | // missing actions added |
100 | | void DoAction(MetaTextRectAction const & rAct); |
101 | | void DoAction(MetaBmpScalePartAction const & rAct); |
102 | | void DoAction(MetaBmpExScalePartAction const & rAct); |
103 | | void DoAction(MetaMaskAction const & rAct); |
104 | | void DoAction(MetaMaskScaleAction const & rAct); |
105 | | void DoAction(MetaMaskScalePartAction const & rAct); |
106 | | void DoAction(MetaGradientAction const & rAct); |
107 | | void DoAction(MetaTransparentAction const & rAct); |
108 | 0 | void DoAction(MetaRefPointAction& rAct) { rAct.Execute(mpVD); } |
109 | 0 | void DoAction(MetaTextLineColorAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; } |
110 | | void DoAction(MetaFloatTransparentAction const & rAct); |
111 | | void DoAction(MetaGradientExAction const & rAct); |
112 | 0 | void DoAction(MetaLayoutModeAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; } |
113 | 0 | void DoAction(MetaTextLanguageAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; } |
114 | 0 | void DoAction(MetaOverlineColorAction& rAct) { rAct.Execute(mpVD); mbFntDirty = true; } |
115 | | |
116 | | void ImportText(const Point& rPos, const OUString& rStr, const MetaAction& rAct); |
117 | | void SetAttributes(SdrObject* pObj, bool bForceTextAttr = false) override; |
118 | | void InsertObj(SdrObject* pObj, bool bScale = true); |
119 | | |
120 | | // #i73407# reformulation to use new B2DPolygon classes |
121 | | bool CheckLastLineMerge(const basegfx::B2DPolygon& rSrcPoly); |
122 | | |
123 | | void DoLoopActions(GDIMetaFile const & rMtf, SvdProgressInfo* pProgrInfo, sal_uInt32* pActionsToReport); |
124 | | |
125 | | // map from current virtual device mapmode to original mapmode |
126 | | Size implMap(const Size& rSz) const; |
127 | | Point implMap(const Point& rPt) const; |
128 | | basegfx::B2DHomMatrix implMapMatrix() const; |
129 | | |
130 | | // Copy assignment is forbidden and not implemented. |
131 | | ImpSdrGDIMetaFileImport (const ImpSdrGDIMetaFileImport &) = delete; |
132 | | ImpSdrGDIMetaFileImport & operator= (const ImpSdrGDIMetaFileImport &) = delete; |
133 | | |
134 | | public: |
135 | | ImpSdrGDIMetaFileImport( |
136 | | SdrModel& rModel, |
137 | | SdrLayerID nLay, |
138 | | const tools::Rectangle& rRect); |
139 | | |
140 | | size_t DoImport( |
141 | | const GDIMetaFile& rMtf, |
142 | | SdrObjList& rDestList, |
143 | | size_t nInsPos, |
144 | | SvdProgressInfo* pProgrInfo = nullptr); |
145 | | }; |
146 | | |
147 | | #endif // INCLUDED_SVX_SOURCE_SVDRAW_SVDFMTF_HXX |
148 | | |
149 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |