LibreOffice Module xmloff (master)  1
xmlversion.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 #ifndef INCLUDED_XMLOFF_INC_XMLVERSION_HXX
20 #define INCLUDED_XMLOFF_INC_XMLVERSION_HXX
21 
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <com/sun/star/document/XDocumentRevisionListPersistence.hpp>
24 #include <com/sun/star/util/RevisionTag.hpp>
25 #include <com/sun/star/embed/XStorage.hpp>
26 
27 #include <cppuhelper/implbase.hxx>
28 #include <xmloff/xmlictxt.hxx>
29 #include <xmloff/xmlexp.hxx>
30 #include <xmloff/xmlimp.hxx>
31 #include <xmloff/xmltoken.hxx>
32 
33 class XMLVersionListExport final : public SvXMLExport
34 {
35 private:
36  const css::uno::Sequence < css::util::RevisionTag >& maVersions;
37 public:
39  const css::uno::Reference< css::uno::XComponentContext >& rContext,
40  const css::uno::Sequence < css::util::RevisionTag >& rVersions,
41  const OUString &rFileName,
42  css::uno::Reference< css::xml::sax::XDocumentHandler > const &rHandler );
43 
45  void ExportAutoStyles_() override {}
46  void ExportMasterStyles_ () override {}
47  void ExportContent_() override {}
48 };
49 
50 class XMLVersionListImport final : public SvXMLImport
51 {
52 private:
53  css::uno::Sequence < css::util::RevisionTag >& maVersions;
54 
55  virtual SvXMLImportContext *CreateFastContext( sal_Int32 Element,
56  const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList ) override;
57 
58 public:
59 
61  const css::uno::Reference< css::uno::XComponentContext >& rContext,
62  css::uno::Sequence < css::util::RevisionTag >& rVersions );
63  virtual ~XMLVersionListImport() throw() override;
64 
65  css::uno::Sequence < css::util::RevisionTag >&
66  GetList() { return maVersions; }
67 };
68 
70 {
71 private:
73 
74 public:
75 
77 
78  virtual ~XMLVersionListContext() override;
79 
80  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
81  createFastChildContext(sal_Int32 nElement,
82  const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttribs) override;
83 };
84 
86 {
87 private:
88  static bool ParseISODateTimeString(
89  const OUString& rString,
90  css::util::DateTime& rDateTime );
91 
92 public:
93 
95  const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList );
96 
97  virtual ~XMLVersionContext() override;
98 };
99 
100 class XMLVersionListPersistence final : public ::cppu::WeakImplHelper< css::document::XDocumentRevisionListPersistence, css::lang::XServiceInfo >
101 {
102 public:
103  virtual css::uno::Sequence< css::util::RevisionTag > SAL_CALL load( const css::uno::Reference< css::embed::XStorage >& Storage ) override;
104  virtual void SAL_CALL store( const css::uno::Reference< css::embed::XStorage >& Storage, const css::uno::Sequence< css::util::RevisionTag >& List ) override;
105 
106  OUString SAL_CALL getImplementationName() override;
107 
108  sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
109 
110  css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
111 };
112 
113 #endif
114 
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void ExportContent_() override
Override this method to export the content of .
Definition: xmlversion.hxx:47
XMLVersionListImport(const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Sequence< css::util::RevisionTag > &rVersions)
Definition: xmlversion.cxx:103
static bool ParseISODateTimeString(const OUString &rString, css::util::DateTime &rDateTime)
Definition: xmlversion.cxx:203
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
XMLVersionListExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, const css::uno::Sequence< css::util::RevisionTag > &rVersions, const OUString &rFileName, css::uno::Reference< css::xml::sax::XDocumentHandler > const &rHandler)
Definition: xmlversion.cxx:45
XMLVersionContext(XMLVersionListImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlversion.cxx:150
void ExportAutoStyles_() override
Override this method to export the contents of .
Definition: xmlversion.hxx:45
OUString SAL_CALL getImplementationName() override
Definition: xmlversion.cxx:401
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:49
ErrCode exportDoc(enum::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
Definition: xmlversion.cxx:59
css::uno::Sequence< css::util::RevisionTag > & GetList()
Definition: xmlversion.hxx:66
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttribs) override
Definition: xmlversion.cxx:136
virtual ~XMLVersionContext() override
Definition: xmlversion.cxx:200
unsigned char sal_Bool
XMLVersionListImport & GetImport()
Definition: xmlversion.hxx:72
css::uno::Sequence< css::util::RevisionTag > & maVersions
Definition: xmlversion.hxx:53
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:45
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: xmlversion.cxx:413
virtual void SAL_CALL store(const css::uno::Reference< css::embed::XStorage > &Storage, const css::uno::Sequence< css::util::RevisionTag > &List) override
Definition: xmlversion.cxx:302
const css::uno::Sequence< css::util::RevisionTag > & maVersions
Definition: xmlversion.hxx:36
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
Definition: xmlversion.cxx:406
virtual SvXMLImportContext * CreateFastContext(sal_Int32 Element, const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlversion.cxx:114
void ExportMasterStyles_() override
Override this method to export the contents of .
Definition: xmlversion.hxx:46
virtual css::uno::Sequence< css::util::RevisionTag > SAL_CALL load(const css::uno::Reference< css::embed::XStorage > &Storage) override
Definition: xmlversion.cxx:344
virtual ~XMLVersionListImport() override
Definition: xmlversion.cxx:111
virtual ~XMLVersionListContext() override
Definition: xmlversion.cxx:132
XMLVersionListContext(XMLVersionListImport &rImport)
Definition: xmlversion.cxx:127