Version 24.2.2.2, tag libreoffice-24.2.2.2
[LibreOffice.git] / xmloff / source / style / XMLFontStylesContext_impl.hxx
blobb86bedbd1203375a9cd5296a2ff3129527350d62
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <xmloff/xmlstyle.hxx>
24 namespace com::sun::star::io {
25 class XOutputStream;
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;
34 css::uno::Any aPitch;
35 css::uno::Any aEnc;
37 rtl::Reference<XMLFontStylesContext> xStyles;
39 XMLFontStylesContext *GetStyles()
41 return xStyles.get();
44 public:
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,
57 sal_Int32 nFamilyIdx,
58 sal_Int32 nPitchIdx,
59 sal_Int32 nCharsetIdx ) const;
61 OUString familyName() const;
63 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
64 sal_Int32 nElement,
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;
72 public:
75 XMLFontStyleContextFontFaceSrc( SvXMLImport& rImport,
76 const XMLFontStyleContextFontFace& font );
78 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
79 sal_Int32 nElement,
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;
87 OUString format;
88 OUString linkPath;
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 );
94 public:
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(
105 sal_Int32 nElement,
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;
113 public:
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: */