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 
31 class SvXMLNamespaceMap;
33 class SvXMLAttributeList;
34 class SvXMLExport;
35 class SvXMLUnitConverter;
36 struct XMLPropertyState;
37 enum class XmlStyleFamily;
38 
39 namespace com::sun::star::uno {
40  template<typename A> class Sequence;
41 }
42 
43 namespace com::sun::star::uno { template <typename > class Reference; }
44 
45 namespace com::sun::star::xml::sax { class XDocumentHandler; }
46 namespace xmloff { struct AutoStyleEntry; }
47 namespace rtl { template <class reference_type> class Reference; }
48 
50 {
51  friend class Test;
53 
54  std::unique_ptr<SvXMLAutoStylePoolP_Impl> pImpl;
55 
56 protected:
57 
58  virtual void exportStyleAttributes(
59  SvXMLAttributeList& rAttrList,
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 
78 public:
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 
104  void GetRegisteredNames(
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, const ::std::vector< XMLPropertyState >& rProperties );
115  OUString Add( XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek = false );
116  bool Add( OUString& rName, XmlStyleFamily nFamily, const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties );
117 
119  bool AddNamed( const OUString& rName, XmlStyleFamily nFamily, const OUString& rParent,
120  const ::std::vector< XMLPropertyState >& rProperties );
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: */
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:77
SvXMLExport & GetExport() const
Definition: impastpl.hxx:146
std::vector< xmloff::AutoStyleEntry > GetAutoStyleEntries() const
Definition: impastpl.cxx:529
Reference
OUString Find(XmlStyleFamily nFamily, const OUString &rParent, const ::std::vector< XMLPropertyState > &rProperties) const
Definition: impastpl.cxx:508
void exportXML(XmlStyleFamily nFamily, const SvXMLAutoStylePoolP *pAntiImpl) const
Definition: impastpl.cxx:577
std::unique_ptr< SvXMLAutoStylePoolP_Impl > pImpl
Definition: xmlaustp.hxx:54
XmlStyleFamily
Definition: families.hxx:47
void GetRegisteredNames(css::uno::Sequence< sal_Int32 > &aFamilies, css::uno::Sequence< OUString > &aNames)
Definition: impastpl.cxx:420
bool AddNamed(const OUString &rName, XmlStyleFamily nFamily, const OUString &rParentName, const ::std::vector< XMLPropertyState > &rProperties)
Definition: impastpl.cxx:478
bool Add(OUString &rName, XmlStyleFamily nFamily, const OUString &rParentName, const ::std::vector< XMLPropertyState > &rProperties, bool bDontSeek=false)
Definition: impastpl.cxx:454
void AddFamily(XmlStyleFamily nFamily, const OUString &rStrName, const rtl::Reference< SvXMLExportPropertyMapper > &rMapper, const OUString &rStrPrefix, bool bAsFamily)
Definition: impastpl.cxx:352
void RegisterDefinedName(XmlStyleFamily nFamily, const OUString &rName)
Definition: impastpl.cxx:408
void RegisterName(XmlStyleFamily nFamily, const OUString &rName)
Definition: impastpl.cxx:398
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
void SetFamilyPropSetMapper(XmlStyleFamily nFamily, const rtl::Reference< SvXMLExportPropertyMapper > &rMapper)
Definition: impastpl.cxx:387
css::uno::Any const SvXMLExport & rExport
Definition: ImageStyle.hxx:38
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29