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 .
21 module com
{ module sun
{ module star
{ module deployment
{
23 /** The XPackageManager interface is used to add or remove
24 packages to a specific repository. This interface represents a particular
26 Packages are deployable files, e.g. scripts or UNO components.
28 Adding a UNO package means that a copy of the package is stored
32 Removing a UNO package means that the previously added package is
33 removed from the repository.
36 All interface methods do neither register nor revoke an extension.
37 This happens exclusively by XExtensionManager.
40 Objects of this interface are created using the
41 XPackageManagerFactory service resp. the singleton
43 /singletons/com.sun.star.deployment.thePackageManagerFactory
47 @see thePackageManagerFactory
50 Use XExtensionManager.
52 interface XPackageManager
54 /** interface to notify disposing
56 interface com
::sun
::star
::lang
::XComponent
;
58 /** interface to notify changes of the set of deployed packages of
61 interface com
::sun
::star
::util
::XModifyBroadcaster
;
63 /** returns the underlying deployment context, that is,
64 the name of the repository.
67 underlying deployment context
71 /** gets the supported XPackageTypeInfos.
74 supported XPackageTypeInfos.
76 sequence
<XPackageTypeInfo
> getSupportedPackageTypes
();
78 /** creates a command channel to be used to asynchronously abort a command.
83 com
::sun
::star
::task
::XAbortChannel createAbortChannel
();
85 /** adds a UNO package.
87 The properties argument is currently only used to suppress the license information
88 for shared extensions.
92 package URL, must be UCB conform
94 additional properties, for example, that the license is to be
95 suppressed (if supported by the extension)
97 media-type of package, empty string if to be detected
99 abort channel to asynchronously abort the adding process,
102 command environment for error and progress handling
106 XPackage addPackage
( [in] string url
,
107 [in] sequence
<com
::sun
::star
::beans
::NamedValue
> properties
,
108 [in] string mediaType
,
109 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
110 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
111 raises
(DeploymentException
,
112 com
::sun
::star
::ucb
::CommandFailedException
,
113 com
::sun
::star
::ucb
::CommandAbortedException
,
114 com
::sun
::star
::lang
::IllegalArgumentException
);
116 /** adds an extension.
118 This copies the extension. If it was from the same repository,
119 which is represented by this XPackageManager interface, then
125 abort channel to asynchronously abort the adding process,
128 command environment for error and progress handling
132 XPackage importExtension
( [in] XPackage extension
,
133 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
134 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
135 raises
(DeploymentException
,
136 com
::sun
::star
::ucb
::CommandFailedException
,
137 com
::sun
::star
::ucb
::CommandAbortedException
,
138 com
::sun
::star
::lang
::IllegalArgumentException
);
140 /** removes a UNO package.
147 abort channel to asynchronously abort the removing process,
150 command environment for error and progress handling
152 void removePackage
( [in] string identifier
,
153 [in] string fileName
,
154 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
155 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
156 raises
(DeploymentException
,
157 com
::sun
::star
::ucb
::CommandFailedException
,
158 com
::sun
::star
::ucb
::CommandAbortedException
,
159 com
::sun
::star
::lang
::IllegalArgumentException
);
161 /** gets a deployed package.
168 command environment for error and progress handling
172 XPackage getDeployedPackage
(
173 [in] string identifier
,
174 [in] string fileName
,
175 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
176 raises
(DeploymentException
,
177 com
::sun
::star
::ucb
::CommandFailedException
,
178 com
::sun
::star
::lang
::IllegalArgumentException
);
180 /** gets all currently deployed packages.
183 abort channel to asynchronously abort the removing process,
186 command environment for error and progress handling
188 all currently deployed packages
190 sequence
<XPackage
> getDeployedPackages
(
191 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
192 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
193 raises
(DeploymentException
,
194 com
::sun
::star
::ucb
::CommandFailedException
,
195 com
::sun
::star
::ucb
::CommandAbortedException
,
196 com
::sun
::star
::lang
::IllegalArgumentException
);
198 /** Expert feature: erases the underlying registry cache and reinstalls
199 all previously added packages. Please keep in mind that all
200 registration status get lost.
202 Please use this in case of suspected cache inconsistencies only.
206 set to true when called during soffice bootstrap after cleaning
209 abort channel to asynchronously abort the adding process
211 command environment for error and progress handling
213 void reinstallDeployedPackages
(
215 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
216 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
217 raises
(DeploymentException
,
218 com
::sun
::star
::ucb
::CommandFailedException
,
219 com
::sun
::star
::ucb
::CommandAbortedException
,
220 com
::sun
::star
::lang
::IllegalArgumentException
);
222 /** indicates that this implementation cannot be used for tasks
223 which require write access to the location where the extensions
226 Normally one would call a method and handle the exception
227 if writing failed. However, a GUI interface may need to know beforehand
228 if writing is allowed. For example, the Extensions dialog
229 needs to enable / disable the Add button depending if the user has
230 write permission. Only the XPackageManager implementation knows the
231 location of the installed extensions. Therefore it is not possible
232 to check "externally" for write permission.
235 boolean isReadOnly
();
237 /** synchronizes the extension database with the contents of the extensions
240 Added extensions will be added to the database and removed extensions
241 will be removed from the database.
244 abort channel to asynchronously abort the adding process
246 command environment for error and progress handling
249 If true - then at least one extension was removed or added. Otherwise
252 boolean synchronize
([in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
253 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
254 raises
(DeploymentException
,
255 com
::sun
::star
::ucb
::ContentCreationException
,
256 com
::sun
::star
::ucb
::CommandFailedException
,
257 com
::sun
::star
::ucb
::CommandAbortedException
);
260 /** returns all extensions which are currently not in use
261 because the user did not accept the license.
263 The function will not return any object for the user repository, because
264 a user extension will not be kept in the user repository if its license
265 is declined. Only extensions which are registered at start-up of OOo,
266 that is, shared and bundled extensions, can be returned.
268 Extensions which allow the license to be suppressed, that is, it does not
269 need to be displayed, and which are installed with the corresponding option,
270 are also not returned.
272 sequence
<XPackage
> getExtensionsWithUnacceptedLicenses
(
273 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
274 raises
(DeploymentException
);
276 /** checks if the extension can be used.
278 The extension must be managed by this package manager, that is, it must
279 be recorded in its database. The package manager calls
280 XPackage::checkPrerequisites and updates its data base with the
281 result. The result, which is from Prerequisites will be
284 long checkPrerequisites
(
285 [in] XPackage extension
,
286 [in] com
::sun
::star
::task
::XAbortChannel xAbortChannel
,
287 [in] com
::sun
::star
::ucb
::XCommandEnvironment xCmdEnv
)
288 raises
(DeploymentException
,
289 com
::sun
::star
::ucb
::CommandFailedException
,
290 com
::sun
::star
::ucb
::CommandAbortedException
,
291 com
::sun
::star
::lang
::IllegalArgumentException
);
297 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */