Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / xmloff / XMLFontStylesContext.hxx
blobcc6a2a712bb8af1202c6546bce0248d5e083d183
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 .
19 #ifndef INCLUDED_XMLOFF_XMLFONTSTYLESCONTEXT_HXX
20 #define INCLUDED_XMLOFF_XMLFONTSTYLESCONTEXT_HXX
22 #include <sal/config.h>
23 #include <xmloff/dllapi.h>
25 #include <memory>
26 #include <vector>
28 #include <xmloff/xmlstyle.hxx>
30 struct XMLPropertyState;
31 class SvXMLTokenMap;
32 class XMLFontFamilyNamePropHdl;
33 class XMLFontFamilyPropHdl;
34 class XMLFontPitchPropHdl;
35 class XMLFontEncodingPropHdl;
37 class XMLOFF_DLLPUBLIC XMLFontStylesContext : public SvXMLStylesContext
39 std::unique_ptr<XMLFontFamilyNamePropHdl> pFamilyNameHdl;
40 std::unique_ptr<XMLFontFamilyPropHdl> pFamilyHdl;
41 std::unique_ptr<XMLFontPitchPropHdl> pPitchHdl;
42 std::unique_ptr<XMLFontEncodingPropHdl> pEncHdl;
44 std::unique_ptr<SvXMLTokenMap> pFontStyleAttrTokenMap;
46 rtl_TextEncoding eDfltEncoding;
48 protected:
50 virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix,
51 const OUString& rLocalName,
52 const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
54 public:
57 XMLFontStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
58 const OUString& rLName,
59 const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList,
60 rtl_TextEncoding eDfltEnc );
62 ~XMLFontStylesContext() override;
64 const SvXMLTokenMap& GetFontStyleAttrTokenMap() const
66 return *pFontStyleAttrTokenMap;
69 bool FillProperties( const OUString& rName,
70 ::std::vector< XMLPropertyState > &rProps,
71 sal_Int32 nFamilyNameIdx,
72 sal_Int32 nStyleNameIdx,
73 sal_Int32 nFamilyIdx,
74 sal_Int32 nPitchIdx,
75 sal_Int32 nCharsetIdx ) const;
77 rtl_TextEncoding GetDfltCharset() const { return eDfltEncoding; }
79 XMLFontFamilyNamePropHdl& GetFamilyNameHdl() const { return *pFamilyNameHdl; }
80 XMLFontFamilyPropHdl& GetFamilyHdl() const { return *pFamilyHdl; }
81 XMLFontPitchPropHdl& GetPitchHdl() const { return *pPitchHdl; }
82 XMLFontEncodingPropHdl& GetEncodingHdl() const { return *pEncHdl; }
86 #endif
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */