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>
24 // fractions of Draw PPTWriter etc.
26 class ImplEESdrWriter
;
32 css::uno::Reference
< css::drawing::XShape
> mXShape
;
34 tools::Rectangle maRect
;
37 sal_uInt32 mnTextSize
;
41 bool mbEmptyPresObj
: 1;
46 css::uno::Reference
< css::beans::XPropertySet
> mXPropSet
;
48 ImplEESdrObject(ImplEESdrWriter
& rEx
, const SdrObject
& rObj
, bool bOOXML
, sal_uInt32 nId
= 0);
49 ImplEESdrObject( const css::uno::Reference
< css::drawing::XShape
>& rShape
);
52 bool ImplGetPropertyValue( const OUString
& rString
);
54 sal_Int32
ImplGetInt32PropertyValue( const OUString
& rStr
)
55 { return ImplGetPropertyValue( rStr
) ? *o3tl::doAccess
<sal_Int32
>(mAny
) : 0; }
57 const css::uno::Reference
< css::drawing::XShape
>& GetShapeRef() const { return mXShape
; }
58 const css::uno::Any
& GetUsrAny() const { return mAny
; }
59 const OUString
& GetType() const { return mType
; }
60 void SetType( const OUString
& rS
) { mType
= rS
; }
62 const tools::Rectangle
& GetRect() const { return maRect
; }
63 void SetRect( const Point
& rPos
, const Size
& rSz
);
64 void SetRect( const tools::Rectangle
& rRect
)
67 sal_Int32
GetAngle() const { return mnAngle
; }
68 void SetAngle( sal_Int32 nVal
) { mnAngle
= nVal
; }
70 bool IsValid() const { return mbValid
; }
72 bool IsEmptyPresObj() const { return mbEmptyPresObj
; }
73 sal_uInt32
GetShapeId() const { return mnShapeId
; }
74 void SetShapeId( sal_uInt32 nVal
) { mnShapeId
= nVal
; }
76 const SdrObject
* GetSdrObject() const;
78 sal_uInt32
ImplGetText();
79 bool ImplHasText() const;
80 bool GetOOXML() const { return mbOOXML
;}
81 void SetOOXML(bool bOOXML
);
85 // fractions of the Draw PPTWriter
88 namespace com::sun::star
{
94 class XStatusIndicator
;
97 class EscherExHostAppData
;
101 EscherEx
* mpEscherEx
;
102 css::uno::Reference
< css::drawing::XDrawPage
> mXDrawPage
;
103 css::uno::Reference
< css::drawing::XShapes
> mXShapes
;
106 EscherExHostAppData
* mpHostAppData
;
107 bool mbIsTitlePossible
;
108 const SdrPage
* mpSdrPage
;
109 std::unique_ptr
<EscherSolverContainer
> mpSolverContainer
;
111 void ImplInitPageValues();
112 void ImplWritePage( EscherSolverContainer
& rSolver
, bool ooxmlExport
);
113 sal_uInt32
ImplWriteShape( ImplEESdrObject
& rObj
,
114 EscherSolverContainer
& rSolver
,
115 const bool bOOxmlExport
= false ); // returns ShapeID
116 static void ImplFlipBoundingBox( ImplEESdrObject
& rObj
, EscherPropertyContainer
& rPropOpt
);
117 void ImplWriteAdditionalText(
118 ImplEESdrObject
& rObj
);
119 sal_uInt32
ImplEnterAdditionalTextGroup(
120 const css::uno::Reference
< css::drawing::XShape
>& rShape
,
121 const tools::Rectangle
* pBoundRect
);
122 void ImplFlushSolverContainer();
125 explicit ImplEESdrWriter( EscherEx
& rEx
);
127 static Point
ImplMapPoint( const Point
& rPoint
);
128 static Size
ImplMapSize( const Size
& rSize
);
129 EscherExHostAppData
* ImplGetHostData() { return mpHostAppData
; }
130 bool ImplInitPage( const SdrPage
& rPage
);
131 bool ImplInitUnoShapes( const css::uno::Reference
< css::drawing::XShapes
>& rxShapes
);
132 void ImplWriteCurrentPage( bool ooxmlExport
);
133 sal_uInt32
ImplWriteTheShape( ImplEESdrObject
& rObj
, bool ooxmlExport
);
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */