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 .
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
{
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
);
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
,
64 sal_Int32 nCharsetIdx
) const;
66 OUString
familyName() const;
68 SvXMLImportContext
* CreateChildContext(
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
;
82 XMLFontStyleContextFontFaceSrc( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
83 const OUString
& rLName
,
84 const XMLFontStyleContextFontFace
& font
);
86 virtual SvXMLImportContext
* CreateChildContext(
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
;
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
);
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(
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
;
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
;
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */