update credits
[LibreOffice.git] / xmloff / inc / xmlversion.hxx
blob95ff607683c2bb6dcfa2eddc77a2c726d098cb0e
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 _XMLOFF_XMLVERSION_HXX
20 #define _XMLOFF_XMLVERSION_HXX
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>
27 #include <cppuhelper/implbase1.hxx>
28 #include <xmloff/xmlictxt.hxx>
29 #include <xmloff/xmlexp.hxx>
30 #include <xmloff/xmlimp.hxx>
31 #include <xmloff/nmspmap.hxx>
32 #include <xmloff/xmlnmspe.hxx>
33 #include <xmloff/xmltoken.hxx>
35 // ------------------------------------------------------------------------
36 class XMLVersionListExport : public SvXMLExport
38 private:
39 const com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& maVersions;
40 public:
41 XMLVersionListExport(
42 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
43 const com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& rVersions,
44 const OUString &rFileName,
45 com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > &rHandler );
46 virtual ~XMLVersionListExport() {}
48 sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass );
49 void _ExportAutoStyles() {}
50 void _ExportMasterStyles () {}
51 void _ExportContent() {}
54 // ------------------------------------------------------------------------
55 class XMLVersionListImport : public SvXMLImport
57 private:
58 com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& maVersions;
60 protected:
62 // This method is called after the namespace map has been updated, but
63 // before a context for the current element has been pushed.
64 virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
65 const OUString& rLocalName,
66 const ::com::sun::star::uno::Reference<
67 ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
69 public:
71 XMLVersionListImport(
72 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
73 com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& rVersions );
74 ~XMLVersionListImport() throw();
76 com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >&
77 GetList() { return maVersions; }
80 // ------------------------------------------------------------------------
81 class XMLVersionListContext : public SvXMLImportContext
83 private:
84 XMLVersionListImport & rLocalRef;
86 public:
88 XMLVersionListContext( XMLVersionListImport& rImport,
89 sal_uInt16 nPrefix,
90 const OUString& rLocalName,
91 const ::com::sun::star::uno::Reference<
92 ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
94 ~XMLVersionListContext();
96 virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
97 const OUString& rLocalName,
98 const ::com::sun::star::uno::Reference<
99 ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
103 // ------------------------------------------------------------------------
104 class XMLVersionContext: public SvXMLImportContext
106 private:
107 XMLVersionListImport& rLocalRef;
109 static sal_Bool ParseISODateTimeString(
110 const OUString& rString,
111 com::sun::star::util::DateTime& rDateTime );
113 public:
115 XMLVersionContext( XMLVersionListImport& rImport,
116 sal_uInt16 nPrefix,
117 const OUString& rLocalName,
118 const ::com::sun::star::uno::Reference<
119 ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
121 ~XMLVersionContext();
125 // ------------------------------------------------------------------------
126 class XMLVersionListPersistence : public ::cppu::WeakImplHelper1< ::com::sun::star::document::XDocumentRevisionListPersistence >
128 public:
129 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::RevisionTag > SAL_CALL load( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
130 virtual void SAL_CALL store( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage, const ::com::sun::star::uno::Sequence< ::com::sun::star::util::RevisionTag >& List ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
133 ::com::sun::star::uno::Sequence< OUString > SAL_CALL
134 XMLVersionListPersistence_getSupportedServiceNames()
135 throw();
137 OUString SAL_CALL XMLVersionPersistence_getImplementationName()
138 throw();
140 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
141 XMLVersionListPersistence_createInstance(
142 const ::com::sun::star::uno::Reference<
143 ::com::sun::star::lang::XMultiServiceFactory > & )
144 throw( ::com::sun::star::uno::Exception );
146 #endif
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */