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#pragma once
20
21#include <com/sun/star/uno/Sequence.hxx>
22#include <com/sun/star/document/XDocumentRevisionListPersistence.hpp>
23#include <com/sun/star/util/RevisionTag.hpp>
24#include <com/sun/star/embed/XStorage.hpp>
25
27#include <xmloff/xmlictxt.hxx>
28#include <xmloff/xmlexp.hxx>
29#include <xmloff/xmlimp.hxx>
30#include <xmloff/xmltoken.hxx>
31
33{
34private:
35 const css::uno::Sequence < css::util::RevisionTag >& maVersions;
36public:
38 const css::uno::Reference< css::uno::XComponentContext >& rContext,
39 const css::uno::Sequence < css::util::RevisionTag >& rVersions,
40 const OUString &rFileName,
41 css::uno::Reference< css::xml::sax::XDocumentHandler > const &rHandler );
42
44 void ExportAutoStyles_() override {}
45 void ExportMasterStyles_ () override {}
46 void ExportContent_() override {}
47};
48
49class XMLVersionListImport final : public SvXMLImport
50{
51private:
52 css::uno::Sequence < css::util::RevisionTag >& maVersions;
53
54 virtual SvXMLImportContext *CreateFastContext( sal_Int32 Element,
55 const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList ) override;
56
57public:
58
60 const css::uno::Reference< css::uno::XComponentContext >& rContext,
61 css::uno::Sequence < css::util::RevisionTag >& rVersions );
62 virtual ~XMLVersionListImport() noexcept override;
63
64 css::uno::Sequence < css::util::RevisionTag >&
65 GetList() { return maVersions; }
66};
67
69{
70private:
72
73public:
74
76
77 virtual ~XMLVersionListContext() override;
78
79 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
80 createFastChildContext(sal_Int32 nElement,
81 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttribs) override;
82};
83
85{
86private:
87 static bool ParseISODateTimeString(
88 std::u16string_view rString,
89 css::util::DateTime& rDateTime );
90
91public:
92
94 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList );
95
96 virtual ~XMLVersionContext() override;
97};
98
99class XMLVersionListPersistence final : public ::cppu::WeakImplHelper< css::document::XDocumentRevisionListPersistence, css::lang::XServiceInfo >
100{
101public:
102 virtual css::uno::Sequence< css::util::RevisionTag > SAL_CALL load( const css::uno::Reference< css::embed::XStorage >& Storage ) override;
103 virtual void SAL_CALL store( const css::uno::Reference< css::embed::XStorage >& Storage, const css::uno::Sequence< css::util::RevisionTag >& List ) override;
104
105 OUString SAL_CALL getImplementationName() override;
106
107 sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
108
109 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
110};
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class deliberately does not support XWeak, to improve performance when loading large documents.
Definition: xmlictxt.hxx:48
SvXMLImport & GetImport()
Definition: xmlictxt.hxx:60
virtual ~XMLVersionContext() override
Definition: xmlversion.cxx:202
static bool ParseISODateTimeString(std::u16string_view rString, css::util::DateTime &rDateTime)
Definition: xmlversion.cxx:205
XMLVersionContext(XMLVersionListImport &rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Definition: xmlversion.cxx:152
XMLVersionListContext(XMLVersionListImport &rImport)
Definition: xmlversion.cxx:129
virtual ~XMLVersionListContext() override
Definition: xmlversion.cxx:134
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:138
XMLVersionListImport & GetImport()
Definition: xmlversion.hxx:71
void ExportAutoStyles_() override
Override this method to export the contents of <style:auto-styles>.
Definition: xmlversion.hxx:44
void ExportMasterStyles_() override
Override this method to export the contents of <style:master-styles>.
Definition: xmlversion.hxx:45
ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
Definition: xmlversion.cxx:61
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:47
void ExportContent_() override
Override this method to export the content of <office:body>.
Definition: xmlversion.hxx:46
const css::uno::Sequence< css::util::RevisionTag > & maVersions
Definition: xmlversion.hxx:35
virtual SvXMLImportContext * CreateFastContext(sal_Int32 Element, const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlversion.cxx:116
css::uno::Sequence< css::util::RevisionTag > & maVersions
Definition: xmlversion.hxx:52
css::uno::Sequence< css::util::RevisionTag > & GetList()
Definition: xmlversion.hxx:65
virtual ~XMLVersionListImport() noexcept override
Definition: xmlversion.cxx:113
XMLVersionListImport(const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Sequence< css::util::RevisionTag > &rVersions)
Definition: xmlversion.cxx:105
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:304
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: xmlversion.cxx:415
OUString SAL_CALL getImplementationName() override
Definition: xmlversion.cxx:403
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
Definition: xmlversion.cxx:408
virtual css::uno::Sequence< css::util::RevisionTag > SAL_CALL load(const css::uno::Reference< css::embed::XStorage > &Storage) override
Definition: xmlversion.cxx:346
XMLTokenEnum
The enumeration of all XML tokens.
Definition: xmltoken.hxx:50
unsigned char sal_Bool