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 #ifndef INCLUDED_OOX_VML_VMLSHAPECONTEXT_HXX
21 #define INCLUDED_OOX_VML_VMLSHAPECONTEXT_HXX
23 #include <oox/core/contexthandler2.hxx>
30 struct ShapeTypeModel
;
43 class ShapeLayoutContext
: public ::oox::core::ContextHandler2
46 explicit ShapeLayoutContext(
47 ::oox::core::ContextHandler2Helper
& rParent
,
50 virtual ::oox::core::ContextHandlerRef
51 onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
59 class ClientDataContext
: public ::oox::core::ContextHandler2
62 explicit ClientDataContext(
63 ::oox::core::ContextHandler2Helper
& rParent
,
64 ClientData
& rClientData
,
65 const AttributeList
& rAttribs
);
67 virtual ::oox::core::ContextHandlerRef
68 onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
69 virtual void onCharacters( const OUString
& rChars
) SAL_OVERRIDE
;
70 virtual void onEndElement() SAL_OVERRIDE
;
73 ClientData
& mrClientData
;
74 OUString maElementText
;
79 class ShapeContextBase
: public ::oox::core::ContextHandler2
82 static ::oox::core::ContextHandlerRef
84 ::oox::core::ContextHandler2Helper
& rParent
,
85 ShapeContainer
& rShapes
,
87 const AttributeList
& rAttribs
);
90 explicit ShapeContextBase( ::oox::core::ContextHandler2Helper
& rParent
);
95 class ShapeTypeContext
: public ShapeContextBase
98 explicit ShapeTypeContext(
99 ::oox::core::ContextHandler2Helper
& rParent
,
100 ShapeType
& rShapeType
,
101 const AttributeList
& rAttribs
);
103 virtual ::oox::core::ContextHandlerRef
104 onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
107 /** Processes the 'style' attribute. */
108 void setStyle( const OUString
& rStyle
);
110 /** Resolve a relation identifier to a fragment path. */
111 OptValue
< OUString
> decodeFragmentPath( const AttributeList
& rAttribs
, sal_Int32 nToken
) const;
114 ShapeTypeModel
& mrTypeModel
;
119 class ShapeContext
: public ShapeTypeContext
122 explicit ShapeContext(
123 ::oox::core::ContextHandler2Helper
& rParent
,
125 const AttributeList
& rAttribs
);
127 virtual ::oox::core::ContextHandlerRef
128 onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
131 /** Processes the 'points' attribute. */
132 void setPoints( const OUString
& rPoints
);
133 /** Processes the 'from' attribute. */
134 void setFrom( const OUString
& rPoints
);
135 /** Processes the 'to' attribute. */
136 void setTo( const OUString
& rPoints
);
137 /** Processes the 'control1' attribute. */
138 void setControl1( const OUString
& rPoints
);
139 /** Processes the 'control2' attribute. */
140 void setControl2( const OUString
& rPoints
);
141 /** Processes the 'path' attribute. */
142 void setVmlPath( const OUString
& rPath
);
148 ShapeModel
& mrShapeModel
;
153 class GroupShapeContext
: public ShapeContext
156 explicit GroupShapeContext(
157 ::oox::core::ContextHandler2Helper
& rParent
,
159 const AttributeList
& rAttribs
);
161 virtual ::oox::core::ContextHandlerRef
162 onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
165 ShapeContainer
& mrShapes
;
170 class RectangleShapeContext
: public ShapeContext
173 explicit RectangleShapeContext(
174 ::oox::core::ContextHandler2Helper
& rParent
,
175 const AttributeList
& rAttribs
,
176 RectangleShape
& rShape
);
178 virtual ::oox::core::ContextHandlerRef
179 onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) SAL_OVERRIDE
;
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */