1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_FILTER_SOURCE_MSFILTER_ESCHESDO_HXX
20 #define INCLUDED_FILTER_SOURCE_MSFILTER_ESCHESDO_HXX
21 #include <filter/msfilter/escherex.hxx>
22 #include <o3tl/any.hxx>
23 #include <svx/unopage.hxx>
24 #include <vcl/mapmod.hxx>
27 // fractions of Draw PPTWriter etc.
29 enum ImplEESdrPageType
{ NORMAL
= 0, MASTER
= 1, NOTICE
= 2, UNDEFINED
= 3 };
31 class ImplEESdrWriter
;
32 class ImplEESdrWriter
;
38 css::uno::Reference
< css::drawing::XShape
> mXShape
;
39 // XTextRef mXText; // TextRef des globalen Text
44 sal_uInt32 mnTextSize
;
48 bool mbEmptyPresObj
: 1;
51 void Init( ImplEESdrWriter
& rEx
);
53 css::uno::Reference
< css::beans::XPropertySet
> mXPropSet
;
55 ImplEESdrObject( ImplEESdrWriter
& rEx
, const SdrObject
& rObj
, bool bOOXML
);
56 ImplEESdrObject( ImplEESdrWriter
& rEx
, const css::uno::Reference
< css::drawing::XShape
>& rShape
);
59 bool ImplGetPropertyValue( const sal_Unicode
* pString
);
60 bool ImplGetPropertyValue( const OUString
& rString
) { return ImplGetPropertyValue(rString
.getStr()); }
62 sal_Int32
ImplGetInt32PropertyValue( const sal_Unicode
* pStr
)
63 { return ImplGetPropertyValue( pStr
) ? *o3tl::doAccess
<sal_Int32
>(mAny
) : 0; }
64 sal_Int32
ImplGetInt32PropertyValue( const OUString
& rStr
)
65 { return ImplGetInt32PropertyValue(rStr
.getStr()); }
67 const css::uno::Reference
< css::drawing::XShape
>& GetShapeRef() const { return mXShape
; }
68 const css::uno::Any
& GetUsrAny() const { return mAny
; }
69 const OUString
& GetType() const { return mType
; }
70 void SetType( const OUString
& rS
) { mType
= rS
; }
72 const Rectangle
& GetRect() const { return maRect
; }
73 void SetRect( const Point
& rPos
, const Size
& rSz
);
74 void SetRect( const Rectangle
& rRect
)
77 sal_Int32
GetAngle() const { return mnAngle
; }
78 void SetAngle( sal_Int32 nVal
) { mnAngle
= nVal
; }
80 bool IsValid() const { return mbValid
; }
82 bool IsEmptyPresObj() const { return mbEmptyPresObj
; }
83 sal_uInt32
GetShapeId() const { return mnShapeId
; }
84 void SetShapeId( sal_uInt32 nVal
) { mnShapeId
= nVal
; }
86 const SdrObject
* GetSdrObject() const;
88 sal_uInt32
ImplGetText();
89 bool ImplHasText() const;
90 bool GetOOXML() const { return mbOOXML
;}
91 void SetOOXML(bool bOOXML
);
95 // fractions of the Draw PPTWriter
98 namespace com
{ namespace sun
{ namespace star
{
104 class XStatusIndicator
;
107 class EscherExHostAppData
;
109 class ImplEESdrWriter
111 EscherEx
* mpEscherEx
;
112 MapMode maMapModeSrc
;
113 MapMode maMapModeDest
;
114 css::uno::Reference
< css::drawing::XDrawPage
> mXDrawPage
;
115 css::uno::Reference
< css::drawing::XShapes
> mXShapes
;
118 EscherExHostAppData
* mpHostAppData
;
119 bool mbIsTitlePossible
;
120 const SdrPage
* mpSdrPage
;
121 EscherSolverContainer
* mpSolverContainer
;
123 bool ImplInitPageValues();
124 void ImplWritePage( EscherSolverContainer
& rSolver
);
125 sal_uInt32
ImplWriteShape( ImplEESdrObject
& rObj
,
126 EscherSolverContainer
& rSolver
,
127 const bool bOOxmlExport
= false ); // returns ShapeID
128 static void ImplFlipBoundingBox( ImplEESdrObject
& rObj
, EscherPropertyContainer
& rPropOpt
);
129 void ImplWriteAdditionalText(
130 ImplEESdrObject
& rObj
,
131 const Point
& rTextRefPoint
);
132 sal_uInt32
ImplEnterAdditionalTextGroup(
133 const css::uno::Reference
< css::drawing::XShape
>& rShape
,
134 const Rectangle
* pBoundRect
);
135 void ImplFlushSolverContainer();
138 explicit ImplEESdrWriter( EscherEx
& rEx
);
140 Point
ImplMapPoint( const Point
& rPoint
);
141 Size
ImplMapSize( const Size
& rSize
);
142 EscherExHostAppData
* ImplGetHostData() { return mpHostAppData
; }
143 bool ImplInitPage( const SdrPage
& rPage
);
144 bool ImplInitUnoShapes( const css::uno::Reference
< css::drawing::XShapes
>& rxShapes
);
145 void ImplWriteCurrentPage();
146 sal_uInt32
ImplWriteTheShape( ImplEESdrObject
& rObj
, bool ooxmlExport
);
151 #endif // INCLUDED_FILTER_SOURCE_MSFILTER_ESCHESDO_HXX
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */