update credits
[LibreOffice.git] / include / oox / ole / olestorage.hxx
blob085ef570abaa328bce6a683e6d2e61a1d83b8c4b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_OOX_OLE_OLESTORAGE_HXX
21 #define INCLUDED_OOX_OLE_OLESTORAGE_HXX
23 #include <oox/helper/storagebase.hxx>
25 namespace com { namespace sun { namespace star {
26 namespace container { class XNameContainer; }
27 namespace uno { class XComponentContext; }
28 } } }
30 namespace oox {
31 namespace ole {
35 /** Implements stream access for binary OLE storages. */
36 class OOX_DLLPUBLIC OleStorage : public StorageBase
38 public:
39 explicit OleStorage(
40 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
41 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream,
42 bool bBaseStreamAccess );
44 explicit OleStorage(
45 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
46 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
47 bool bBaseStreamAccess );
49 virtual ~OleStorage();
51 private:
52 explicit OleStorage(
53 const OleStorage& rParentStorage,
54 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rxStorage,
55 const OUString& rElementName,
56 bool bReadOnly );
57 explicit OleStorage(
58 const OleStorage& rParentStorage,
59 const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream,
60 const OUString& rElementName );
62 /** Initializes the API storage object for input. */
63 void initStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStream );
64 /** Initializes the API storage object for input/output. */
65 void initStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& rxOutStream );
67 /** Returns true, if the object represents a valid storage. */
68 virtual bool implIsStorage() const SAL_OVERRIDE;
70 /** Returns the com.sun.star.embed.XStorage interface of the current storage.
72 @attention
73 This function is not implemented for binary OLE storages.
75 virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >
76 implGetXStorage() const SAL_OVERRIDE;
78 /** Returns the names of all elements of this storage. */
79 virtual void implGetElementNames( ::std::vector< OUString >& orElementNames ) const SAL_OVERRIDE;
81 /** Opens and returns the specified sub storage from the storage. */
82 virtual StorageRef implOpenSubStorage( const OUString& rElementName, bool bCreateMissing ) SAL_OVERRIDE;
84 /** Opens and returns the specified input stream from the storage. */
85 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
86 implOpenInputStream( const OUString& rElementName ) SAL_OVERRIDE;
88 /** Opens and returns the specified output stream from the storage. */
89 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
90 implOpenOutputStream( const OUString& rElementName ) SAL_OVERRIDE;
92 /** Commits the current storage. */
93 virtual void implCommit() const SAL_OVERRIDE;
95 private:
96 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
97 mxContext; ///< Component context with service manager.
98 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
99 mxStorage; ///< Access to elements of this sub storage.
100 const OleStorage* mpParentStorage; ///< Parent OLE storage that contains this storage.
105 } // namespace ole
106 } // namespace oox
108 #endif
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */