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>
23 #include <xmloff/XMLFontStylesContext.hxx>
25 namespace com::sun::star::io
{
29 /// Handles <style:font-face>
30 class XMLFontStyleContextFontFace
: public SvXMLStyleContext
32 css::uno::Any aFamilyName
;
33 css::uno::Any aStyleName
;
34 css::uno::Any aFamily
;
38 rtl::Reference
<XMLFontStylesContext
> xStyles
;
40 XMLFontStylesContext
*GetStyles()
48 XMLFontStyleContextFontFace( SvXMLImport
& rImport
,
49 XMLFontStylesContext
& rStyles
);
50 virtual ~XMLFontStyleContextFontFace() override
;
52 void SetAttribute( sal_Int32 nElement
,
53 const OUString
& rValue
) override
;
55 void FillProperties( ::std::vector
< XMLPropertyState
> &rProps
,
56 sal_Int32 nFamilyNameIdx
,
57 sal_Int32 nStyleNameIdx
,
60 sal_Int32 nCharsetIdx
) const;
62 OUString
familyName() const;
64 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
66 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
) override
;
69 /// Handles <style:font-face-src>
70 class XMLFontStyleContextFontFaceSrc
: public SvXMLImportContext
72 const XMLFontStyleContextFontFace
& font
;
76 XMLFontStyleContextFontFaceSrc( SvXMLImport
& rImport
,
77 const XMLFontStyleContextFontFace
& font
);
79 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
81 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
) override
;
84 /// Handles <style:font-face-uri>
85 class XMLFontStyleContextFontFaceUri
: public SvXMLStyleContext
87 const XMLFontStyleContextFontFace
& font
;
90 ::css::uno::Sequence
< sal_Int8
> maFontData
;
91 ::css::uno::Reference
< ::css::io::XOutputStream
> mxBase64Stream
;
93 void handleEmbeddedFont( const OUString
& url
, bool eot
);
94 void handleEmbeddedFont( const ::css::uno::Sequence
< sal_Int8
>& rData
, bool eot
);
98 XMLFontStyleContextFontFaceUri( SvXMLImport
& rImport
,
99 const XMLFontStyleContextFontFace
& font
);
101 virtual void SetAttribute( sal_Int32 nElement
,
102 const OUString
& rValue
) override
;
103 void SetFormat( const OUString
& rFormat
);
104 void SAL_CALL
endFastElement(sal_Int32 nElement
) override
;
105 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
107 const css::uno::Reference
< css::xml::sax::XFastAttributeList
> & xAttrList
) override
;
110 /// Handles <svg:font-face-format>
111 class XMLFontStyleContextFontFaceFormat
: public SvXMLStyleContext
113 XMLFontStyleContextFontFaceUri
& uri
;
116 XMLFontStyleContextFontFaceFormat( SvXMLImport
& rImport
,
117 XMLFontStyleContextFontFaceUri
& uri
);
119 void SetAttribute( sal_Int32 nElement
,
120 const OUString
& rValue
) override
;
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */