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#if ! defined INCLUDED_com_sun_star_deployment_XPackageRegistry_idl
29#define INCLUDED_com_sun_star_deployment_XPackageRegistry_idl
30
31#include <com/sun/star/deployment/XPackage.idl>
32#include <com/sun/star/deployment/XPackageTypeInfo.idl>
33#include <com/sun/star/deployment/InvalidRemovedParameterException.idl>
34#include <com/sun/star/beans/StringPair.idl>
35
36
37module com { module sun { module star { module deployment {
38
39/** Interface to bind an UNO package.
40
41    @since OOo 2.0
42*/
43interface XPackageRegistry
44{
45    /** binds a package URL to a <type>XPackage</type> handle.
46        The returned UNO package handle ought to late-initialize itself,
47        thus the process of binding must not be an expensive operation, because
48        it is not abortable.
49
50        Calling the function several time with the same parameters must result
51        in returning the same object.
52
53        The file or folder at the location where url points to may not exist or
54        it was replaced. This can happen, for example, when a bundled extension
55        was removed by the setup and a user later starts OOo. Then the user data
56        may still contain all registration data of that extension, but the
57        actual extension files do not exist anymore. The registration data must
58        then be cleaned of all the remains of that extension. To to that one
59        creates an <type>XPackage</type> object on behalf of that extension and
60        calls <member>XPackage::revokePakage</member>. The parameter
61        <code>removed</code> indicates this case. The returned object may not
62        rely on the file or folder to which refers <code>url</url>. Instead it
63        must use previously saved data to successfully carry out the revocation
64        of this object (<member>XPackage::revokePackage</member>).
65
66        The implementation must ensure that there is only one instance of
67        <type>XPackage</type> for the same <code>url</code> at any
68        time. Therefore calling <member>bindPackage</member> again with the same
69        <code>url</code> but different <code>mediaType<code> (the exeption is,
70        if previsously an empty string was proveded to cause the determination
71        of the media type) or <code>removed</code> parameters will cause an
72        exception. An <type
73        scope="com::sun::star::lang">IllegalArgumentException</type> will be
74        thrown in case of a different <code>mediaType</code> parameter and a
75        <type>InvalidRemovedParameterException</type> is thrown if the
76        <code>removed</code> parameter is different.
77
78        The <code>identifier</code> parameter must be provided when
79        <code>removed</code> = true. If not, then an <type
80        scope="com::sun::star::lang">IllegalArgumentException</type> will be
81        thrown.
82
83        @param url
84               package URL, must be UCB conform
85        @param mediaType
86               media type of package, empty string if to be detected
87        @param removed
88
89        @para unfulfilledPrerequisites
90              has a value other null if the extension could not be installed previously
91              because <member>XPackage::checkPrerequisites</member> failed.
92
93        @param identifier
94               the identifier of the extension
95
96        @param xCmdEnv
97               command environment for error and progress handling
98        @return
99               <type>XPackage</type> handle
100    */
101    XPackage bindPackage(
102        [in] string url,
103        [in] string mediaType,
104        [in] boolean removed,
105        [in] string identifier,
106        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
107        raises (DeploymentException,
108                InvalidRemovedParameterException,
109                com::sun::star::ucb::CommandFailedException,
110                com::sun::star::lang::IllegalArgumentException);
111
112    /** gets the supported <type>XPackageTypeInfo</type>s.
113
114        @return
115                supported <type>XPackageTypeInfo</type>s.
116    */
117    sequence<XPackageTypeInfo> getSupportedPackageTypes();
118
119    void packageRemoved(
120        [in] string url,
121        [in] string mediaType)
122        raises (DeploymentException,
123                com::sun::star::lang::IllegalArgumentException);
124
125};
126
127}; }; }; };
128
129#endif
130