LibreOffice Module xmloff (master) 1
xmlaustp.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_XMLOFF_XMLAUSTP_HXX
21#define INCLUDED_XMLOFF_XMLAUSTP_HXX
22
23#include <sal/config.h>
24#include <xmloff/dllapi.h>
25#include <rtl/ustring.hxx>
27#include <memory>
28#include <vector>
29
33namespace comphelper { class AttributeList; }
34class SvXMLExport;
36struct XMLPropertyState;
37enum class XmlStyleFamily;
38
39namespace com::sun::star::uno {
40 template<typename A> class Sequence;
41}
42
43namespace com::sun::star::uno { template <typename > class Reference; }
44
45namespace com::sun::star::xml::sax { class XDocumentHandler; }
46namespace xmloff { struct AutoStyleEntry; }
47namespace rtl { template <class reference_type> class Reference; }
48
50{
51 friend class Test;
53
54 std::unique_ptr<SvXMLAutoStylePoolP_Impl> m_pImpl;
55
56protected:
57
58 virtual void exportStyleAttributes(
60 XmlStyleFamily nFamily,
61 const ::std::vector< XMLPropertyState >& rProperties,
62 const SvXMLExportPropertyMapper& rPropExp,
63 const SvXMLUnitConverter& rUnitConverter,
64 const SvXMLNamespaceMap& rNamespaceMap
65 ) const;
66
67// this method is executed after Properties Export, so you can e.g. export a map or so on
68 virtual void exportStyleContent(
69 const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler,
70 XmlStyleFamily nFamily,
71 const ::std::vector< XMLPropertyState >& rProperties,
72 const SvXMLExportPropertyMapper& rPropExp,
73 const SvXMLUnitConverter& rUnitConverter,
74 const SvXMLNamespaceMap& rNamespaceMap
75 ) const;
76
77
78public:
79
81
82 virtual ~SvXMLAutoStylePoolP() override;
83
84 SvXMLExport& GetExport() const;
85
89 // TODO: Remove this ugly method as soon as possible
90 void AddFamily( XmlStyleFamily nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, const OUString& aStrPrefix );
91 void AddFamily( XmlStyleFamily nFamily, const OUString& rStrName,
93 const OUString& rStrPrefix, bool bAsFamily = true );
96
98 void RegisterName( XmlStyleFamily nFamily, const OUString& rName );
99
101 void RegisterDefinedName(XmlStyleFamily nFamily, const OUString& rName);
102
105 css::uno::Sequence<sal_Int32>& aFamilies,
106 css::uno::Sequence<OUString>& aNames );
107
109 void RegisterNames(
110 css::uno::Sequence<sal_Int32> const & aFamilies,
111 css::uno::Sequence<OUString> const & aNames );
112
114 OUString Add( XmlStyleFamily nFamily, ::std::vector< XMLPropertyState >&& rProperties );
115 OUString Add( XmlStyleFamily nFamily, const OUString& rParent, ::std::vector< XMLPropertyState >&& rProperties, bool bDontSeek = false );
116 bool Add( OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, ::std::vector< XMLPropertyState >&& rProperties );
117
119 bool AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParent,
120 std::vector< XMLPropertyState > aProperties );
121
123 OUString Find( XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const;
124
126 void exportXML( XmlStyleFamily nFamily ) const;
127
128 void ClearEntries();
129
130 std::vector<xmloff::AutoStyleEntry> GetAutoStyleEntries() const;
131};
132
133#endif // INCLUDED_XMLOFF_XMLAUSTP_HXX
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void RegisterDefinedName(XmlStyleFamily nFamily, const OUString &rName)
Definition: impastpl.cxx:395
OUString Find(XmlStyleFamily nFamily, const OUString &rParent, const ::std::vector< XMLPropertyState > &rProperties) const
Definition: impastpl.cxx:491
void AddFamily(XmlStyleFamily nFamily, const OUString &rStrName, const rtl::Reference< SvXMLExportPropertyMapper > &rMapper, const OUString &rStrPrefix, bool bAsFamily)
Definition: impastpl.cxx:340
void SetFamilyPropSetMapper(XmlStyleFamily nFamily, const rtl::Reference< SvXMLExportPropertyMapper > &rMapper)
Definition: impastpl.cxx:375
SvXMLExport & rExport
Definition: impastpl.hxx:133
bool AddNamed(const OUString &rName, XmlStyleFamily nFamily, const OUString &rParentName, std::vector< XMLPropertyState > &&rProperties)
Definition: impastpl.cxx:462
SvXMLExport & GetExport() const
Definition: impastpl.hxx:141
void GetRegisteredNames(css::uno::Sequence< sal_Int32 > &aFamilies, css::uno::Sequence< OUString > &aNames)
Definition: impastpl.cxx:407
bool Add(OUString &rName, XmlStyleFamily nFamily, const OUString &rParentName, std::vector< XMLPropertyState > &&rProperties, bool bDontSeek=false)
Definition: impastpl.cxx:439
std::vector< xmloff::AutoStyleEntry > GetAutoStyleEntries() const
Definition: impastpl.cxx:512
void RegisterName(XmlStyleFamily nFamily, const OUString &rName)
Definition: impastpl.cxx:386
std::unique_ptr< SvXMLAutoStylePoolP_Impl > m_pImpl
Definition: xmlaustp.hxx:54
OUString Add(XmlStyleFamily nFamily, ::std::vector< XMLPropertyState > &&rProperties)
Add an item set to the pool and return its generated name.
OUString Add(XmlStyleFamily nFamily, const OUString &rParent, ::std::vector< XMLPropertyState > &&rProperties, bool bDontSeek=false)
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:83
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29
XmlStyleFamily
Definition: families.hxx:50
XMLOFF_DLLPUBLIC void exportXML(OUString const &rStrName, css::uno::Any const &rValue, SvXMLExport &rExport)
Reference
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:140