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 <xmloff/xmlstyle.hxx>
24 namespace com::sun::star::io
{
28 /// Handles <style:font-face>
29 class XMLFontStyleContextFontFace
: public SvXMLStyleContext
31 css::uno::Any aFamilyName
;
32 css::uno::Any aStyleName
;
33 css::uno::Any aFamily
;
37 rtl::Reference
<XMLFontStylesContext
> xStyles
;
39 XMLFontStylesContext
*GetStyles()
47 XMLFontStyleContextFontFace( SvXMLImport
& rImport
,
48 XMLFontStylesContext
& rStyles
);
49 virtual ~XMLFontStyleContextFontFace() override
;
51 void SetAttribute( sal_Int32 nElement
,
52 const OUString
& rValue
) override
;
54 void FillProperties( ::std::vector
< XMLPropertyState
> &rProps
,
55 sal_Int32 nFamilyNameIdx
,
56 sal_Int32 nStyleNameIdx
,
59 sal_Int32 nCharsetIdx
) const;
61 OUString
familyName() const;
63 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
65 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
) override
;
68 /// Handles <style:font-face-src>
69 class XMLFontStyleContextFontFaceSrc
: public SvXMLImportContext
71 const XMLFontStyleContextFontFace
& font
;
75 XMLFontStyleContextFontFaceSrc( SvXMLImport
& rImport
,
76 const XMLFontStyleContextFontFace
& font
);
78 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
80 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
) override
;
83 /// Handles <style:font-face-uri>
84 class XMLFontStyleContextFontFaceUri
: public SvXMLStyleContext
86 const XMLFontStyleContextFontFace
& font
;
89 ::css::uno::Sequence
< sal_Int8
> maFontData
;
90 ::css::uno::Reference
< ::css::io::XOutputStream
> mxBase64Stream
;
92 void handleEmbeddedFont( const OUString
& url
, bool eot
);
93 void handleEmbeddedFont( const ::css::uno::Sequence
< sal_Int8
>& rData
, bool eot
);
97 XMLFontStyleContextFontFaceUri( SvXMLImport
& rImport
,
98 const XMLFontStyleContextFontFace
& font
);
100 virtual void SetAttribute( sal_Int32 nElement
,
101 const OUString
& rValue
) override
;
102 void SetFormat( const OUString
& rFormat
);
103 void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
104 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
106 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
) override
;
109 /// Handles <svg:font-face-format>
110 class XMLFontStyleContextFontFaceFormat
: public SvXMLStyleContext
112 XMLFontStyleContextFontFaceUri
& uri
;
115 XMLFontStyleContextFontFaceFormat( SvXMLImport
& rImport
,
116 XMLFontStyleContextFontFaceUri
& uri
);
118 void SetAttribute( sal_Int32 nElement
,
119 const OUString
& rValue
) override
;
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */