LibreOffice Module xmloff (master)  1
xmlmetae.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_XMLMETAE_HXX
21 #define INCLUDED_XMLOFF_XMLMETAE_HXX
22 
23 #include <sal/config.h>
24 #include <sal/types.h>
25 
26 #include <cppuhelper/implbase.hxx>
27 #include <xmloff/xmltoken.hxx>
28 
29 #include <vector>
30 
31 #include <com/sun/star/beans/StringPair.hpp>
32 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
33 
34 namespace com::sun::star::document { class XDocumentProperties; }
35 namespace com::sun::star::util { struct DateTime; }
36 
37 
38 class SvXMLExport;
39 
49 class SvXMLMetaExport final : public cppu::WeakImplHelper<
50  css::xml::sax::XDocumentHandler >
51 {
52 private:
54  css::uno::Reference< css::document::XDocumentProperties> mxDocProps;
56  int m_level;
58  std::vector< css::beans::StringPair > m_preservedNSs;
59 
61  const OUString& rText, sal_uInt16 nNamespace,
64  const css::util::DateTime & rDate, sal_uInt16 nNamespace,
66 
68  void MExport_();
69 
70 public:
71  SvXMLMetaExport( SvXMLExport& i_rExport,
72  const css::uno::Reference< css::document::XDocumentProperties>& i_rDocProps);
73 
74  virtual ~SvXMLMetaExport() override;
75 
77  void Export();
78 
79  static OUString GetISODateTimeString(
80  const css::util::DateTime& rDateTime );
81 
82  // css::xml::sax::XDocumentHandler:
83  virtual void SAL_CALL startDocument() override;
84  virtual void SAL_CALL endDocument() override;
85  virtual void SAL_CALL startElement(const OUString & i_rName,
86  const css::uno::Reference<
87  css::xml::sax::XAttributeList > & i_xAttribs) override;
88  virtual void SAL_CALL endElement(const OUString & i_rName) override;
89  virtual void SAL_CALL characters(const OUString & i_rChars) override;
90  virtual void SAL_CALL ignorableWhitespace(
91  const OUString & i_rWhitespaces) override;
92  virtual void SAL_CALL processingInstruction(
93  const OUString & i_rTarget, const OUString & i_rData) override;
94  virtual void SAL_CALL setDocumentLocator(
95  const css::uno::Reference<
96  css::xml::sax::XLocator > & i_xLocator) override;
97 
98 };
99 
100 #endif // INCLUDED_XMLOFF_XMLMETAE_HXX
101 
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL startDocument() override
Definition: xmlmetae.cxx:348
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &i_xLocator) override
Definition: xmlmetae.cxx:475
void MExport_()
currently unused; for exporting via the XDocumentProperties interface
Definition: xmlmetae.cxx:95
void Export()
export via XSAXWriter interface, with fallback to _MExport
Definition: xmlmetae.cxx:317
void SimpleStringElement(const OUString &rText, sal_uInt16 nNamespace, enum::xmloff::token::XMLTokenEnum eElementName)
Definition: xmlmetae.cxx:72
virtual void SAL_CALL characters(const OUString &i_rChars) override
Definition: xmlmetae.cxx:456
void SimpleDateTimeElement(const css::util::DateTime &rDate, sal_uInt16 nNamespace, enum::xmloff::token::XMLTokenEnum eElementName)
Definition: xmlmetae.cxx:82
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
SvXMLExport & mrExport
Definition: xmlmetae.hxx:53
SvXMLMetaExport(SvXMLExport &i_rExport, const css::uno::Reference< css::document::XDocumentProperties > &i_rDocProps)
Definition: xmlmetae.cxx:302
virtual void SAL_CALL processingInstruction(const OUString &i_rTarget, const OUString &i_rData) override
Definition: xmlmetae.cxx:468
virtual ~SvXMLMetaExport() override
Definition: xmlmetae.cxx:313
export meta data from an XDocumentProperties instance.
Definition: xmlmetae.hxx:49
virtual void SAL_CALL ignorableWhitespace(const OUString &i_rWhitespaces) override
Definition: xmlmetae.cxx:462
int m_level
counts levels of the xml document. necessary for special handling.
Definition: xmlmetae.hxx:56
std::vector< css::beans::StringPair > m_preservedNSs
preserved namespaces. necessary because we do not write the root node.
Definition: xmlmetae.hxx:58
css::uno::Reference< css::document::XDocumentProperties > mxDocProps
Definition: xmlmetae.hxx:54
virtual void SAL_CALL endElement(const OUString &i_rName) override
Definition: xmlmetae.cxx:444
static OUString GetISODateTimeString(const css::util::DateTime &rDateTime)
Definition: xmlmetae.cxx:52
virtual void SAL_CALL endDocument() override
Definition: xmlmetae.cxx:355
virtual void SAL_CALL startElement(const OUString &i_rName, const css::uno::Reference< css::xml::sax::XAttributeList > &i_xAttribs) override
Definition: xmlmetae.cxx:363