summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/deployment/XPackageRegistry.idl
blob: 2251762b70d8743192c4c9be4a9f2af201bacf2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef _com_sun_star_deployment_XPackageRegistry_idl
#define _com_sun_star_deployment_XPackageRegistry_idl

#include <com/sun/star/deployment/XPackage.idl>
#include <com/sun/star/deployment/XPackageTypeInfo.idl>
#include <com/sun/star/deployment/InvalidRemovedParameterException.idl>
#include <com/sun/star/beans/StringPair.idl>


module com { module sun { module star { module deployment {

/** Interface to bind a UNO package.

    @since OOo 2.0
*/
interface XPackageRegistry
{
    /** binds a package URL to a XPackage handle.
        The returned UNO package handle ought to late-initialize itself,
        thus the process of binding must not be an expensive operation, because
        it is not abortable.

        Calling the function several time with the same parameters must result
        in returning the same object.

        The file or folder at the location where url points to may not exist or
        it was replaced. This can happen, for example, when a bundled extension
        was removed by the setup and a user later starts OOo. Then the user data
        may still contain all registration data of that extension, but the
        actual extension files do not exist anymore. The registration data must
        then be cleaned of all the remains of that extension. To do that one
        creates an XPackage object on behalf of that extension and
        calls XPackage::revokePakage(). The parameter
        <code>removed</code> indicates this case. The returned object may not
        rely on the file or folder to which refers <code>url</code>. Instead it
        must use previously saved data to successfully carry out the revocation
        of this object (XPackage::revokePackage()).

        The implementation must ensure that there is only one instance of
        XPackage for the same <code>url</code> at any
        time. Therefore calling bindPackage() again with the same
        <code>url</code> but different <code>mediaType</code> (the exception is,
        if previously an empty string was provided to cause the determination
        of the media type) or <code>removed</code> parameters will cause an
        exception. A com::sun::star::lang::IllegalArgumentException will be
        thrown in case of a different <code>mediaType</code> parameter and a
        InvalidRemovedParameterException is thrown if the
        <code>removed</code> parameter is different.

        The <code>identifier</code> parameter must be provided when
        <code>removed</code> = true. If not, then an
        com::sun::star::lang::IllegalArgumentException will be thrown.

        @param url
               package URL, must be UCB conform
        @param mediaType
               media type of package, empty string if to be detected
        @param removed
        @param identifier
               the identifier of the extension
        @param xCmdEnv
               command environment for error and progress handling
        @return
               XPackage handle
    */
    XPackage bindPackage(
        [in] string url,
        [in] string mediaType,
        [in] boolean removed,
        [in] string identifier,
        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
        raises (DeploymentException,
                InvalidRemovedParameterException,
                com::sun::star::ucb::CommandFailedException,
                com::sun::star::lang::IllegalArgumentException);

    /** gets the supported XPackageTypeInfos.

        @return
                supported XPackageTypeInfos.
    */
    sequence<XPackageTypeInfo> getSupportedPackageTypes();

    void packageRemoved(
        [in] string url,
        [in] string mediaType)
        raises (DeploymentException,
                com::sun::star::lang::IllegalArgumentException);

};

}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */