LibreOffice Module oox (master) 1
vmlshapecontext.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_VMLSHAPECONTEXT_HXX
21#define INCLUDED_OOX_VML_VMLSHAPECONTEXT_HXX
22
25#include <oox/helper/helper.hxx>
26#include <rtl/ustring.hxx>
27#include <sal/types.h>
28
29namespace oox { class AttributeList; }
30
31namespace oox::vml {
32
33class Drawing;
34
35struct ShapeTypeModel;
36class ShapeType;
37
38struct ClientData;
39struct ShapeModel;
40class ShapeBase;
41class GroupShape;
42class RectangleShape;
43
44class ShapeContainer;
45
46
48{
49public:
50 explicit ShapeLayoutContext(
51 ::oox::core::ContextHandler2Helper const & rParent,
52 Drawing& rDrawing );
53
55 onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
56
57private:
59};
60
61
63{
64public:
65 explicit ClientDataContext(
66 ::oox::core::ContextHandler2Helper const & rParent,
67 ClientData& rClientData,
68 const AttributeList& rAttribs );
69
71 onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
72 virtual void onCharacters( const OUString& rChars ) override;
73 virtual void onEndElement() override;
74
75private:
77 OUString maElementText;
78};
79
80
82{
83public:
86 ::oox::core::ContextHandler2Helper const & rParent,
87 ShapeContainer& rShapes,
88 sal_Int32 nElement,
89 const AttributeList& rAttribs );
90
91protected:
92 explicit ShapeContextBase( ::oox::core::ContextHandler2Helper const & rParent );
93};
94
95
97{
98public:
99 explicit ShapeTypeContext(
100 ::oox::core::ContextHandler2Helper const & rParent,
101 std::shared_ptr<ShapeType> const& pShapeType,
102 const AttributeList& rAttribs );
103
105 onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
106
107private:
109 void setStyle( std::u16string_view rStyle );
110
112 std::optional< OUString > decodeFragmentPath( const AttributeList& rAttribs, sal_Int32 nToken ) const;
113
114private:
115 std::shared_ptr<ShapeType> m_pShapeType;
117};
118
119
121{
122public:
123 explicit ShapeContext(::oox::core::ContextHandler2Helper const& rParent,
124 const std::shared_ptr<ShapeBase>& pShape, const AttributeList& rAttribs);
125
127 onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
128
129private:
131 void setPoints( std::u16string_view rPoints );
133 void setFrom( const OUString& rPoints );
135 void setTo( const OUString& rPoints );
137 void setControl1( const OUString& rPoints );
139 void setControl2( const OUString& rPoints );
141 void setVmlPath( const OUString& rPath );
143 void setHyperlink( const OUString& rHyperlink );
144
145private:
148};
149
150
151class GroupShapeContext final : public ShapeContext
152{
153public:
154 explicit GroupShapeContext(::oox::core::ContextHandler2Helper const& rParent,
155 const std::shared_ptr<GroupShape>& pShape,
156 const AttributeList& rAttribs);
157
159 onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
160
161private:
163};
164
165
167{
168public:
169 explicit RectangleShapeContext(::oox::core::ContextHandler2Helper const& rParent,
170 const AttributeList& rAttribs,
171 const std::shared_ptr<RectangleShape>& pShape);
172
174 onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
175};
176
178{
179public:
180 explicit ControlShapeContext(
181 ::oox::core::ContextHandler2Helper const & rParent,
182 ShapeContainer& rShapes,
183 const AttributeList& rAttribs );
184};
185
186
187} // namespace oox::vml
188
189#endif
190
191/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides access to attribute values of an element.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onCharacters(const OUString &rChars) override
ClientDataContext(::oox::core::ContextHandler2Helper const &rParent, ClientData &rClientData, const AttributeList &rAttribs)
virtual void onEndElement() override
ControlShapeContext(::oox::core::ContextHandler2Helper const &rParent, ShapeContainer &rShapes, const AttributeList &rAttribs)
Represents the collection of VML shapes for a complete draw page.
Definition: vmldrawing.hxx:94
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
GroupShapeContext(::oox::core::ContextHandler2Helper const &rParent, const std::shared_ptr< GroupShape > &pShape, const AttributeList &rAttribs)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
RectangleShapeContext(::oox::core::ContextHandler2Helper const &rParent, const AttributeList &rAttribs, const std::shared_ptr< RectangleShape > &pShape)
A shape object that is part of a drawing.
Definition: vmlshape.hxx:241
Container that holds a list of shapes and shape templates.
ShapeContextBase(::oox::core::ContextHandler2Helper const &rParent)
::oox::core::ContextHandlerRef createShapeContext(::oox::core::ContextHandler2Helper const &rParent, ShapeContainer &rShapes, sal_Int32 nElement, const AttributeList &rAttribs)
void setVmlPath(const OUString &rPath)
Processes the 'path' attribute.
ShapeContext(::oox::core::ContextHandler2Helper const &rParent, const std::shared_ptr< ShapeBase > &pShape, const AttributeList &rAttribs)
void setTo(const OUString &rPoints)
Processes the 'to' attribute.
void setControl1(const OUString &rPoints)
Processes the 'control1' attribute.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
void setHyperlink(const OUString &rHyperlink)
Processes the 'href' attribute.
void setControl2(const OUString &rPoints)
Processes the 'control2' attribute.
void setPoints(std::u16string_view rPoints)
Processes the 'points' attribute.
void setFrom(const OUString &rPoints)
Processes the 'from' attribute.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
ShapeLayoutContext(::oox::core::ContextHandler2Helper const &rParent, Drawing &rDrawing)
void setStyle(std::u16string_view rStyle)
Processes the 'style' attribute.
ShapeTypeContext(::oox::core::ContextHandler2Helper const &rParent, std::shared_ptr< ShapeType > const &pShapeType, const AttributeList &rAttribs)
std::optional< OUString > decodeFragmentPath(const AttributeList &rAttribs, sal_Int32 nToken) const
Resolve a relation identifier to a fragment path.
std::shared_ptr< ShapeType > m_pShapeType
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
::rtl::Reference< ContextHandler > ContextHandlerRef
::cppu::WeakComponentImplHelper< css::report::XShape, css::lang::XServiceInfo > ShapeBase
DefTokenId nToken
Excel specific shape client data (such as cell anchor).
Definition: vmlshape.hxx:168
The shape model structure contains all properties shared by all types of shapes.
Definition: vmlshape.hxx:61