LibreOffice Module comphelper (master)  1
ofopxmlhelper.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 
20 #ifndef INCLUDED_COMPHELPER_OFOPXMLHELPER_HXX
21 #define INCLUDED_COMPHELPER_OFOPXMLHELPER_HXX
22 
23 #include <sal/config.h>
24 
25 #include <string_view>
26 
27 #include <com/sun/star/uno/Sequence.h>
28 
30 
31 namespace com::sun::star::beans { struct StringPair; }
32 namespace com::sun::star::io { class XInputStream; }
33 namespace com::sun::star::io { class XOutputStream; }
34 namespace com::sun::star::uno { class XComponentContext; }
35 namespace com::sun::star::uno { template <class interface_type> class Reference; }
36 
37 namespace comphelper::OFOPXMLHelper {
38 
39  // returns sequence of elements, where each element is described by sequence of tags,
40  // where each tag is described by StringPair ( First - name, Second - value )
41  // the first tag of each element sequence must be "Id"
44  css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >
46  const css::uno::Reference< css::io::XInputStream >& xInStream,
47  std::u16string_view aStreamName,
48  const css::uno::Reference< css::uno::XComponentContext >& rContext );
49 
50  // returns sequence containing two entries of type sequence<StringPair>
51  // the first sequence describes "Default" elements, where each element is described
52  // by StringPair object ( First - Extension, Second - ContentType )
53  // the second sequence describes "Override" elements, where each element is described
54  // by StringPair object ( First - PartName, Second - ContentType )
57  css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >
59  const css::uno::Reference< css::io::XInputStream >& xInStream,
60  const css::uno::Reference< css::uno::XComponentContext >& rContext );
61 
62  // returns the ContentType for the given name, or empty when not found.
63  // rContentTypes is a sequence containing two entries of type sequence<StringPair>
64  // the first sequence describes "Default" elements, where each element is described
65  // by StringPair object ( First - Extension, Second - ContentType )
66  // the second sequence describes "Override" elements, where each element is described
67  // by StringPair object ( First - PartName, Second - ContentType )
68  // The "Override" sequence is searched first before falling back on "Default".
70  OUString
71  GetContentTypeByName(const css::uno::Sequence<css::uno::Sequence<css::beans::StringPair>>& rContentTypes,
72  const OUString& rFilename);
73 
74  // writes sequence of elements, where each element is described by sequence of tags,
75  // where each tag is described by StringPair ( First - name, Second - value )
76  // the first tag of each element sequence must be "Id"
80  const css::uno::Reference< css::io::XOutputStream >& xOutStream,
81  const css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >& aSequence,
82  const css::uno::Reference< css::uno::XComponentContext >& rContext );
83 
84  // writes two entries of type sequence<StringPair>
85  // the first sequence describes "Default" elements, where each element is described
86  // by StringPair object ( First - Extension, Second - ContentType )
87  // the second sequence describes "Override" elements, where each element is described
88  // by StringPair object ( First - PartName, Second - ContentType )
92  const css::uno::Reference< css::io::XOutputStream >& xOutStream,
93  const css::uno::Sequence< css::beans::StringPair >& aDefaultsSequence,
94  const css::uno::Sequence< css::beans::StringPair >& aOverridesSequence,
95  const css::uno::Reference< css::uno::XComponentContext >& rContext );
96 
97 } // namespace comphelper::OFOPXMLHelper
98 
99 #endif
100 
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference
void WriteContentSequence(const uno::Reference< io::XOutputStream > &xOutStream, const uno::Sequence< beans::StringPair > &aDefaultsSequence, const uno::Sequence< beans::StringPair > &aOverridesSequence, const uno::Reference< uno::XComponentContext > &rContext)
OUString GetContentTypeByName(const css::uno::Sequence< css::uno::Sequence< css::beans::StringPair >> &rContentTypes, const OUString &rFilename)
void WriteRelationsInfoSequence(const uno::Reference< io::XOutputStream > &xOutStream, const uno::Sequence< uno::Sequence< beans::StringPair > > &aSequence, const uno::Reference< uno::XComponentContext > &rContext)
uno::Sequence< uno::Sequence< beans::StringPair > > ReadRelationsInfoSequence(const uno::Reference< io::XInputStream > &xInStream, std::u16string_view aStreamName, const uno::Reference< uno::XComponentContext > &rContext)
#define COMPHELPER_DLLPUBLIC
uno::Sequence< uno::Sequence< beans::StringPair > > ReadContentTypeSequence(const uno::Reference< io::XInputStream > &xInStream, const uno::Reference< uno::XComponentContext > &rContext)