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>
31 /** Context handler that imports the a:solidFill element. */
32 class SolidFillContext
: public ColorContext
35 explicit SolidFillContext(
36 ::oox::core::ContextHandler2Helper
const & rParent
,
37 FillProperties
& rFillProps
);
41 /** Context handler that imports the a:gradFill element. */
42 class GradientFillContext
: public ::oox::core::ContextHandler2
45 explicit GradientFillContext(
46 ::oox::core::ContextHandler2Helper
const & rParent
,
47 const ::oox::AttributeList
& rAttribs
,
48 GradientFillProperties
& rGradientProps
);
50 virtual ::oox::core::ContextHandlerRef
53 const ::oox::AttributeList
& rAttribs
) override
;
56 GradientFillProperties
& mrGradientProps
;
59 /** Context handler that imports the a:pattFill element. */
60 class PatternFillContext
: public ::oox::core::ContextHandler2
63 explicit PatternFillContext(
64 ::oox::core::ContextHandler2Helper
const & rParent
,
65 const ::oox::AttributeList
& rAttribs
,
66 PatternFillProperties
& rPatternProps
);
68 virtual ::oox::core::ContextHandlerRef
71 const ::oox::AttributeList
& rAttribs
) override
;
74 PatternFillProperties
& mrPatternProps
;
78 /** Context handler that imports a14:imgProps, a14:imgLayer, a14:imgEffect containers
79 and the a14:artistic* effect tags defined in the MS-ODRAWXML extension. */
80 class ArtisticEffectContext
: public ::oox::core::ContextHandler2
83 explicit ArtisticEffectContext(
84 ::oox::core::ContextHandler2Helper
const & rParent
,
85 ArtisticEffectProperties
& rEffect
);
86 virtual ~ArtisticEffectContext() override
;
88 virtual ::oox::core::ContextHandlerRef
91 const ::oox::AttributeList
& rAttribs
) override
;
94 ArtisticEffectProperties
& maEffect
;
98 /** Context handler that imports the a:extLst element inside a:blip and its
99 children a:ext, which can contain transformations to the bitmap. */
100 class BlipExtensionContext
: public ::oox::core::ContextHandler2
103 explicit BlipExtensionContext(
104 ::oox::core::ContextHandler2Helper
const & rParent
,
105 BlipFillProperties
& rBlipProps
);
106 virtual ~BlipExtensionContext() override
;
108 virtual ::oox::core::ContextHandlerRef
111 const ::oox::AttributeList
& rAttribs
) override
;
114 BlipFillProperties
& mrBlipProps
;
118 /** Context handler that imports the a:duotone element containing the colors
119 of a bitmap duotone transformation. */
120 class DuotoneContext
: public ::oox::core::ContextHandler2
123 explicit DuotoneContext(
124 ::oox::core::ContextHandler2Helper
const & rParent
,
125 BlipFillProperties
& rBlipProps
);
126 virtual ~DuotoneContext() override
;
128 virtual ::oox::core::ContextHandlerRef
131 const ::oox::AttributeList
& rAttribs
) override
;
134 BlipFillProperties
& mrBlipProps
;
139 /** Context handler that imports the a:clrChange element containing the colors
140 of a bitmap color change transformation. */
141 class ColorChangeContext
: public ::oox::core::ContextHandler2
144 explicit ColorChangeContext(
145 ::oox::core::ContextHandler2Helper
const & rParent
,
146 const ::oox::AttributeList
& rAttribs
,
147 BlipFillProperties
& rBlipProps
);
148 virtual ~ColorChangeContext() override
;
150 virtual ::oox::core::ContextHandlerRef
153 const ::oox::AttributeList
& rAttribs
) override
;
156 BlipFillProperties
& mrBlipProps
;
160 /** Context handler that imports the a:blip element containing the fill bitmap
161 and bitmap color transformation settings. */
162 class BlipContext
: public ::oox::core::ContextHandler2
165 explicit BlipContext(
166 ::oox::core::ContextHandler2Helper
const & rParent
,
167 const ::oox::AttributeList
& rAttribs
,
168 BlipFillProperties
& rBlipProps
);
170 virtual ::oox::core::ContextHandlerRef
173 const ::oox::AttributeList
& rAttribs
) override
;
176 BlipFillProperties
& mrBlipProps
;
179 /** Context handler that imports the a:blipFill element. */
180 class BlipFillContext
: public ::oox::core::ContextHandler2
183 explicit BlipFillContext(
184 ::oox::core::ContextHandler2Helper
const & rParent
,
185 const ::oox::AttributeList
& rAttribs
,
186 BlipFillProperties
& rBlipProps
);
188 virtual ::oox::core::ContextHandlerRef
191 const ::oox::AttributeList
& rAttribs
) override
;
194 BlipFillProperties
& mrBlipProps
;
197 /** Context handler for elements that contain a fill property element
198 (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill). */
199 class FillPropertiesContext
: public ::oox::core::ContextHandler2
202 explicit FillPropertiesContext(
203 ::oox::core::ContextHandler2Helper
const & rParent
,
204 FillProperties
& rFillProps
);
206 virtual ::oox::core::ContextHandlerRef
209 const ::oox::AttributeList
& rAttribs
) override
;
211 static ::oox::core::ContextHandlerRef
213 ::oox::core::ContextHandler2Helper
const & rParent
,
215 const ::oox::AttributeList
& rAttribs
,
216 FillProperties
& rFillProps
);
219 FillProperties
& mrFillProps
;
222 /** Context handler for elements that contain a fill property element
223 (a:noFill, a:solidFill, a:gradFill, a:pattFill, a:blipFill, a:grpFill).
225 This context handler takes a simple color instead of a fill properties
226 struct. The imported fill properties are converted automatically to the
227 best fitting solid color.
229 class SimpleFillPropertiesContext final
: private FillProperties
, public FillPropertiesContext
232 explicit SimpleFillPropertiesContext(
233 ::oox::core::ContextHandler2Helper
const & rParent
,
235 virtual ~SimpleFillPropertiesContext() override
;
241 } // namespace drawingml
246 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */