bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / style / XMLFontStylesContext_impl.hxx
bloba1cfc1161c9eb9c197515ba00c7e24ce560642ff
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 #ifndef INCLUDED_XMLOFF_SOURCE_STYLE_XMLFONTSTYLESCONTEXT_IMPL_HXX
21 #define INCLUDED_XMLOFF_SOURCE_STYLE_XMLFONTSTYLESCONTEXT_IMPL_HXX
23 #include <xmloff/xmlstyle.hxx>
25 namespace com { namespace sun { namespace star { namespace io {
26 class XOutputStream;
27 } } } }
29 /// Handles <style:font-face>
30 class XMLFontStyleContextFontFace : public SvXMLStyleContext
32 ::com::sun::star::uno::Any aFamilyName;
33 ::com::sun::star::uno::Any aStyleName;
34 ::com::sun::star::uno::Any aFamily;
35 ::com::sun::star::uno::Any aPitch;
36 ::com::sun::star::uno::Any aEnc;
38 SvXMLImportContextRef xStyles;
40 XMLFontStylesContext *GetStyles()
42 return static_cast<XMLFontStylesContext *>(&xStyles);
45 public:
47 TYPEINFO_OVERRIDE();
49 XMLFontStyleContextFontFace( SvXMLImport& rImport, sal_uInt16 nPrfx,
50 const OUString& rLName,
51 const ::com::sun::star::uno::Reference<
52 ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
53 XMLFontStylesContext& rStyles );
54 virtual ~XMLFontStyleContextFontFace();
56 void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName,
57 const OUString& rValue ) SAL_OVERRIDE;
59 void FillProperties( ::std::vector< XMLPropertyState > &rProps,
60 sal_Int32 nFamilyNameIdx,
61 sal_Int32 nStyleNameIdx,
62 sal_Int32 nFamilyIdx,
63 sal_Int32 nPitchIdx,
64 sal_Int32 nCharsetIdx ) const;
66 OUString familyName() const;
68 SvXMLImportContext * CreateChildContext(
69 sal_uInt16 nPrefix,
70 const OUString& rLocalName,
71 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
74 /// Handles <style:font-face-src>
75 class XMLFontStyleContextFontFaceSrc : public SvXMLImportContext
77 const XMLFontStyleContextFontFace& font;
78 public:
80 TYPEINFO_OVERRIDE();
82 XMLFontStyleContextFontFaceSrc( SvXMLImport& rImport, sal_uInt16 nPrfx,
83 const OUString& rLName,
84 const XMLFontStyleContextFontFace& font );
86 virtual SvXMLImportContext * CreateChildContext(
87 sal_uInt16 nPrefix,
88 const OUString& rLocalName,
89 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
92 /// Handles <style:font-face-uri>
93 class XMLFontStyleContextFontFaceUri : public SvXMLStyleContext
95 const XMLFontStyleContextFontFace& font;
96 OUString format;
97 OUString linkPath;
98 ::css::uno::Sequence< sal_Int8 > maFontData;
99 ::css::uno::Reference< ::css::io::XOutputStream > mxBase64Stream;
101 void handleEmbeddedFont( const OUString& url, bool eot );
102 void handleEmbeddedFont( const ::css::uno::Sequence< sal_Int8 >& rData, bool eot );
103 public:
105 TYPEINFO_OVERRIDE();
107 XMLFontStyleContextFontFaceUri( SvXMLImport& rImport, sal_uInt16 nPrfx,
108 const OUString& rLName,
109 const ::com::sun::star::uno::Reference<
110 ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
111 const XMLFontStyleContextFontFace& font );
113 virtual void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName,
114 const OUString& rValue ) SAL_OVERRIDE;
115 void SetFormat( const OUString& rFormat );
116 void EndElement() SAL_OVERRIDE;
117 SvXMLImportContext * CreateChildContext(
118 sal_uInt16 nPrefix,
119 const OUString& rLocalName,
120 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ) SAL_OVERRIDE;
123 /// Handles <svg:font-face-format>
124 class XMLFontStyleContextFontFaceFormat : public SvXMLStyleContext
126 XMLFontStyleContextFontFaceUri& uri;
127 public:
128 TYPEINFO_OVERRIDE();
130 XMLFontStyleContextFontFaceFormat( SvXMLImport& rImport, sal_uInt16 nPrfx,
131 const OUString& rLName,
132 const ::com::sun::star::uno::Reference<
133 ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
134 XMLFontStyleContextFontFaceUri& uri );
136 void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName,
137 const OUString& rValue ) SAL_OVERRIDE;
140 #endif
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */