1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XPackageManager.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #if
! defined INCLUDED_com_sun_star_deployment_XPackageManager_idl
32 #define INCLUDED_com_sun_star_deployment_XPackageManager_idl
34 #include
<com
/sun
/star
/lang
/XComponent.idl
>
35 #include
<com
/sun
/star
/task
/XAbortChannel.idl
>
36 #include
<com
/sun
/star
/util
/XModifyBroadcaster.idl
>
37 #include
<com
/sun
/star
/deployment
/XPackage.idl
>
38 #include
<com
/sun
/star
/deployment
/XPackageTypeInfo.idl
>
39 #include
<com
/sun
/star
/ucb
/XCommandEnvironment.idl
>
40 #include
<com
/sun
/star
/deployment
/DeploymentException.idl
>
41 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
42 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
45 module com
{ module sun
{ module star
{ module deployment
{
47 /** The <type>XPackageManager</type> interface is used to add or remove
48 packages to a specific deployment context.
49 Packages are deployable files, e.g. scripts or UNO components.
51 Adding an UNO package means that a copy of the package is stored
52 with respect to the context of the manager and the package is registered,
56 Removing an UNO package means that the previously added package is revoked,
57 thus deactivated, first and then removed from the context.
60 Objects of this interface are created using the
61 <type>XPackageManagerFactory</type> service resp. the singleton
63 /singletons/com.sun.star.deployment.thePackageManagerFactory
67 @see thePackageManagerFactory
70 interface XPackageManager
72 /** interface to notify disposing
74 interface com
::sun
::star
::lang
::XComponent
;
76 /** interface to notify changes of the set of deployed packages of
79 interface com
::sun
::star
::util
::XModifyBroadcaster
;
81 /** returns the underlying deployment context.
84 underlying deployment context
88 /** gets the supported <type>XPackageTypeInfo</type>s.
91 supported <type>XPackageTypeInfo</type>s.
93 sequence
<XPackageTypeInfo
> getSupportedPackageTypes
();
95 /** creates a command channel to be used to asynchronously abort a command.
100 com
::sun
::star
::task
::XAbortChannel createAbortChannel
();
102 /** adds an UNO package.
105 package URL, must be UCB conform
107 media-type of package, empty string if to be detected
109 abort channel to asynchronously abort the adding process,
112 command environment for error and progress handling
114 <type>XPackage</type> handle
116 XPackage addPackage
( [in] string url
,
117 [in] string mediaType
,
118 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
119 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
120 raises
(DeploymentException
,
121 com
::sun
::star
::ucb
::CommandFailedException
,
122 com
::sun
::star
::ucb
::CommandAbortedException
,
123 com
::sun
::star
::lang
::IllegalArgumentException
);
125 /** removes an UNO package.
132 abort channel to asynchronously abort the removing process,
135 command environment for error and progress handling
137 void removePackage
( [in] string identifier
,
138 [in] string fileName
,
139 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
140 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
141 raises
(DeploymentException
,
142 com
::sun
::star
::ucb
::CommandFailedException
,
143 com
::sun
::star
::ucb
::CommandAbortedException
,
144 com
::sun
::star
::lang
::IllegalArgumentException
);
146 /** gets a deployed package.
153 command environment for error and progress handling
155 <type>XPackage</type> handle
157 XPackage getDeployedPackage
(
158 [in] string identifier
,
159 [in] string fileName
,
160 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
161 raises
(DeploymentException
,
162 com
::sun
::star
::ucb
::CommandFailedException
,
163 com
::sun
::star
::lang
::IllegalArgumentException
);
165 /** gets all currently deployed packages.
168 abort channel to asynchronously abort the removing process,
171 command environment for error and progress handling
173 all currently deployed packages
175 sequence
<XPackage
> getDeployedPackages
(
176 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
177 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
178 raises
(DeploymentException
,
179 com
::sun
::star
::ucb
::CommandFailedException
,
180 com
::sun
::star
::ucb
::CommandAbortedException
,
181 com
::sun
::star
::lang
::IllegalArgumentException
);
183 /** Expert feature: erases the underlying registry cache and reinstalls
184 all previously added packages. Please keep in mind that all
185 registration status get lost.
187 Please use this in case of suspected cache inconsistencies only.
191 abort channel to asynchronously abort the adding process
193 command environment for error and progress handling
195 void reinstallDeployedPackages
(
196 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
197 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
198 raises
(DeploymentException
,
199 com
::sun
::star
::ucb
::CommandFailedException
,
200 com
::sun
::star
::ucb
::CommandAbortedException
,
201 com
::sun
::star
::lang
::IllegalArgumentException
);
203 /** indicates that this implementation cannot be used for tasks
204 which require write access to the location where the extensions
207 Normally one would call a method and handle the exception
208 if writing failed. However, a GUI interface may need to know beforehand
209 if writing is allowed. For example, the Extension Manager dialog
210 needs to enable / disable the Add button depending if the user has
211 write permission. Only the XPackageManager implementation knows the
212 location of the installed extensions. Therefore it is not possible
213 to check "externally" for write permission.
216 boolean isReadOnly
();