1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28
29#ifndef __com_sun_star_script_XStorageBasedLibraryContainer_idl__
30#define __com_sun_star_script_XStorageBasedLibraryContainer_idl__
31
32#ifndef __com_sun_star_embed_XStorage_idl__
33#include <com/sun/star/embed/XStorage.idl>
34#endif
35#ifndef __com_sun_star_script_XPersistentLibraryContainer_idl__
36#include <com/sun/star/script/XPersistentLibraryContainer.idl>
37#endif
38
39//=============================================================================
40
41module com { module sun { module star { module script {
42
43//=============================================================================
44
45/** is the interface for an <type>XLibraryContainer</type> which can be made
46    persistent in an <type scope="com::sun::star::embed">XStorage</type>.
47
48    <p>A persistent library container is associated with a root storage. The
49    container is responsible for a particular sub storage of the root storage,
50    the container storage.</p>
51
52    @since OOo 2.3
53 */
54interface XStorageBasedLibraryContainer
55{
56    interface XPersistentLibraryContainer;
57
58    /** denotes the root storage associated with the container.
59
60        <p>Effectively, this attribute is a typed version of
61        <member>XPersistentLibraryContainer::RootLocation</member>, it's guaranteed
62        that at every time, <code>XPersistentLibraryContainer::RootLocation</code> and
63        <code>RootStorage</code> have the same value.</p>
64
65        <p>You should only <em>set</em> this attribute to a new value if you previously
66        called storeLibrariesToStorage with the same storage. Setting this attribute
67        to a storage into which the container has not been stored previously might
68        result in unexpected behaviour.</p>
69    */
70    [attribute] ::com::sun::star::embed::XStorage RootStorage
71    {
72        set raises ( ::com::sun::star::lang::IllegalArgumentException );
73    };
74
75    /** stores the libraries to a storage other than the current container storage
76
77        <p>Note that the library continer is not automatically associated with the
78        new root storage. Instead, you need to manually set the <type>RootStroage</type>
79        attribute afterwards. This separation allows for Save-To as well Save-As
80        operations.</p>
81
82        @param RootStorage
83            denotes the root storage into which the libraries should be written, which
84            must not be <NULL/>.<br/>
85            Note that the actual libraries are written into a sub storage of this
86            root storage, as usual.
87
88        @throws ::com::sun::star::lang::IllegalArgumentException
89            if the <code>RootStorage</code> parameter is <NULL/>, or equals
90            <member>RootStorage</member>.
91
92        @throws ::com::sun::star::lang::WrappedTargetException
93            if an error occurs during storing.
94    */
95    void    storeLibrariesToStorage( [in] ::com::sun::star::embed::XStorage RootStorage )
96        raises ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
97};
98
99//=============================================================================
100
101}; }; }; };
102
103//=============================================================================
104
105#endif
106