LibreOffice Module oox (master) 1
olestorage.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_OOX_OLE_OLESTORAGE_HXX
21#define INCLUDED_OOX_OLE_OLESTORAGE_HXX
22
23#include <vector>
24
25#include <com/sun/star/uno/Reference.hxx>
26#include <oox/dllapi.h>
28#include <rtl/ustring.hxx>
29
30namespace com::sun::star {
31 namespace container { class XNameContainer; }
32 namespace embed { class XStorage; }
33 namespace io { class XInputStream; }
34 namespace io { class XOutputStream; }
35 namespace io { class XStream; }
36 namespace uno { class XComponentContext; }
37}
38
39namespace oox::ole {
40
41
44{
45public:
46 explicit OleStorage(
47 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
48 const css::uno::Reference< css::io::XInputStream >& rxInStream,
49 bool bBaseStreamAccess );
50
51 explicit OleStorage(
52 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
53 const css::uno::Reference< css::io::XStream >& rxOutStream,
54 bool bBaseStreamAccess );
55
56 virtual ~OleStorage() override;
57
58private:
59 explicit OleStorage(
60 const OleStorage& rParentStorage,
61 const css::uno::Reference< css::container::XNameContainer >& rxStorage,
62 const OUString& rElementName,
63 bool bReadOnly );
64 explicit OleStorage(
65 const OleStorage& rParentStorage,
66 const css::uno::Reference< css::io::XStream >& rxOutStream,
67 const OUString& rElementName );
68
70 void initStorage( const css::uno::Reference< css::io::XInputStream >& rxInStream );
72 void initStorage( const css::uno::Reference< css::io::XStream >& rxOutStream );
73
75 virtual bool implIsStorage() const override;
76
82 virtual css::uno::Reference< css::embed::XStorage >
83 implGetXStorage() const override;
84
86 virtual void implGetElementNames( ::std::vector< OUString >& orElementNames ) const override;
87
89 virtual StorageRef implOpenSubStorage( const OUString& rElementName, bool bCreateMissing ) override;
90
92 virtual css::uno::Reference< css::io::XInputStream >
93 implOpenInputStream( const OUString& rElementName ) override;
94
96 virtual css::uno::Reference< css::io::XOutputStream >
97 implOpenOutputStream( const OUString& rElementName ) override;
98
100 virtual void implCommit() const override;
101
102private:
103 css::uno::Reference< css::uno::XComponentContext >
105 css::uno::Reference< css::container::XNameContainer >
108};
109
110
111} // namespace oox::ole
112
113#endif
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class for storage access implementations.
Definition: storagebase.hxx:52
Implements stream access for binary OLE storages.
Definition: olestorage.hxx:44
OleStorage(const OleStorage &rParentStorage, const css::uno::Reference< css::container::XNameContainer > &rxStorage, const OUString &rElementName, bool bReadOnly)
OleStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XInputStream > &rxInStream, bool bBaseStreamAccess)
void initStorage(const css::uno::Reference< css::io::XStream > &rxOutStream)
Initializes the API storage object for input/output.
void initStorage(const css::uno::Reference< css::io::XInputStream > &rxInStream)
Initializes the API storage object for input.
const OleStorage * mpParentStorage
Parent OLE storage that contains this storage.
Definition: olestorage.hxx:107
OleStorage(const OleStorage &rParentStorage, const css::uno::Reference< css::io::XStream > &rxOutStream, const OUString &rElementName)
OleStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::io::XStream > &rxOutStream, bool bBaseStreamAccess)
css::uno::Reference< css::uno::XComponentContext > mxContext
Component context with service manager.
Definition: olestorage.hxx:104
css::uno::Reference< css::container::XNameContainer > mxStorage
Access to elements of this sub storage.
Definition: olestorage.hxx:106
#define OOX_DLLPUBLIC
Definition: dllapi.h:28
std::shared_ptr< StorageBase > StorageRef
Definition: storagebase.hxx:42