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_XExtensionManager_idl
29*cdf0e10cSrcweir#define INCLUDED_com_sun_star_deployment_XExtensionManager_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*cdf0e10cSrcweirmodule com { module sun { module star { module deployment {
43*cdf0e10cSrcweir
44*cdf0e10cSrcweir/** The <type>XExtensionManager</type> interface is used to manage extensions
45*cdf0e10cSrcweir    in the user, shared and bundled repository.
46*cdf0e10cSrcweir
47*cdf0e10cSrcweir    @see ExtensionManager
48*cdf0e10cSrcweir    @since OOo 3.3
49*cdf0e10cSrcweir*/
50*cdf0e10cSrcweirinterface XExtensionManager
51*cdf0e10cSrcweir{
52*cdf0e10cSrcweir    /** interface to notify disposing
53*cdf0e10cSrcweir     */
54*cdf0e10cSrcweir    interface com::sun::star::lang::XComponent;
55*cdf0e10cSrcweir
56*cdf0e10cSrcweir    /** interface to notify changes of the set of deployed packages of
57*cdf0e10cSrcweir        this manager
58*cdf0e10cSrcweir    */
59*cdf0e10cSrcweir    interface com::sun::star::util::XModifyBroadcaster;
60*cdf0e10cSrcweir
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir    /** gets the supported <type>XPackageTypeInfo</type>s.
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir        @return
65*cdf0e10cSrcweir                supported <type>XPackageTypeInfo</type>s.
66*cdf0e10cSrcweir    */
67*cdf0e10cSrcweir    sequence<XPackageTypeInfo> getSupportedPackageTypes();
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir    /** creates a command channel to be used to asynchronously abort a command.
70*cdf0e10cSrcweir
71*cdf0e10cSrcweir        @return
72*cdf0e10cSrcweir                abort channel
73*cdf0e10cSrcweir    */
74*cdf0e10cSrcweir    com::sun::star::task::XAbortChannel createAbortChannel();
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir    /** adds an extension.
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir        The properties argument is currently only used to suppress the license information
79*cdf0e10cSrcweir        for shared extensions.
80*cdf0e10cSrcweir
81*cdf0e10cSrcweir        @param url
82*cdf0e10cSrcweir               package URL, must be UCB conform
83*cdf0e10cSrcweir        @param properties
84*cdf0e10cSrcweir               additional properties, for example, that the license is to be
85*cdf0e10cSrcweir               suppressed (if supported by the extension)
86*cdf0e10cSrcweir        @param repository
87*cdf0e10cSrcweir               the name of the repository
88*cdf0e10cSrcweir        @param xAbortChannel
89*cdf0e10cSrcweir               abort channel to asynchronously abort the adding process,
90*cdf0e10cSrcweir               or null
91*cdf0e10cSrcweir        @param xCmdEnv
92*cdf0e10cSrcweir               command environment for error and progress handling
93*cdf0e10cSrcweir        @return
94*cdf0e10cSrcweir               object representing the extension.
95*cdf0e10cSrcweir    */
96*cdf0e10cSrcweir    XPackage addExtension( [in] string url,
97*cdf0e10cSrcweir                           [in] sequence<com::sun::star::beans::NamedValue> properties,
98*cdf0e10cSrcweir                           [in] string repository,
99*cdf0e10cSrcweir                           [in] com::sun::star::task::XAbortChannel xAbortChannel,
100*cdf0e10cSrcweir                           [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
101*cdf0e10cSrcweir        raises (DeploymentException,
102*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
103*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
104*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir    /** removes an extension.
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir        @param identifier
109*cdf0e10cSrcweir               package identifier
110*cdf0e10cSrcweir        @param fileName
111*cdf0e10cSrcweir               package file name
112*cdf0e10cSrcweir        @param repository
113*cdf0e10cSrcweir               the name of the repository
114*cdf0e10cSrcweir        @param xAbortChannel
115*cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
116*cdf0e10cSrcweir               or null
117*cdf0e10cSrcweir        @param xCmdEnv
118*cdf0e10cSrcweir               command environment for error and progress handling
119*cdf0e10cSrcweir    */
120*cdf0e10cSrcweir    void removeExtension(
121*cdf0e10cSrcweir        [in] string identifier,
122*cdf0e10cSrcweir        [in] string fileName,
123*cdf0e10cSrcweir        [in] string repository,
124*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
125*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
126*cdf0e10cSrcweir        raises (DeploymentException,
127*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
128*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
129*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
130*cdf0e10cSrcweir
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir    /** enable an extension.
133*cdf0e10cSrcweir
134*cdf0e10cSrcweir        If the extension is not from the user repository then an
135*cdf0e10cSrcweir        IllegalArgumentException is thrown.
136*cdf0e10cSrcweir
137*cdf0e10cSrcweir        @param extension
138*cdf0e10cSrcweir               the extension which is to be enabled.
139*cdf0e10cSrcweir        @param xAbortChannel
140*cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
141*cdf0e10cSrcweir               or null
142*cdf0e10cSrcweir        @param xCmdEnv
143*cdf0e10cSrcweir               command environment for error and progress handling
144*cdf0e10cSrcweir    */
145*cdf0e10cSrcweir    void enableExtension(
146*cdf0e10cSrcweir        [in] XPackage extension,
147*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
148*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
149*cdf0e10cSrcweir        raises (DeploymentException,
150*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
151*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
152*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
153*cdf0e10cSrcweir
154*cdf0e10cSrcweir    /** disable an extension.
155*cdf0e10cSrcweir
156*cdf0e10cSrcweir        If the extension is not from the user repository then an
157*cdf0e10cSrcweir        IllegalArgumentException is thrown.
158*cdf0e10cSrcweir
159*cdf0e10cSrcweir        @param extension
160*cdf0e10cSrcweir               the extension which is to be disabled
161*cdf0e10cSrcweir        @param xAbortChannel
162*cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
163*cdf0e10cSrcweir               or null
164*cdf0e10cSrcweir        @param xCmdEnv
165*cdf0e10cSrcweir               command environment for error and progress handling
166*cdf0e10cSrcweir     */
167*cdf0e10cSrcweir    void  disableExtension(
168*cdf0e10cSrcweir        [in] XPackage extension,
169*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
170*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
171*cdf0e10cSrcweir        raises (DeploymentException,
172*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
173*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
174*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
175*cdf0e10cSrcweir
176*cdf0e10cSrcweir    /** gets all currently installed extensions, including disabled
177*cdf0e10cSrcweir        user extensions.
178*cdf0e10cSrcweir
179*cdf0e10cSrcweir        @param repository
180*cdf0e10cSrcweir               the repository from which the extensions are returned
181*cdf0e10cSrcweir        @param xAbortChannel
182*cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
183*cdf0e10cSrcweir               or null
184*cdf0e10cSrcweir        @param xCmdEnv
185*cdf0e10cSrcweir               command environment for error and progress handling
186*cdf0e10cSrcweir        @return
187*cdf0e10cSrcweir               all currently installed packages
188*cdf0e10cSrcweir    */
189*cdf0e10cSrcweir    sequence<XPackage> getDeployedExtensions(
190*cdf0e10cSrcweir        [in] string repository,
191*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
192*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
193*cdf0e10cSrcweir        raises (DeploymentException,
194*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
195*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
196*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
197*cdf0e10cSrcweir
198*cdf0e10cSrcweir
199*cdf0e10cSrcweir    /** gets an installed extensions.
200*cdf0e10cSrcweir
201*cdf0e10cSrcweir        @param repositroy
202*cdf0e10cSrcweir               the name of the repository
203*cdf0e10cSrcweir        @param identifier
204*cdf0e10cSrcweir               extension identifier
205*cdf0e10cSrcweir        @param fileName
206*cdf0e10cSrcweir               extension file name
207*cdf0e10cSrcweir        @param xCmdEnv
208*cdf0e10cSrcweir               command environment for error and progress handling
209*cdf0e10cSrcweir        @return
210*cdf0e10cSrcweir               <type>XPackage</type> object
211*cdf0e10cSrcweir    */
212*cdf0e10cSrcweir    XPackage getDeployedExtension(
213*cdf0e10cSrcweir        [in] string repository,
214*cdf0e10cSrcweir        [in] string identifier,
215*cdf0e10cSrcweir        [in] string fileName,
216*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
217*cdf0e10cSrcweir        raises (DeploymentException,
218*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
219*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
220*cdf0e10cSrcweir
221*cdf0e10cSrcweir    /** gets all extensions with the same identifer from all repositories.
222*cdf0e10cSrcweir
223*cdf0e10cSrcweir        The extension at the first position in the returned sequence represents
224*cdf0e10cSrcweir        the extension from the user repository. The next element is from the shared
225*cdf0e10cSrcweir        and the last one is from the bundled repository.
226*cdf0e10cSrcweir        If one repository does not contain this extension, then the respective
227*cdf0e10cSrcweir        element is a null reference.
228*cdf0e10cSrcweir    */
229*cdf0e10cSrcweir    sequence<XPackage> getExtensionsWithSameIdentifier(
230*cdf0e10cSrcweir        [in] string identifier,
231*cdf0e10cSrcweir        [in] string fileName,
232*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
233*cdf0e10cSrcweir        raises (DeploymentException,
234*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
235*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
236*cdf0e10cSrcweir
237*cdf0e10cSrcweir
238*cdf0e10cSrcweir    /** returns a sequence containing all installed extensions.
239*cdf0e10cSrcweir
240*cdf0e10cSrcweir        The members of the returned sequence correspond to an extension with a
241*cdf0e10cSrcweir        particular extension identifer. The members are also sequences which
242*cdf0e10cSrcweir        contain as many elements as there are repositories. Those are ordered
243*cdf0e10cSrcweir        according to the priority of the repository. That is, the first member
244*cdf0e10cSrcweir        is the extension from the user repository, the second is from the shared
245*cdf0e10cSrcweir        repository and the last is from the bundled repository.
246*cdf0e10cSrcweir     */
247*cdf0e10cSrcweir    sequence<sequence<XPackage> > getAllExtensions(
248*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
249*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
250*cdf0e10cSrcweir        raises (DeploymentException,
251*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
252*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
253*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
254*cdf0e10cSrcweir
255*cdf0e10cSrcweir
256*cdf0e10cSrcweir    /** Expert feature: erases the underlying registry cache and reinstalls
257*cdf0e10cSrcweir        all previously added extensions.  Please keep in mind that all
258*cdf0e10cSrcweir        registration status get lost.
259*cdf0e10cSrcweir        <p>
260*cdf0e10cSrcweir        Please use this in case of suspected cache inconsistencies only.
261*cdf0e10cSrcweir        </p>
262*cdf0e10cSrcweir        @param repositroy
263*cdf0e10cSrcweir               the name of the repository
264*cdf0e10cSrcweir        @param xAbortChannel
265*cdf0e10cSrcweir               abort channel to asynchronously abort the adding process
266*cdf0e10cSrcweir        @param xCmdEnv
267*cdf0e10cSrcweir               command environment for error and progress handling
268*cdf0e10cSrcweir    */
269*cdf0e10cSrcweir    void reinstallDeployedExtensions(
270*cdf0e10cSrcweir        [in] string repository,
271*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
272*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
273*cdf0e10cSrcweir        raises (DeploymentException,
274*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
275*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
276*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
277*cdf0e10cSrcweir
278*cdf0e10cSrcweir
279*cdf0e10cSrcweir    /** synchronizes the extension database with the contents of the extensions
280*cdf0e10cSrcweir       folder of shared and bundled extensinos.
281*cdf0e10cSrcweir
282*cdf0e10cSrcweir       Added extensions will be added to the database and removed extensions
283*cdf0e10cSrcweir       will be removed from the database.
284*cdf0e10cSrcweir       The active extensions are determined. That is, shared or bundled extensions
285*cdf0e10cSrcweir       are not necessaryly registered (<member>XPackage::registerPackage</member>).
286*cdf0e10cSrcweir
287*cdf0e10cSrcweir       @return
288*cdf0e10cSrcweir              If true - then at least one extension was removed or added. Otherwise
289*cdf0e10cSrcweir              nothing was chaned.
290*cdf0e10cSrcweir    */
291*cdf0e10cSrcweir    boolean synchronize(
292*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
293*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
294*cdf0e10cSrcweir        raises (DeploymentException,
295*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
296*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
297*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
298*cdf0e10cSrcweir
299*cdf0e10cSrcweir
300*cdf0e10cSrcweir    /** synchronizes the special bundled_prereg repository, which is based on
301*cdf0e10cSrcweir       the bundled extensions and has its registration data folder at
302*cdf0e10cSrcweir       $BUNDLED_EXTENSIONS_PREREG (for example openoffice.org3/share/prereg).
303*cdf0e10cSrcweir
304*cdf0e10cSrcweir       All bundled extensions are registered (<member>XPackage::registerPackage</member>).
305*cdf0e10cSrcweir       The active extensions are NOT determined, because this function only works
306*cdf0e10cSrcweir       with bundled extensions.
307*cdf0e10cSrcweir
308*cdf0e10cSrcweir       This function is intended to be called during the installation of OOo.
309*cdf0e10cSrcweir       OOo will copy parts of the registration data folder to the user installation at the
310*cdf0e10cSrcweir       first startup.
311*cdf0e10cSrcweir    */
312*cdf0e10cSrcweir
313*cdf0e10cSrcweir    void synchronizeBundledPrereg(
314*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
315*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
316*cdf0e10cSrcweir        raises (DeploymentException);
317*cdf0e10cSrcweir
318*cdf0e10cSrcweir
319*cdf0e10cSrcweir    /** returns all extensions which are currently not in use
320*cdf0e10cSrcweir        because the user did not accept the license.
321*cdf0e10cSrcweir
322*cdf0e10cSrcweir        The function will not return any object for the user repository, because
323*cdf0e10cSrcweir        a user extension will not be kept in the user repository if its license
324*cdf0e10cSrcweir        is declined. Only extensions which are registered at start-up of OOo,
325*cdf0e10cSrcweir        that is, shared and bundled extensions, can be returned.
326*cdf0e10cSrcweir
327*cdf0e10cSrcweir        Extensions which allow the license to be suppressed, that is, it does not
328*cdf0e10cSrcweir        need to be displayed, and which are installed with the corresponding option,
329*cdf0e10cSrcweir        are also not returned.
330*cdf0e10cSrcweir
331*cdf0e10cSrcweir        Extensions returned by this functions are not returned by
332*cdf0e10cSrcweir        <member>XExtensionManger::getDeployedExtension</member>
333*cdf0e10cSrcweir        <member>XExtensionManger::getDeployedExtensions</member>
334*cdf0e10cSrcweir        <member>XExtensionManger::getAllExtensions</member>
335*cdf0e10cSrcweir        <member>XExtensionManger::getExtensionsWithSameIdentifier</member>
336*cdf0e10cSrcweir    */
337*cdf0e10cSrcweir    sequence<XPackage> getExtensionsWithUnacceptedLicenses(
338*cdf0e10cSrcweir        [in] string repository,
339*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
340*cdf0e10cSrcweir        raises (DeploymentException,
341*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
342*cdf0e10cSrcweir
343*cdf0e10cSrcweir    /** check if all prerequisites for the extension are fulfilled
344*cdf0e10cSrcweir        and activates it, if possible.
345*cdf0e10cSrcweir    */
346*cdf0e10cSrcweir    long checkPrerequisitesAndEnable(
347*cdf0e10cSrcweir        [in] XPackage extension,
348*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
349*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
350*cdf0e10cSrcweir        raises (DeploymentException,
351*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
352*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
353*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
354*cdf0e10cSrcweir
355*cdf0e10cSrcweir    /** determines if the current user has write access to the extensions folder
356*cdf0e10cSrcweir        of the repository.
357*cdf0e10cSrcweir    */
358*cdf0e10cSrcweir    boolean isReadOnlyRepository([in] string repository);
359*cdf0e10cSrcweir};
360*cdf0e10cSrcweir
361*cdf0e10cSrcweir}; }; }; };
362*cdf0e10cSrcweir
363*cdf0e10cSrcweir#endif
364