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