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 .
20 #include <filter/msfilter/escherex.hxx>
21 #include <o3tl/any.hxx>
22 #include <rtl/ref.hxx>
24 // fractions of Draw PPTWriter etc.
26 class ImplEESdrWriter
;
33 css::uno::Reference
< css::drawing::XShape
> mXShape
;
35 tools::Rectangle maRect
;
38 sal_uInt32 mnTextSize
;
42 bool mbEmptyPresObj
: 1;
47 css::uno::Reference
< css::beans::XPropertySet
> mXPropSet
;
49 ImplEESdrObject(ImplEESdrWriter
& rEx
, const SdrObject
& rObj
, bool bOOXML
, sal_uInt32 nId
= 0);
50 ImplEESdrObject( const css::uno::Reference
< css::drawing::XShape
>& rShape
);
53 bool ImplGetPropertyValue( const OUString
& rString
);
55 sal_Int32
ImplGetInt32PropertyValue( const OUString
& rStr
)
56 { return ImplGetPropertyValue( rStr
) ? *o3tl::doAccess
<sal_Int32
>(mAny
) : 0; }
58 const css::uno::Reference
< css::drawing::XShape
>& GetShapeRef() const { return mXShape
; }
59 const css::uno::Any
& GetUsrAny() const { return mAny
; }
60 const OUString
& GetType() const { return mType
; }
61 void SetType( const OUString
& rS
) { mType
= rS
; }
63 const tools::Rectangle
& GetRect() const { return maRect
; }
64 void SetRect( const Point
& rPos
, const Size
& rSz
);
65 void SetRect( const tools::Rectangle
& rRect
)
68 sal_Int32
GetAngle() const { return mnAngle
; }
69 void SetAngle( sal_Int32 nVal
) { mnAngle
= nVal
; }
71 bool IsValid() const { return mbValid
; }
73 bool IsEmptyPresObj() const { return mbEmptyPresObj
; }
74 sal_uInt32
GetShapeId() const { return mnShapeId
; }
75 void SetShapeId( sal_uInt32 nVal
) { mnShapeId
= nVal
; }
77 const SdrObject
* GetSdrObject() const;
79 sal_uInt32
ImplGetText();
80 bool ImplHasText() const;
81 bool GetOOXML() const { return mbOOXML
;}
82 void SetOOXML(bool bOOXML
);
86 // fractions of the Draw PPTWriter
89 namespace com::sun::star
{
95 class XStatusIndicator
;
98 class EscherExHostAppData
;
100 class ImplEESdrWriter
102 EscherEx
* mpEscherEx
;
103 rtl::Reference
< SvxDrawPage
> mXDrawPage
;
104 css::uno::Reference
< css::drawing::XShapes
> mXShapes
;
107 EscherExHostAppData
* mpHostAppData
;
108 const SdrPage
* mpSdrPage
;
109 std::unique_ptr
<EscherSolverContainer
> mpSolverContainer
;
111 void ImplWritePage( EscherSolverContainer
& rSolver
, bool ooxmlExport
);
112 sal_uInt32
ImplWriteShape( ImplEESdrObject
& rObj
,
113 EscherSolverContainer
& rSolver
,
114 const bool bOOxmlExport
= false ); // returns ShapeID
115 static void ImplFlipBoundingBox( ImplEESdrObject
& rObj
, EscherPropertyContainer
& rPropOpt
);
116 void ImplWriteAdditionalText(
117 ImplEESdrObject
& rObj
);
118 sal_uInt32
ImplEnterAdditionalTextGroup(
119 const css::uno::Reference
< css::drawing::XShape
>& rShape
,
120 const tools::Rectangle
* pBoundRect
);
121 void ImplFlushSolverContainer();
124 explicit ImplEESdrWriter( EscherEx
& rEx
);
126 static Point
ImplMapPoint( const Point
& rPoint
);
127 static Size
ImplMapSize( const Size
& rSize
);
128 EscherExHostAppData
* ImplGetHostData() { return mpHostAppData
; }
129 bool ImplInitPage( const SdrPage
& rPage
);
130 bool ImplInitUnoShapes( const css::uno::Reference
< css::drawing::XShapes
>& rxShapes
);
131 void ImplWriteCurrentPage( bool ooxmlExport
);
132 sal_uInt32
ImplWriteTheShape( ImplEESdrObject
& rObj
, bool ooxmlExport
);
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */