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_DRAWINGML_MISCCONTEXTS_HXX
21 #define INCLUDED_OOX_DRAWINGML_MISCCONTEXTS_HXX
23 #include <drawingml/colorchoicecontext.hxx>
25 #include <drawingml/fillproperties.hxx>
27 namespace oox::drawingml
{
30 /** Context handler that imports the a:solidFill element. */
31 class SolidFillContext final
: public ColorContext
34 explicit SolidFillContext(
35 ::oox::core::ContextHandler2Helper
const & rParent
,
36 FillProperties
& rFillProps
);
40 /** Context handler that imports the a:gradFill element. */
41 class GradientFillContext final
: public ::oox::core::ContextHandler2
44 explicit GradientFillContext(
45 ::oox::core::ContextHandler2Helper
const & rParent
,
46 const ::oox::AttributeList
& rAttribs
,
47 GradientFillProperties
& rGradientProps
);
49 virtual ::oox::core::ContextHandlerRef
52 const ::oox::AttributeList
& rAttribs
) override
;
55 GradientFillProperties
& mrGradientProps
;
58 /** Context handler that imports the a:pattFill element. */
59 class PatternFillContext final
: public ::oox::core::ContextHandler2
62 explicit PatternFillContext(
63 ::oox::core::ContextHandler2Helper
const & rParent
,
64 const ::oox::AttributeList
& rAttribs
,
65 PatternFillProperties
& rPatternProps
);
67 virtual ::oox::core::ContextHandlerRef
70 const ::oox::AttributeList
& rAttribs
) override
;
73 PatternFillProperties
& mrPatternProps
;
77 /** Context handler that imports a14:imgProps, a14:imgLayer, a14:imgEffect containers
78 and the a14:artistic* effect tags defined in the MS-ODRAWXML extension. */
79 class ArtisticEffectContext final
: public ::oox::core::ContextHandler2
82 explicit ArtisticEffectContext(
83 ::oox::core::ContextHandler2Helper
const & rParent
,
84 ArtisticEffectProperties
& rEffect
);
85 virtual ~ArtisticEffectContext() override
;
87 virtual ::oox::core::ContextHandlerRef
90 const ::oox::AttributeList
& rAttribs
) override
;
93 ArtisticEffectProperties
& maEffect
;
97 /** Context handler that imports the a:extLst element inside a:blip and its
98 children a:ext, which can contain transformations to the bitmap. */
99 class BlipExtensionContext final
: public ::oox::core::ContextHandler2
102 explicit BlipExtensionContext(
103 ::oox::core::ContextHandler2Helper
const & rParent
,
104 BlipFillProperties
& rBlipProps
);
105 virtual ~BlipExtensionContext() override
;
107 virtual ::oox::core::ContextHandlerRef
110 const ::oox::AttributeList
& rAttribs
) override
;
113 BlipFillProperties
& mrBlipProps
;
117 /** Context handler that imports the a:duotone element containing the colors
118 of a bitmap duotone transformation. */
119 class DuotoneContext final
: public ::oox::core::ContextHandler2
122 explicit DuotoneContext(
123 ::oox::core::ContextHandler2Helper
const & rParent
,
124 BlipFillProperties
& rBlipProps
);
125 virtual ~DuotoneContext() override
;
127 virtual ::oox::core::ContextHandlerRef
130 const ::oox::AttributeList
& rAttribs
) override
;
133 BlipFillProperties
& mrBlipProps
;
138 /** Context handler that imports the a:clrChange element containing the colors
139 of a bitmap color change transformation. */
140 class ColorChangeContext final
: public ::oox::core::ContextHandler2
143 explicit ColorChangeContext(
144 ::oox::core::ContextHandler2Helper
const & rParent
,
145 const ::oox::AttributeList
& rAttribs
,
146 BlipFillProperties
& rBlipProps
);
147 virtual ~ColorChangeContext() override
;
149 virtual ::oox::core::ContextHandlerRef
152 const ::oox::AttributeList
& rAttribs
) override
;
155 BlipFillProperties
& mrBlipProps
;
159 /** Context handler that imports the a:blip element containing the fill bitmap
160 and bitmap color transformation settings. */
161 class BlipContext final
: public ::oox::core::ContextHandler2
164 explicit BlipContext(
165 ::oox::core::ContextHandler2Helper
const & rParent
,
166 const ::oox::AttributeList
& rAttribs
,
167 BlipFillProperties
& rBlipProps
);
169 virtual ::oox::core::ContextHandlerRef
172 const ::oox::AttributeList
& rAttribs
) override
;
175 BlipFillProperties
& mrBlipProps
;
178 /** Context handler that imports the a:blipFill element. */
179 class BlipFillContext final
: public ::oox::core::ContextHandler2
182 explicit BlipFillContext(
183 ::oox::core::ContextHandler2Helper
const & rParent
,
184 const ::oox::AttributeList
& rAttribs
,
185 BlipFillProperties
& rBlipProps
);
187 virtual ::oox::core::ContextHandlerRef
190 const ::oox::AttributeList
& rAttribs
) override
;
193 BlipFillProperties
& mrBlipProps
;
196 /** Context handler for elements that contain a fill property element
197 (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill). */
198 class FillPropertiesContext
: public ::oox::core::ContextHandler2
201 explicit FillPropertiesContext(
202 ::oox::core::ContextHandler2Helper
const & rParent
,
203 FillProperties
& rFillProps
);
205 virtual ::oox::core::ContextHandlerRef
208 const ::oox::AttributeList
& rAttribs
) override
;
210 static ::oox::core::ContextHandlerRef
212 ::oox::core::ContextHandler2Helper
const & rParent
,
214 const ::oox::AttributeList
& rAttribs
,
215 FillProperties
& rFillProps
);
218 FillProperties
& mrFillProps
;
221 /** Context handler for elements that contain a fill property element
222 (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill).
224 This context handler takes a simple color instead of a fill properties
225 struct. The imported fill properties are converted automatically to the
226 best fitting solid color.
228 class SimpleFillPropertiesContext final
: private FillProperties
, public FillPropertiesContext
231 explicit SimpleFillPropertiesContext(
232 ::oox::core::ContextHandler2Helper
const & rParent
,
234 virtual ~SimpleFillPropertiesContext() override
;
240 } // namespace oox::drawingml
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */