Drop some needless mappings to identical strings
[LibreOffice.git] / filter / source / msfilter / eschesdo.hxx
blob5e4bda191e1ffe68476a530af26a8d3b09636857
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 .
19 #pragma once
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;
27 class SdrObject;
28 class SdrPage;
29 class SvxDrawPage;
31 class ImplEESdrObject
33 css::uno::Reference< css::drawing::XShape > mXShape;
34 css::uno::Any mAny;
35 tools::Rectangle maRect;
36 OUString mType;
37 sal_uInt32 mnShapeId;
38 sal_uInt32 mnTextSize;
39 sal_Int32 mnAngle;
40 bool mbValid : 1;
41 bool mbPresObj : 1;
42 bool mbEmptyPresObj : 1;
43 bool mbOOXML;
45 void Init();
46 public:
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 );
51 ~ImplEESdrObject();
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 )
66 { maRect = 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
88 class EscherEx;
89 namespace com::sun::star {
90 namespace drawing {
91 class XDrawPage;
92 class XShape;
94 namespace task {
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;
105 SvStream* mpPicStrm;
106 // own extensions
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();
123 public:
124 explicit ImplEESdrWriter( EscherEx& rEx );
125 ~ImplEESdrWriter();
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 );
133 void ImplExitPage();
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */