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 <com/sun/star/uno/Sequence.h>
24 
26 
27 namespace com::sun::star::beans { struct StringPair; }
28 namespace com::sun::star::io { class XInputStream; }
29 namespace com::sun::star::io { class XOutputStream; }
30 namespace com::sun::star::uno { class XComponentContext; }
31 namespace com::sun::star::uno { template <class interface_type> class Reference; }
32 
33 namespace comphelper
34 {
35 
36 namespace OFOPXMLHelper {
37 
38  // returns sequence of elements, where each element is described by sequence of tags,
39  // where each tag is described by StringPair ( First - name, Second - value )
40  // the first tag of each element sequence must be "Id"
43  css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >
45  const css::uno::Reference< css::io::XInputStream >& xInStream,
46  const OUString & aStreamName,
47  const css::uno::Reference< css::uno::XComponentContext >& rContext );
48 
49  // returns sequence containing two entries of type sequence<StringPair>
50  // the first sequence describes "Default" elements, where each element is described
51  // by StringPair object ( First - Extension, Second - ContentType )
52  // the second sequence describes "Override" elements, where each element is described
53  // by StringPair object ( First - PartName, Second - ContentType )
56  css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >
58  const css::uno::Reference< css::io::XInputStream >& xInStream,
59  const css::uno::Reference< css::uno::XComponentContext >& rContext );
60 
61  // returns the ContentType for the given name, or empty when not found.
62  // rContentTypes is a sequence containing two entries of type sequence<StringPair>
63  // the first sequence describes "Default" elements, where each element is described
64  // by StringPair object ( First - Extension, Second - ContentType )
65  // the second sequence describes "Override" elements, where each element is described
66  // by StringPair object ( First - PartName, Second - ContentType )
67  // The "Override" sequence is searched first before falling back on "Default".
69  OUString
70  GetContentTypeByName(const css::uno::Sequence<css::uno::Sequence<css::beans::StringPair>>& rContentTypes,
71  const OUString& rFilename);
72 
73  // writes sequence of elements, where each element is described by sequence of tags,
74  // where each tag is described by StringPair ( First - name, Second - value )
75  // the first tag of each element sequence must be "Id"
79  const css::uno::Reference< css::io::XOutputStream >& xOutStream,
80  const css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > >& aSequence,
81  const css::uno::Reference< css::uno::XComponentContext >& rContext );
82 
83  // writes two entries of type sequence<StringPair>
84  // the first sequence describes "Default" elements, where each element is described
85  // by StringPair object ( First - Extension, Second - ContentType )
86  // the second sequence describes "Override" elements, where each element is described
87  // by StringPair object ( First - PartName, Second - ContentType )
91  const css::uno::Reference< css::io::XOutputStream >& xOutStream,
92  const css::uno::Sequence< css::beans::StringPair >& aDefaultsSequence,
93  const css::uno::Sequence< css::beans::StringPair >& aOverridesSequence,
94  const css::uno::Reference< css::uno::XComponentContext >& rContext );
95 
96 } // namespace OFOPXMLHelper
97 
98 } // namespace comphelper
99 
100 #endif
101 
102 /* 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, const OUString &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)