1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski #ifndef _XMLOFF_XMLVERSION_HXX 24*b1cdbd2cSJim Jagielski #define _XMLOFF_XMLVERSION_HXX 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski #include <com/sun/star/uno/Sequence.hxx> 27*b1cdbd2cSJim Jagielski #include <com/sun/star/document/XDocumentRevisionListPersistence.hpp> 28*b1cdbd2cSJim Jagielski #include <com/sun/star/util/RevisionTag.hpp> 29*b1cdbd2cSJim Jagielski #include <com/sun/star/embed/XStorage.hpp> 30*b1cdbd2cSJim Jagielski 31*b1cdbd2cSJim Jagielski #include <cppuhelper/implbase1.hxx> 32*b1cdbd2cSJim Jagielski #include <xmloff/xmlictxt.hxx> 33*b1cdbd2cSJim Jagielski #include <xmloff/xmlexp.hxx> 34*b1cdbd2cSJim Jagielski #include <xmloff/xmlimp.hxx> 35*b1cdbd2cSJim Jagielski #include <xmloff/nmspmap.hxx> 36*b1cdbd2cSJim Jagielski #include <xmloff/xmlnmspe.hxx> 37*b1cdbd2cSJim Jagielski #include <xmloff/xmltoken.hxx> 38*b1cdbd2cSJim Jagielski 39*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------ 40*b1cdbd2cSJim Jagielski class XMLVersionListExport : public SvXMLExport 41*b1cdbd2cSJim Jagielski { 42*b1cdbd2cSJim Jagielski private: 43*b1cdbd2cSJim Jagielski const com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& maVersions; 44*b1cdbd2cSJim Jagielski public: 45*b1cdbd2cSJim Jagielski XMLVersionListExport( 46*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, 47*b1cdbd2cSJim Jagielski const com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& rVersions, 48*b1cdbd2cSJim Jagielski const rtl::OUString &rFileName, 49*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference< com::sun::star::xml::sax::XDocumentHandler > &rHandler ); ~XMLVersionListExport()50*b1cdbd2cSJim Jagielski virtual ~XMLVersionListExport() {} 51*b1cdbd2cSJim Jagielski 52*b1cdbd2cSJim Jagielski sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ); _ExportAutoStyles()53*b1cdbd2cSJim Jagielski void _ExportAutoStyles() {} _ExportMasterStyles()54*b1cdbd2cSJim Jagielski void _ExportMasterStyles () {} _ExportContent()55*b1cdbd2cSJim Jagielski void _ExportContent() {} 56*b1cdbd2cSJim Jagielski }; 57*b1cdbd2cSJim Jagielski 58*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------ 59*b1cdbd2cSJim Jagielski class XMLVersionListImport : public SvXMLImport 60*b1cdbd2cSJim Jagielski { 61*b1cdbd2cSJim Jagielski private: 62*b1cdbd2cSJim Jagielski com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& maVersions; 63*b1cdbd2cSJim Jagielski 64*b1cdbd2cSJim Jagielski protected: 65*b1cdbd2cSJim Jagielski 66*b1cdbd2cSJim Jagielski // This method is called after the namespace map has been updated, but 67*b1cdbd2cSJim Jagielski // before a context for the current element has been pushed. 68*b1cdbd2cSJim Jagielski virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix, 69*b1cdbd2cSJim Jagielski const ::rtl::OUString& rLocalName, 70*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< 71*b1cdbd2cSJim Jagielski ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 72*b1cdbd2cSJim Jagielski 73*b1cdbd2cSJim Jagielski public: 74*b1cdbd2cSJim Jagielski 75*b1cdbd2cSJim Jagielski // #110897# 76*b1cdbd2cSJim Jagielski XMLVersionListImport( 77*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, 78*b1cdbd2cSJim Jagielski com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& rVersions ); 79*b1cdbd2cSJim Jagielski ~XMLVersionListImport() throw(); 80*b1cdbd2cSJim Jagielski 81*b1cdbd2cSJim Jagielski com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag >& GetList()82*b1cdbd2cSJim Jagielski GetList() { return maVersions; } 83*b1cdbd2cSJim Jagielski }; 84*b1cdbd2cSJim Jagielski 85*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------ 86*b1cdbd2cSJim Jagielski class XMLVersionListContext : public SvXMLImportContext 87*b1cdbd2cSJim Jagielski { 88*b1cdbd2cSJim Jagielski private: 89*b1cdbd2cSJim Jagielski XMLVersionListImport & rLocalRef; 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski public: 92*b1cdbd2cSJim Jagielski 93*b1cdbd2cSJim Jagielski XMLVersionListContext( XMLVersionListImport& rImport, 94*b1cdbd2cSJim Jagielski sal_uInt16 nPrefix, 95*b1cdbd2cSJim Jagielski const rtl::OUString& rLocalName, 96*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< 97*b1cdbd2cSJim Jagielski ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 98*b1cdbd2cSJim Jagielski 99*b1cdbd2cSJim Jagielski ~XMLVersionListContext(); 100*b1cdbd2cSJim Jagielski 101*b1cdbd2cSJim Jagielski virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, 102*b1cdbd2cSJim Jagielski const rtl::OUString& rLocalName, 103*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< 104*b1cdbd2cSJim Jagielski ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 105*b1cdbd2cSJim Jagielski 106*b1cdbd2cSJim Jagielski }; 107*b1cdbd2cSJim Jagielski 108*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------ 109*b1cdbd2cSJim Jagielski class XMLVersionContext: public SvXMLImportContext 110*b1cdbd2cSJim Jagielski { 111*b1cdbd2cSJim Jagielski private: 112*b1cdbd2cSJim Jagielski XMLVersionListImport& rLocalRef; 113*b1cdbd2cSJim Jagielski 114*b1cdbd2cSJim Jagielski static sal_Bool ParseISODateTimeString( 115*b1cdbd2cSJim Jagielski const rtl::OUString& rString, 116*b1cdbd2cSJim Jagielski com::sun::star::util::DateTime& rDateTime ); 117*b1cdbd2cSJim Jagielski 118*b1cdbd2cSJim Jagielski public: 119*b1cdbd2cSJim Jagielski 120*b1cdbd2cSJim Jagielski XMLVersionContext( XMLVersionListImport& rImport, 121*b1cdbd2cSJim Jagielski sal_uInt16 nPrefix, 122*b1cdbd2cSJim Jagielski const rtl::OUString& rLocalName, 123*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< 124*b1cdbd2cSJim Jagielski ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 125*b1cdbd2cSJim Jagielski 126*b1cdbd2cSJim Jagielski ~XMLVersionContext(); 127*b1cdbd2cSJim Jagielski }; 128*b1cdbd2cSJim Jagielski 129*b1cdbd2cSJim Jagielski 130*b1cdbd2cSJim Jagielski // ------------------------------------------------------------------------ 131*b1cdbd2cSJim Jagielski class XMLVersionListPersistence : public ::cppu::WeakImplHelper1< ::com::sun::star::document::XDocumentRevisionListPersistence > 132*b1cdbd2cSJim Jagielski { 133*b1cdbd2cSJim Jagielski public: 134*b1cdbd2cSJim Jagielski 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); 135*b1cdbd2cSJim Jagielski 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); 136*b1cdbd2cSJim Jagielski }; 137*b1cdbd2cSJim Jagielski 138*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 139*b1cdbd2cSJim Jagielski XMLVersionListPersistence_getSupportedServiceNames() 140*b1cdbd2cSJim Jagielski throw(); 141*b1cdbd2cSJim Jagielski 142*b1cdbd2cSJim Jagielski ::rtl::OUString SAL_CALL XMLVersionPersistence_getImplementationName() 143*b1cdbd2cSJim Jagielski throw(); 144*b1cdbd2cSJim Jagielski 145*b1cdbd2cSJim Jagielski ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 146*b1cdbd2cSJim Jagielski XMLVersionListPersistence_createInstance( 147*b1cdbd2cSJim Jagielski const ::com::sun::star::uno::Reference< 148*b1cdbd2cSJim Jagielski ::com::sun::star::lang::XMultiServiceFactory > & ) 149*b1cdbd2cSJim Jagielski throw( ::com::sun::star::uno::Exception ); 150*b1cdbd2cSJim Jagielski 151*b1cdbd2cSJim Jagielski #endif 152