LibreOffice Module oox (master) 1
vmldrawing.hxx
Go to the documentation of this file.
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_OOX_VML_VMLDRAWING_HXX
21#define INCLUDED_OOX_VML_VMLDRAWING_HXX
22
23#include <map>
24#include <memory>
25#include <vector>
26
27#include <com/sun/star/uno/Reference.hxx>
28#include <oox/dllapi.h>
30#include <rtl/ustring.hxx>
31#include <sal/types.h>
32
33namespace com::sun::star {
34 namespace awt { struct Rectangle; }
35 namespace drawing { class XDrawPage; }
36 namespace drawing { class XShape; }
37 namespace drawing { class XShapes; }
38}
39
40namespace oox {
41 namespace core { class XmlFilterBase; }
42 namespace ole { class EmbeddedControl; }
43 namespace ole { class EmbeddedForm; }
44 namespace vml { class ShapeContainer; }
45}
46
47namespace oox::vml {
48
49class ShapeBase;
50
51
54{
58};
59
60
63{
64 OUString maShapeId;
65 OUString maName;
67 const bool mbDmlShape;
68
69 explicit OleObjectInfo( bool bDmlShape = false );
70
72 void setShapeId( sal_Int32 nShapeId );
73};
74
75// =========================================/===================================
76
79{
80 OUString maShapeId;
81 OUString maFragmentPath;
82 OUString maName;
84
85 explicit ControlInfo();
86
88 void setShapeId( sal_Int32 nShapeId );
89};
90
91
94{
95public:
96 explicit Drawing(
98 const css::uno::Reference< css::drawing::XDrawPage >& rxDrawPage,
100
101 virtual ~Drawing();
102
106 DrawingType getType() const { return meType; }
108 ShapeContainer& getShapes() { return *mxShapes; }
110 const ShapeContainer& getShapes() const { return *mxShapes; }
112 ::oox::ole::EmbeddedForm& getControlForm() const;
113
116 void registerBlockId( sal_Int32 nBlockId );
119 void registerOleObject( const OleObjectInfo& rOleObject );
122 void registerControl( const ControlInfo& rControl );
123
125 void finalizeFragmentImport();
126
129 void convertAndInsert() const;
130
132 sal_Int32 getLocalShapeIndex( std::u16string_view rShapeId ) const;
134 const OleObjectInfo* getOleObjectInfo( const OUString& rShapeId ) const;
136 const ControlInfo* getControlInfo( const OUString& rShapeId ) const;
137
140 css::uno::Reference< css::drawing::XShape >
141 createAndInsertXShape(
142 const OUString& rService,
143 const css::uno::Reference< css::drawing::XShapes >& rxShapes,
144 const css::awt::Rectangle& rShapeRect ) const;
145
148 css::uno::Reference< css::drawing::XShape >
149 createAndInsertXControlShape(
150 const ::oox::ole::EmbeddedControl& rControl,
151 const css::uno::Reference< css::drawing::XShapes >& rxShapes,
152 const css::awt::Rectangle& rShapeRect,
153 sal_Int32& rnCtrlIndex ) const;
154
156 virtual bool isShapeSupported( const ShapeBase& rShape ) const;
157
160 virtual OUString getShapeBaseName( const ShapeBase& rShape ) const;
161
164 virtual bool convertClientAnchor(
165 css::awt::Rectangle& orShapeRect,
166 const OUString& rShapeAnchor ) const;
167
170 virtual css::uno::Reference< css::drawing::XShape >
171 createAndInsertClientXShape(
172 const ShapeBase& rShape,
173 const css::uno::Reference< css::drawing::XShapes >& rxShapes,
174 const css::awt::Rectangle& rShapeRect ) const;
175
180 virtual void notifyXShapeInserted(
181 const css::uno::Reference< css::drawing::XShape >& rxShape,
182 const css::awt::Rectangle& rShapeRect,
183 const ShapeBase& rShape, bool bGroupChild );
184
185private:
186 typedef ::std::vector< sal_Int32 > BlockIdVector;
187 typedef ::std::map< OUString, OleObjectInfo > OleObjectInfoMap;
188 typedef ::std::map< OUString, ControlInfo > ControlInfoMap;
189
191 css::uno::Reference< css::drawing::XDrawPage >
193 mutable std::unique_ptr<::oox::ole::EmbeddedForm> mxCtrlForm;
195 std::unique_ptr<ShapeContainer> mxShapes;
199};
200
201
202} // namespace oox::vml
203
204#endif
205
206/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A wrapper for a control form embedded directly in a draw page.
Definition: axcontrol.hxx:960
Represents the collection of VML shapes for a complete draw page.
Definition: vmldrawing.hxx:94
ShapeContainer & getShapes()
Returns read/write access to the container of shapes and templates.
Definition: vmldrawing.hxx:108
::oox::core::XmlFilterBase & getFilter() const
Returns the filter object that imports/exports this VML drawing.
Definition: vmldrawing.hxx:104
::std::map< OUString, ControlInfo > ControlInfoMap
Definition: vmldrawing.hxx:188
DrawingType getType() const
Returns the application type containing the drawing.
Definition: vmldrawing.hxx:106
std::unique_ptr<::oox::ole::EmbeddedForm > mxCtrlForm
The control form used to process embedded controls.
Definition: vmldrawing.hxx:193
ControlInfoMap maControls
Info about all embedded form controls, mapped by control name.
Definition: vmldrawing.hxx:197
::oox::core::XmlFilterBase & mrFilter
Filter object that imports/exports the VML drawing.
Definition: vmldrawing.hxx:190
::std::map< OUString, OleObjectInfo > OleObjectInfoMap
Definition: vmldrawing.hxx:187
BlockIdVector maBlockIds
Block identifiers used by this drawing.
Definition: vmldrawing.hxx:194
const DrawingType meType
Application type containing the drawing.
Definition: vmldrawing.hxx:198
const ShapeContainer & getShapes() const
Returns read access to the container of shapes and templates.
Definition: vmldrawing.hxx:110
OleObjectInfoMap maOleObjects
Info about all embedded OLE objects, mapped by shape id.
Definition: vmldrawing.hxx:196
std::unique_ptr< ShapeContainer > mxShapes
All shapes and shape templates.
Definition: vmldrawing.hxx:195
::std::vector< sal_Int32 > BlockIdVector
Definition: vmldrawing.hxx:186
css::uno::Reference< css::drawing::XDrawPage > mxDrawPage
UNO draw page used to insert the shapes.
Definition: vmldrawing.hxx:192
A shape object that is part of a drawing.
Definition: vmlshape.hxx:241
Container that holds a list of shapes and shape templates.
PropType meType
Definition: dffdumper.cxx:162
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
DocumentType eType
DrawingType
Enumerates different types of VML drawings.
Definition: vmldrawing.hxx:54
@ VMLDRAWING_EXCEL
Excel: OLE objects are part of VML.
Definition: vmldrawing.hxx:56
@ VMLDRAWING_WORD
Word: One shape per drawing.
Definition: vmldrawing.hxx:55
@ VMLDRAWING_POWERPOINT
PowerPoint: OLE objects are part of DrawingML.
Definition: vmldrawing.hxx:57
::cppu::WeakComponentImplHelper< css::report::XShape, css::lang::XServiceInfo > ShapeBase
const PowerPointImport & mrFilter
Definition: pptimport.cxx:264
Contains generic information about an OLE object.
Contains information about a form control embedded in a draw page.
Definition: vmldrawing.hxx:79
OUString maName
Programmatical name of the form control.
Definition: vmldrawing.hxx:82
bool mbTextContentShape
Whether this control shape will be imported to Writer or not (has AnchorType property or not).
Definition: vmldrawing.hxx:83
OUString maShapeId
Shape identifier for shape lookup.
Definition: vmldrawing.hxx:80
OUString maFragmentPath
Path to the fragment describing the form control properties.
Definition: vmldrawing.hxx:81
Contains information about an OLE object embedded in a draw page.
Definition: vmldrawing.hxx:63
const bool mbDmlShape
True = DrawingML shape (PowerPoint), false = VML shape (Excel/Word).
Definition: vmldrawing.hxx:67
OUString maName
Programmatical name of the OLE object.
Definition: vmldrawing.hxx:65
OUString maShapeId
Shape identifier for shape lookup.
Definition: vmldrawing.hxx:64