1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir
28*cdf0e10cSrcweir#if ! defined INCLUDED_com_sun_star_deployment_XPackageManager_idl
29*cdf0e10cSrcweir#define INCLUDED_com_sun_star_deployment_XPackageManager_idl
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
32*cdf0e10cSrcweir#include <com/sun/star/task/XAbortChannel.idl>
33*cdf0e10cSrcweir#include <com/sun/star/util/XModifyBroadcaster.idl>
34*cdf0e10cSrcweir#include <com/sun/star/deployment/XPackage.idl>
35*cdf0e10cSrcweir#include <com/sun/star/deployment/XPackageTypeInfo.idl>
36*cdf0e10cSrcweir#include <com/sun/star/ucb/XCommandEnvironment.idl>
37*cdf0e10cSrcweir#include <com/sun/star/deployment/DeploymentException.idl>
38*cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl>
39*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
40*cdf0e10cSrcweir#include <com/sun/star/beans/NamedValue.idl>
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir
43*cdf0e10cSrcweirmodule com { module sun { module star { module deployment {
44*cdf0e10cSrcweir
45*cdf0e10cSrcweir/** The <type>XPackageManager</type> interface is used to add or remove
46*cdf0e10cSrcweir    packages to a specific repository. This interface represents a particular
47*cdf0e10cSrcweir    repository.
48*cdf0e10cSrcweir    Packages are deployable files, e.g. scripts or UNO components.
49*cdf0e10cSrcweir    <p>
50*cdf0e10cSrcweir    Adding an UNO package means that a copy of the package is stored
51*cdf0e10cSrcweir    in the repository.
52*cdf0e10cSrcweir    </p>
53*cdf0e10cSrcweir    <p>
54*cdf0e10cSrcweir    Removing an UNO package means that the previously added package is
55*cdf0e10cSrcweir    removed from the repository.
56*cdf0e10cSrcweir    </p>
57*cdf0e10cSrcweir    <p>
58*cdf0e10cSrcweir    All interface methods do neither register nor revoke an extension.
59*cdf0e10cSrcweir    This happens exclusively by <type>XExtensionManager</type>.
60*cdf0e10cSrcweir    </p>
61*cdf0e10cSrcweir    <p>
62*cdf0e10cSrcweir    Objects of this interface are created using the
63*cdf0e10cSrcweir    <type>XPackageManagerFactory</type> service resp. the singleton
64*cdf0e10cSrcweir    <code>
65*cdf0e10cSrcweir    /singletons/com.sun.star.deployment.thePackageManagerFactory
66*cdf0e10cSrcweir    </code>.
67*cdf0e10cSrcweir    </p>
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir    @see thePackageManagerFactory
70*cdf0e10cSrcweir    @since OOo 2.0
71*cdf0e10cSrcweir    @deprecated
72*cdf0e10cSrcweir         Use <type>XExtensionManager</type>.
73*cdf0e10cSrcweir*/
74*cdf0e10cSrcweirinterface XPackageManager
75*cdf0e10cSrcweir{
76*cdf0e10cSrcweir    /** interface to notify disposing
77*cdf0e10cSrcweir     */
78*cdf0e10cSrcweir    interface com::sun::star::lang::XComponent;
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir    /** interface to notify changes of the set of deployed packages of
81*cdf0e10cSrcweir        this manager
82*cdf0e10cSrcweir    */
83*cdf0e10cSrcweir    interface com::sun::star::util::XModifyBroadcaster;
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir    /** returns the underlying deployment context, that is,
86*cdf0e10cSrcweir        the name of the repository..
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir        @return
89*cdf0e10cSrcweir                underlying deployment context
90*cdf0e10cSrcweir    */
91*cdf0e10cSrcweir    string getContext();
92*cdf0e10cSrcweir
93*cdf0e10cSrcweir    /** gets the supported <type>XPackageTypeInfo</type>s.
94*cdf0e10cSrcweir
95*cdf0e10cSrcweir        @return
96*cdf0e10cSrcweir                supported <type>XPackageTypeInfo</type>s.
97*cdf0e10cSrcweir    */
98*cdf0e10cSrcweir    sequence<XPackageTypeInfo> getSupportedPackageTypes();
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir    /** creates a command channel to be used to asynchronously abort a command.
101*cdf0e10cSrcweir
102*cdf0e10cSrcweir        @return
103*cdf0e10cSrcweir                abort channel
104*cdf0e10cSrcweir    */
105*cdf0e10cSrcweir    com::sun::star::task::XAbortChannel createAbortChannel();
106*cdf0e10cSrcweir
107*cdf0e10cSrcweir    /** adds an UNO package.
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir        The properties argument is currently only used to suppress the license information
110*cdf0e10cSrcweir        for shared extensions.
111*cdf0e10cSrcweir
112*cdf0e10cSrcweir
113*cdf0e10cSrcweir        @param url
114*cdf0e10cSrcweir               package URL, must be UCB conform
115*cdf0e10cSrcweir        @param properties
116*cdf0e10cSrcweir               additional properties, for example, that the license is to be
117*cdf0e10cSrcweir               suppressed (if supported by the extension)
118*cdf0e10cSrcweir        @param mediaType
119*cdf0e10cSrcweir               media-type of package, empty string if to be detected
120*cdf0e10cSrcweir        @param xAbortChannel
121*cdf0e10cSrcweir               abort channel to asynchronously abort the adding process,
122*cdf0e10cSrcweir               or null
123*cdf0e10cSrcweir        @param xCmdEnv
124*cdf0e10cSrcweir               command environment for error and progress handling
125*cdf0e10cSrcweir        @return
126*cdf0e10cSrcweir               <type>XPackage</type> handle
127*cdf0e10cSrcweir    */
128*cdf0e10cSrcweir    XPackage addPackage( [in] string url,
129*cdf0e10cSrcweir                         [in] sequence<com::sun::star::beans::NamedValue> properties,
130*cdf0e10cSrcweir                         [in] string mediaType,
131*cdf0e10cSrcweir                         [in] com::sun::star::task::XAbortChannel xAbortChannel,
132*cdf0e10cSrcweir                         [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
133*cdf0e10cSrcweir        raises (DeploymentException,
134*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
135*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
136*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
137*cdf0e10cSrcweir
138*cdf0e10cSrcweir    /** adds an extension.
139*cdf0e10cSrcweir
140*cdf0e10cSrcweir        This copies the extension. If it was from the same repository,
141*cdf0e10cSrcweir        which is represented by this XPackageManager insterface, then
142*cdf0e10cSrcweir        nothing happens.
143*cdf0e10cSrcweir
144*cdf0e10cSrcweir        @param extension
145*cdf0e10cSrcweir
146*cdf0e10cSrcweir        @param xAbortChannel
147*cdf0e10cSrcweir               abort channel to asynchronously abort the adding process,
148*cdf0e10cSrcweir               or null
149*cdf0e10cSrcweir        @param xCmdEnv
150*cdf0e10cSrcweir               command environment for error and progress handling
151*cdf0e10cSrcweir        @return
152*cdf0e10cSrcweir               <type>XPackage</type> handle
153*cdf0e10cSrcweir    */
154*cdf0e10cSrcweir    XPackage importExtension( [in] XPackage extension,
155*cdf0e10cSrcweir                         [in] com::sun::star::task::XAbortChannel xAbortChannel,
156*cdf0e10cSrcweir                         [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
157*cdf0e10cSrcweir        raises (DeploymentException,
158*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
159*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
160*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
161*cdf0e10cSrcweir
162*cdf0e10cSrcweir    /** removes an UNO package.
163*cdf0e10cSrcweir
164*cdf0e10cSrcweir        @param identifier
165*cdf0e10cSrcweir               package identifier
166*cdf0e10cSrcweir        @param fileName
167*cdf0e10cSrcweir               package file name
168*cdf0e10cSrcweir        @param xAbortChannel
169*cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
170*cdf0e10cSrcweir               or null
171*cdf0e10cSrcweir        @param xCmdEnv
172*cdf0e10cSrcweir               command environment for error and progress handling
173*cdf0e10cSrcweir    */
174*cdf0e10cSrcweir    void removePackage( [in] string identifier,
175*cdf0e10cSrcweir                        [in] string fileName,
176*cdf0e10cSrcweir                        [in] com::sun::star::task::XAbortChannel xAbortChannel,
177*cdf0e10cSrcweir                        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
178*cdf0e10cSrcweir        raises (DeploymentException,
179*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
180*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
181*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
182*cdf0e10cSrcweir
183*cdf0e10cSrcweir    /** gets a deployed package.
184*cdf0e10cSrcweir
185*cdf0e10cSrcweir        @param identifier
186*cdf0e10cSrcweir               package identifier
187*cdf0e10cSrcweir        @param fileName
188*cdf0e10cSrcweir               package file name
189*cdf0e10cSrcweir        @param xCmdEnv
190*cdf0e10cSrcweir               command environment for error and progress handling
191*cdf0e10cSrcweir        @return
192*cdf0e10cSrcweir               <type>XPackage</type> handle
193*cdf0e10cSrcweir    */
194*cdf0e10cSrcweir    XPackage getDeployedPackage(
195*cdf0e10cSrcweir        [in] string identifier,
196*cdf0e10cSrcweir        [in] string fileName,
197*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
198*cdf0e10cSrcweir        raises (DeploymentException,
199*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
200*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
201*cdf0e10cSrcweir
202*cdf0e10cSrcweir    /** gets all currently deployed packages.
203*cdf0e10cSrcweir
204*cdf0e10cSrcweir        @param xAbortChannel
205*cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
206*cdf0e10cSrcweir               or null
207*cdf0e10cSrcweir        @param xCmdEnv
208*cdf0e10cSrcweir               command environment for error and progress handling
209*cdf0e10cSrcweir        @return
210*cdf0e10cSrcweir                all currently deployed packages
211*cdf0e10cSrcweir    */
212*cdf0e10cSrcweir    sequence<XPackage> getDeployedPackages(
213*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
214*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
215*cdf0e10cSrcweir        raises (DeploymentException,
216*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
217*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
218*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
219*cdf0e10cSrcweir
220*cdf0e10cSrcweir    /** Expert feature: erases the underlying registry cache and reinstalls
221*cdf0e10cSrcweir        all previously added packages.  Please keep in mind that all
222*cdf0e10cSrcweir        registration status get lost.
223*cdf0e10cSrcweir        <p>
224*cdf0e10cSrcweir        Please use this in case of suspected cache inconsistencies only.
225*cdf0e10cSrcweir        </p>
226*cdf0e10cSrcweir
227*cdf0e10cSrcweir        @param xAbortChannel
228*cdf0e10cSrcweir               abort channel to asynchronously abort the adding process
229*cdf0e10cSrcweir        @param xCmdEnv
230*cdf0e10cSrcweir               command environment for error and progress handling
231*cdf0e10cSrcweir    */
232*cdf0e10cSrcweir    void reinstallDeployedPackages(
233*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
234*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
235*cdf0e10cSrcweir        raises (DeploymentException,
236*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
237*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
238*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
239*cdf0e10cSrcweir
240*cdf0e10cSrcweir    /** indicates that this implementation cannot be used for tasks
241*cdf0e10cSrcweir        which require write access to the location where the extensions
242*cdf0e10cSrcweir        are installed.
243*cdf0e10cSrcweir        <p>
244*cdf0e10cSrcweir        Normally one would call a method and handle the exception
245*cdf0e10cSrcweir        if writing failed. However, a GUI interface may need to know beforehand
246*cdf0e10cSrcweir        if writing is allowed. For example, the Extension Manager dialog
247*cdf0e10cSrcweir        needs to enable / disable the Add button depending if the user has
248*cdf0e10cSrcweir        write permission. Only the XPackageManager implementation knows the
249*cdf0e10cSrcweir        location of the installed extensions. Therefore it is not possible
250*cdf0e10cSrcweir        to check &quot;externally&quot; for write permission.
251*cdf0e10cSrcweir        </p>
252*cdf0e10cSrcweir    */
253*cdf0e10cSrcweir    boolean isReadOnly();
254*cdf0e10cSrcweir
255*cdf0e10cSrcweir    /** synchronizes the extension database with the contents of the extensions
256*cdf0e10cSrcweir       folder.
257*cdf0e10cSrcweir
258*cdf0e10cSrcweir       Added extensions will be added to the database and removed extensions
259*cdf0e10cSrcweir       will be removed from the database.
260*cdf0e10cSrcweir
261*cdf0e10cSrcweir       @param xAddedExtension
262*cdf0e10cSrcweir            new extensions which may need to be registered.
263*cdf0e10cSrcweir
264*cdf0e10cSrcweir       @param
265*cdf0e10cSrcweir            removed extensions which must be revoked
266*cdf0e10cSrcweir       @return
267*cdf0e10cSrcweir            If true - then at least one extension was removed or added. Otherwise
268*cdf0e10cSrcweir            nothing was chaned.
269*cdf0e10cSrcweir    */
270*cdf0e10cSrcweir    boolean synchronize([in] com::sun::star::task::XAbortChannel xAbortChannel,
271*cdf0e10cSrcweir                     [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
272*cdf0e10cSrcweir        raises (DeploymentException,
273*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
274*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException);
275*cdf0e10cSrcweir
276*cdf0e10cSrcweir
277*cdf0e10cSrcweir    /** returns all extensions which are currently not in use
278*cdf0e10cSrcweir        because the user did not accept the license.
279*cdf0e10cSrcweir
280*cdf0e10cSrcweir        The function will not return any object for the user repository, because
281*cdf0e10cSrcweir        a user extension will not be kept in the user repository if its license
282*cdf0e10cSrcweir        is declined. Only extensions which are registered at start-up of OOo,
283*cdf0e10cSrcweir        that is, shared and bundled extensions, can be returned.
284*cdf0e10cSrcweir
285*cdf0e10cSrcweir        Extensions which allow the license to be suppressed, that is, it does not
286*cdf0e10cSrcweir        need to be displayed, and which are installed with the corresponding option,
287*cdf0e10cSrcweir        are also not returned.
288*cdf0e10cSrcweir    */
289*cdf0e10cSrcweir    sequence<XPackage> getExtensionsWithUnacceptedLicenses(
290*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
291*cdf0e10cSrcweir        raises (DeploymentException);
292*cdf0e10cSrcweir
293*cdf0e10cSrcweir    /** checks if the extension can be used.
294*cdf0e10cSrcweir
295*cdf0e10cSrcweir        The extension must be managed by this package manager, that is, it must
296*cdf0e10cSrcweir        be recorded in its database.  The package manager calls
297*cdf0e10cSrcweir        XPackage::checkPrerequisites and updates its data base with the
298*cdf0e10cSrcweir        result. The result, which is from <type>Prerequisites</type> will be
299*cdf0e10cSrcweir        returned.
300*cdf0e10cSrcweir     */
301*cdf0e10cSrcweir    long checkPrerequisites(
302*cdf0e10cSrcweir        [in] XPackage extension,
303*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
304*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
305*cdf0e10cSrcweir        raises (DeploymentException,
306*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
307*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
308*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
309*cdf0e10cSrcweir
310*cdf0e10cSrcweir};
311*cdf0e10cSrcweir
312*cdf0e10cSrcweir}; }; }; };
313*cdf0e10cSrcweir
314*cdf0e10cSrcweir#endif
315