1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _com_sun_star_deployment_XPackageManager_idl
21 #define _com_sun_star_deployment_XPackageManager_idl
23 #include
<com
/sun
/star
/lang
/XComponent.idl
>
24 #include
<com
/sun
/star
/task
/XAbortChannel.idl
>
25 #include
<com
/sun
/star
/util
/XModifyBroadcaster.idl
>
26 #include
<com
/sun
/star
/deployment
/XPackage.idl
>
27 #include
<com
/sun
/star
/deployment
/XPackageTypeInfo.idl
>
28 #include
<com
/sun
/star
/ucb
/XCommandEnvironment.idl
>
29 #include
<com
/sun
/star
/deployment
/DeploymentException.idl
>
30 #include
<com
/sun
/star
/container
/NoSuchElementException.idl
>
31 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
32 #include
<com
/sun
/star
/beans
/NamedValue.idl
>
35 module com
{ module sun
{ module star
{ module deployment
{
37 /** The XPackageManager interface is used to add or remove
38 packages to a specific repository. This interface represents a particular
40 Packages are deployable files, e.g. scripts or UNO components.
42 Adding an UNO package means that a copy of the package is stored
46 Removing an UNO package means that the previously added package is
47 removed from the repository.
50 All interface methods do neither register nor revoke an extension.
51 This happens exclusively by XExtensionManager.
54 Objects of this interface are created using the
55 XPackageManagerFactory service resp. the singleton
57 /singletons/com.sun.star.deployment.thePackageManagerFactory
61 @see thePackageManagerFactory
64 Use XExtensionManager.
66 interface XPackageManager
68 /** interface to notify disposing
70 interface com
::sun
::star
::lang
::XComponent
;
72 /** interface to notify changes of the set of deployed packages of
75 interface com
::sun
::star
::util
::XModifyBroadcaster
;
77 /** returns the underlying deployment context, that is,
78 the name of the repository.
81 underlying deployment context
85 /** gets the supported XPackageTypeInfos.
88 supported XPackageTypeInfos.
90 sequence
<XPackageTypeInfo
> getSupportedPackageTypes
();
92 /** creates a command channel to be used to asynchronously abort a command.
97 com
::sun
::star
::task
::XAbortChannel createAbortChannel
();
99 /** adds an UNO package.
101 The properties argument is currently only used to suppress the license information
102 for shared extensions.
106 package URL, must be UCB conform
108 additional properties, for example, that the license is to be
109 suppressed (if supported by the extension)
111 media-type of package, empty string if to be detected
113 abort channel to asynchronously abort the adding process,
116 command environment for error and progress handling
120 XPackage addPackage
( [in] string url
,
121 [in] sequence
<com
::sun
::star
::beans
::NamedValue
> properties
,
122 [in] string mediaType
,
123 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
124 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
125 raises
(DeploymentException
,
126 com
::sun
::star
::ucb
::CommandFailedException
,
127 com
::sun
::star
::ucb
::CommandAbortedException
,
128 com
::sun
::star
::lang
::IllegalArgumentException
);
130 /** adds an extension.
132 This copies the extension. If it was from the same repository,
133 which is represented by this XPackageManager interface, then
139 abort channel to asynchronously abort the adding process,
142 command environment for error and progress handling
146 XPackage importExtension
( [in] XPackage extension
,
147 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
148 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
149 raises
(DeploymentException
,
150 com
::sun
::star
::ucb
::CommandFailedException
,
151 com
::sun
::star
::ucb
::CommandAbortedException
,
152 com
::sun
::star
::lang
::IllegalArgumentException
);
154 /** removes an UNO package.
161 abort channel to asynchronously abort the removing process,
164 command environment for error and progress handling
166 void removePackage
( [in] string identifier
,
167 [in] string fileName
,
168 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
169 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
170 raises
(DeploymentException
,
171 com
::sun
::star
::ucb
::CommandFailedException
,
172 com
::sun
::star
::ucb
::CommandAbortedException
,
173 com
::sun
::star
::lang
::IllegalArgumentException
);
175 /** gets a deployed package.
182 command environment for error and progress handling
186 XPackage getDeployedPackage
(
187 [in] string identifier
,
188 [in] string fileName
,
189 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
190 raises
(DeploymentException
,
191 com
::sun
::star
::ucb
::CommandFailedException
,
192 com
::sun
::star
::lang
::IllegalArgumentException
);
194 /** gets all currently deployed packages.
197 abort channel to asynchronously abort the removing process,
200 command environment for error and progress handling
202 all currently deployed packages
204 sequence
<XPackage
> getDeployedPackages
(
205 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
206 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
207 raises
(DeploymentException
,
208 com
::sun
::star
::ucb
::CommandFailedException
,
209 com
::sun
::star
::ucb
::CommandAbortedException
,
210 com
::sun
::star
::lang
::IllegalArgumentException
);
212 /** Expert feature: erases the underlying registry cache and reinstalls
213 all previously added packages. Please keep in mind that all
214 registration status get lost.
216 Please use this in case of suspected cache inconsistencies only.
220 set to true when called during soffice bootstrap after cleaning
223 abort channel to asynchronously abort the adding process
225 command environment for error and progress handling
227 void reinstallDeployedPackages
(
229 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
230 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
231 raises
(DeploymentException
,
232 com
::sun
::star
::ucb
::CommandFailedException
,
233 com
::sun
::star
::ucb
::CommandAbortedException
,
234 com
::sun
::star
::lang
::IllegalArgumentException
);
236 /** indicates that this implementation cannot be used for tasks
237 which require write access to the location where the extensions
240 Normally one would call a method and handle the exception
241 if writing failed. However, a GUI interface may need to know beforehand
242 if writing is allowed. For example, the Extension Manager dialog
243 needs to enable / disable the Add button depending if the user has
244 write permission. Only the XPackageManager implementation knows the
245 location of the installed extensions. Therefore it is not possible
246 to check "externally" for write permission.
249 boolean isReadOnly
();
251 /** synchronizes the extension database with the contents of the extensions
254 Added extensions will be added to the database and removed extensions
255 will be removed from the database.
258 abort channel to asynchronously abort the adding process
260 command environment for error and progress handling
263 If true - then at least one extension was removed or added. Otherwise
266 boolean synchronize
([in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
267 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
268 raises
(DeploymentException
,
269 com
::sun
::star
::ucb
::ContentCreationException
,
270 com
::sun
::star
::ucb
::CommandFailedException
,
271 com
::sun
::star
::ucb
::CommandAbortedException
);
274 /** returns all extensions which are currently not in use
275 because the user did not accept the license.
277 The function will not return any object for the user repository, because
278 a user extension will not be kept in the user repository if its license
279 is declined. Only extensions which are registered at start-up of OOo,
280 that is, shared and bundled extensions, can be returned.
282 Extensions which allow the license to be suppressed, that is, it does not
283 need to be displayed, and which are installed with the corresponding option,
284 are also not returned.
286 sequence
<XPackage
> getExtensionsWithUnacceptedLicenses
(
287 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
288 raises
(DeploymentException
);
290 /** checks if the extension can be used.
292 The extension must be managed by this package manager, that is, it must
293 be recorded in its database. The package manager calls
294 XPackage::checkPrerequisites and updates its data base with the
295 result. The result, which is from Prerequisites will be
298 long checkPrerequisites
(
299 [in] XPackage extension
,
300 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
301 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
302 raises
(DeploymentException
,
303 com
::sun
::star
::ucb
::CommandFailedException
,
304 com
::sun
::star
::ucb
::CommandAbortedException
,
305 com
::sun
::star
::lang
::IllegalArgumentException
);
313 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */