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 .
22 #include <com/sun/star/awt/ColorStop.hpp>
23 #include <com/sun/star/io/XOutputStream.hpp>
24 #include <xmloff/xmlstyle.hxx>
25 #include <rtl/ustring.hxx>
26 #include <sal/types.h>
30 // draw:gradient context
32 class XMLGradientStyleContext
: public SvXMLStyleContext
37 std::vector
<css::awt::ColorStop
> maColorStopVec
;
41 XMLGradientStyleContext( SvXMLImport
& rImport
, sal_Int32 nElement
,
42 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
);
43 virtual ~XMLGradientStyleContext() override
;
45 virtual css::uno::Reference
<css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
47 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& AttrList
) override
;
49 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
51 virtual bool IsTransient() const override
;
56 class XMLHatchStyleContext
: public SvXMLStyleContext
64 XMLHatchStyleContext( SvXMLImport
& rImport
, sal_Int32 nElement
,
65 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
);
66 virtual ~XMLHatchStyleContext() override
;
68 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
70 virtual bool IsTransient() const override
;
73 // draw:fill-image context
75 class XMLBitmapStyleContext
: public SvXMLStyleContext
80 css::uno::Reference
< css::io::XOutputStream
> mxBase64Stream
;
84 XMLBitmapStyleContext( SvXMLImport
& rImport
, sal_Int32 nElement
,
85 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
);
86 virtual ~XMLBitmapStyleContext() override
;
88 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
89 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& AttrList
) override
;
91 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
93 virtual bool IsTransient() const override
;
96 // draw:transparency context
98 class XMLTransGradientStyleContext
: public SvXMLStyleContext
103 std::vector
<css::awt::ColorStop
> maColorStopVec
; // Transparency is handled as color gray.
107 XMLTransGradientStyleContext( SvXMLImport
& rImport
, sal_Int32 nElement
,
108 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
);
109 virtual ~XMLTransGradientStyleContext() override
;
111 virtual css::uno::Reference
<css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
113 const css::uno::Reference
<css::xml::sax::XFastAttributeList
>& AttrList
) override
;
115 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
117 virtual bool IsTransient() const override
;
120 class XMLTransparencyStopContext
: public SvXMLStyleContext
126 XMLTransparencyStopContext(SvXMLImport
& rImport
, sal_Int32 nElement
,
127 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
,
128 std::vector
<css::awt::ColorStop
>& rColorStopVec
);
129 virtual ~XMLTransparencyStopContext() override
;
132 // draw:marker context
134 class XMLMarkerStyleContext
: public SvXMLStyleContext
142 XMLMarkerStyleContext( SvXMLImport
& rImport
, sal_Int32 nElement
,
143 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
);
144 virtual ~XMLMarkerStyleContext() override
;
146 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
148 virtual bool IsTransient() const override
;
151 // draw:marker context
153 class XMLDashStyleContext
: public SvXMLStyleContext
161 XMLDashStyleContext( SvXMLImport
& rImport
, sal_Int32 nElement
,
162 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
);
163 virtual ~XMLDashStyleContext() override
;
165 virtual void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
167 virtual bool IsTransient() const override
;
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */