1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
39 const com::sun::star::uno::Sequence
< com::sun::star::util::RevisionTag
>& maVersions
;
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
58 com::sun::star::uno::Sequence
< com::sun::star::util::RevisionTag
>& maVersions
;
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
);
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
84 XMLVersionListImport
& rLocalRef
;
88 XMLVersionListContext( XMLVersionListImport
& rImport
,
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
107 XMLVersionListImport
& rLocalRef
;
109 static sal_Bool
ParseISODateTimeString(
110 const OUString
& rString
,
111 com::sun::star::util::DateTime
& rDateTime
);
115 XMLVersionContext( XMLVersionListImport
& rImport
,
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
>
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()
137 OUString SAL_CALL
XMLVersionPersistence_getImplementationName()
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
);
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */