Branch data Line data Source code
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 _XMLOFF_XMLVERSION_HXX
20 : : #define _XMLOFF_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/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>
34 : :
35 : : // ------------------------------------------------------------------------
36 : : class XMLVersionListExport : public SvXMLExport
37 : : {
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::lang::XMultiServiceFactory > xServiceFactory,
43 : : const com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& rVersions,
44 : : const rtl::OUString &rFileName,
45 : : com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > &rHandler );
46 [ # # ]: 0 : virtual ~XMLVersionListExport() {}
47 : :
48 : : sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass );
49 : 0 : void _ExportAutoStyles() {}
50 : 0 : void _ExportMasterStyles () {}
51 : 0 : void _ExportContent() {}
52 : : };
53 : :
54 : : // ------------------------------------------------------------------------
55 : : class XMLVersionListImport : public SvXMLImport
56 : : {
57 : : private:
58 : : com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& maVersions;
59 : :
60 : : protected:
61 : :
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 ::rtl::OUString& rLocalName,
66 : : const ::com::sun::star::uno::Reference<
67 : : ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
68 : :
69 : : public:
70 : :
71 : : // #110897#
72 : : XMLVersionListImport(
73 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
74 : : com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& rVersions );
75 : : ~XMLVersionListImport() throw();
76 : :
77 : : com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >&
78 : 0 : GetList() { return maVersions; }
79 : : };
80 : :
81 : : // ------------------------------------------------------------------------
82 : : class XMLVersionListContext : public SvXMLImportContext
83 : : {
84 : : private:
85 : : XMLVersionListImport & rLocalRef;
86 : :
87 : : public:
88 : :
89 : : XMLVersionListContext( XMLVersionListImport& rImport,
90 : : sal_uInt16 nPrefix,
91 : : const rtl::OUString& rLocalName,
92 : : const ::com::sun::star::uno::Reference<
93 : : ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
94 : :
95 : : ~XMLVersionListContext();
96 : :
97 : : virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
98 : : const rtl::OUString& rLocalName,
99 : : const ::com::sun::star::uno::Reference<
100 : : ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
101 : :
102 : : };
103 : :
104 : : // ------------------------------------------------------------------------
105 : : class XMLVersionContext: public SvXMLImportContext
106 : : {
107 : : private:
108 : : XMLVersionListImport& rLocalRef;
109 : :
110 : : static sal_Bool ParseISODateTimeString(
111 : : const rtl::OUString& rString,
112 : : com::sun::star::util::DateTime& rDateTime );
113 : :
114 : : public:
115 : :
116 : : XMLVersionContext( XMLVersionListImport& rImport,
117 : : sal_uInt16 nPrefix,
118 : : const rtl::OUString& rLocalName,
119 : : const ::com::sun::star::uno::Reference<
120 : : ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
121 : :
122 : : ~XMLVersionContext();
123 : : };
124 : :
125 : :
126 : : // ------------------------------------------------------------------------
127 [ - + ]: 777 : class XMLVersionListPersistence : public ::cppu::WeakImplHelper1< ::com::sun::star::document::XDocumentRevisionListPersistence >
128 : : {
129 : : public:
130 : : 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);
131 : : 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);
132 : : };
133 : :
134 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
135 : : XMLVersionListPersistence_getSupportedServiceNames()
136 : : throw();
137 : :
138 : : ::rtl::OUString SAL_CALL XMLVersionPersistence_getImplementationName()
139 : : throw();
140 : :
141 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
142 : : XMLVersionListPersistence_createInstance(
143 : : const ::com::sun::star::uno::Reference<
144 : : ::com::sun::star::lang::XMultiServiceFactory > & )
145 : : throw( ::com::sun::star::uno::Exception );
146 : :
147 : : #endif
148 : :
149 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|