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_XPackage_idl
29*cdf0e10cSrcweir#define INCLUDED_com_sun_star_deployment_XPackage_idl
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir#include <com/sun/star/beans/Optional.idl>
32*cdf0e10cSrcweir#include <com/sun/star/beans/Ambiguous.idl>
33*cdf0e10cSrcweir#include <com/sun/star/beans/StringPair.idl>
34*cdf0e10cSrcweir#include <com/sun/star/deployment/DeploymentException.idl>
35*cdf0e10cSrcweir#include <com/sun/star/deployment/XPackageTypeInfo.idl>
36*cdf0e10cSrcweir#include <com/sun/star/deployment/ExtensionRemovedException.idl>
37*cdf0e10cSrcweir#include <com/sun/star/graphic/XGraphic.idl>
38*cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
39*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
40*cdf0e10cSrcweir#include <com/sun/star/task/XAbortChannel.idl>
41*cdf0e10cSrcweir#include <com/sun/star/ucb/CommandFailedException.idl>
42*cdf0e10cSrcweir#include <com/sun/star/ucb/CommandAbortedException.idl>
43*cdf0e10cSrcweir#include <com/sun/star/ucb/XCommandEnvironment.idl>
44*cdf0e10cSrcweir#include <com/sun/star/util/XModifyBroadcaster.idl>
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir
47*cdf0e10cSrcweirmodule com { module sun { module star { module deployment {
48*cdf0e10cSrcweir
49*cdf0e10cSrcweir/** Objects of this interface reflect a bound package and are issued by a
50*cdf0e10cSrcweir    <type>PackageRegistryBackend</type>.
51*cdf0e10cSrcweir
52*cdf0e10cSrcweir    @since OOo 2.0
53*cdf0e10cSrcweir*/
54*cdf0e10cSrcweirinterface XPackage
55*cdf0e10cSrcweir{
56*cdf0e10cSrcweir    /** implemented to notify that the package has been removed
57*cdf0e10cSrcweir     */
58*cdf0e10cSrcweir    interface com::sun::star::lang::XComponent;
59*cdf0e10cSrcweir
60*cdf0e10cSrcweir    /** notifies changes of the registration state of the package
61*cdf0e10cSrcweir     */
62*cdf0e10cSrcweir    interface com::sun::star::util::XModifyBroadcaster;
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir    /** creates a command channel to be used to asynchronously abort a command.
66*cdf0e10cSrcweir
67*cdf0e10cSrcweir        @return
68*cdf0e10cSrcweir                abort channel
69*cdf0e10cSrcweir    */
70*cdf0e10cSrcweir    com::sun::star::task::XAbortChannel createAbortChannel();
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir    /** checks if the package can be installed.
73*cdf0e10cSrcweir
74*cdf0e10cSrcweir        Only if the return value is true the package is allowed to be installed.
75*cdf0e10cSrcweir        In case of false or in case of an exception, the package must be removed
76*cdf0e10cSrcweir        completely.
77*cdf0e10cSrcweir        After return of this function no code from the extension may be used
78*cdf0e10cSrcweir        anymore, so that the extension can be safely removed from the harddisk.
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir        @param xCmdEnv
81*cdf0e10cSrcweir               command environment for error handling and other interaction.
82*cdf0e10cSrcweir        @alreadyInstalled
83*cdf0e10cSrcweir            indicates that an extension with the same identifyer is already installed.
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir        @return
86*cdf0e10cSrcweir            null - all prerequisites are met. Otherwise, a value from
87*cdf0e10cSrcweir            <member>Prerequisites</member> indicating what prerequisites are missing.
88*cdf0e10cSrcweir     */
89*cdf0e10cSrcweir    long checkPrerequisites(
90*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
91*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv,
92*cdf0e10cSrcweir        [in] boolean alreadyInstalled)
93*cdf0e10cSrcweir        raises (DeploymentException,
94*cdf0e10cSrcweir                ExtensionRemovedException,
95*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
96*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException);
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir    /** checks if the dependencies for this package are still satisfied
99*cdf0e10cSrcweir
100*cdf0e10cSrcweir        After updateing the OpenOffice.org, some dependencies for packages might
101*cdf0e10cSrcweir        no longer be satisfied.
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir        @since OOo 3.2
104*cdf0e10cSrcweir
105*cdf0e10cSrcweir        @param xCmdEnv
106*cdf0e10cSrcweir               command environment for error handling and other interaction.
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir        @return
109*cdf0e10cSrcweir            true - all dependencies are satisfied
110*cdf0e10cSrcweir            false - at least one dependency failed.
111*cdf0e10cSrcweir     */
112*cdf0e10cSrcweir    boolean checkDependencies(
113*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
114*cdf0e10cSrcweir        raises (DeploymentException,
115*cdf0e10cSrcweir                ExtensionRemovedException,
116*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException);
117*cdf0e10cSrcweir
118*cdf0e10cSrcweir
119*cdf0e10cSrcweir    /** determines whether the package is currently is registered, i.e.
120*cdf0e10cSrcweir        whether it is active.
121*cdf0e10cSrcweir
122*cdf0e10cSrcweir        @param xAbortChannel
123*cdf0e10cSrcweir               abort channel to asynchronously abort the registration process,
124*cdf0e10cSrcweir               or null
125*cdf0e10cSrcweir        @param xCmdEnv
126*cdf0e10cSrcweir               command environment for error and progress handling
127*cdf0e10cSrcweir        @return
128*cdf0e10cSrcweir                status whether the package is registered (<TRUE/>, <FALSE/>) or
129*cdf0e10cSrcweir                the status is ambiguous.  Additionally, a registration status
130*cdf0e10cSrcweir                may not apply, e.g. in case of an empty package bundle.
131*cdf0e10cSrcweir    */
132*cdf0e10cSrcweir    com::sun::star::beans::Optional<
133*cdf0e10cSrcweir        com::sun::star::beans::Ambiguous<boolean> > isRegistered(
134*cdf0e10cSrcweir            [in] com::sun::star::task::XAbortChannel xAbortChannel,
135*cdf0e10cSrcweir            [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
136*cdf0e10cSrcweir        raises (DeploymentException,
137*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
138*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException);
139*cdf0e10cSrcweir
140*cdf0e10cSrcweir    /** registers this <type>XPackage</type>.
141*cdf0e10cSrcweir
142*cdf0e10cSrcweir        NEVER call this directly. This is done by the extension manager if necessary.
143*cdf0e10cSrcweir
144*cdf0e10cSrcweir        @param startup
145*cdf0e10cSrcweir               indicates that registration is adapted to the particular
146*cdf0e10cSrcweir               startup scenario. That is, it is set to true, when called
147*cdf0e10cSrcweir               from <member>XExtensionManager::synchronize</member>
148*cdf0e10cSrcweir        @param xAbortChannel
149*cdf0e10cSrcweir               abort channel to asynchronously abort the registration process,
150*cdf0e10cSrcweir               or null
151*cdf0e10cSrcweir        @param xCmdEnv
152*cdf0e10cSrcweir               command environment for error and progress handling
153*cdf0e10cSrcweir    */
154*cdf0e10cSrcweir    void registerPackage(
155*cdf0e10cSrcweir        [in] boolean startup,
156*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
157*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
158*cdf0e10cSrcweir        raises (DeploymentException,
159*cdf0e10cSrcweir                ExtensionRemovedException,
160*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
161*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
162*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
163*cdf0e10cSrcweir
164*cdf0e10cSrcweir    /** revokes this <type>XPackage</type>.
165*cdf0e10cSrcweir
166*cdf0e10cSrcweir        NEVER call this directly. This is done by the extension manager if necessary.
167*cdf0e10cSrcweir
168*cdf0e10cSrcweir        @param xAbortChannel
169*cdf0e10cSrcweir               abort channel to asynchronously abort the registration process,
170*cdf0e10cSrcweir               or null
171*cdf0e10cSrcweir        @param xCmdEnv
172*cdf0e10cSrcweir               command environment for error and progress handling
173*cdf0e10cSrcweir    */
174*cdf0e10cSrcweir    void revokePackage(
175*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
176*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
177*cdf0e10cSrcweir        raises (DeploymentException,
178*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
179*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
180*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
181*cdf0e10cSrcweir
182*cdf0e10cSrcweir    /** reflects whether this package is a bundle of one or more packages,
183*cdf0e10cSrcweir        e.g. a zip (legacy) package file or a document hosting script packages.
184*cdf0e10cSrcweir
185*cdf0e10cSrcweir        @return
186*cdf0e10cSrcweir                in case this package relfects a package bundle
187*cdf0e10cSrcweir    */
188*cdf0e10cSrcweir    boolean isBundle();
189*cdf0e10cSrcweir
190*cdf0e10cSrcweir    /** Gets packages of the bundle.
191*cdf0e10cSrcweir
192*cdf0e10cSrcweir        If <member>isRemoved</member> returns true then getBundle may return an
193*cdf0e10cSrcweir        empty sequence in case the object is not registered.
194*cdf0e10cSrcweir
195*cdf0e10cSrcweir        @param xAbortChannel
196*cdf0e10cSrcweir               abort channel to asynchronously abort the registration process,
197*cdf0e10cSrcweir               or null
198*cdf0e10cSrcweir        @param xCmdEnv
199*cdf0e10cSrcweir               command environment for error and progress handling
200*cdf0e10cSrcweir        @return
201*cdf0e10cSrcweir                set of packages enclosed in this package
202*cdf0e10cSrcweir    */
203*cdf0e10cSrcweir    sequence<XPackage> getBundle(
204*cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
205*cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
206*cdf0e10cSrcweir        raises (DeploymentException,
207*cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
208*cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
209*cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
210*cdf0e10cSrcweir
211*cdf0e10cSrcweir    /** returns the file name of the package.
212*cdf0e10cSrcweir
213*cdf0e10cSrcweir        @return
214*cdf0e10cSrcweir                file name of the package
215*cdf0e10cSrcweir    */
216*cdf0e10cSrcweir    string getName();
217*cdf0e10cSrcweir
218*cdf0e10cSrcweir    /** returns the unique extension identifier.
219*cdf0e10cSrcweir
220*cdf0e10cSrcweir        @return
221*cdf0e10cSrcweir                the extension identifier (a
222*cdf0e10cSrcweir        <code>"org.openoffice.legacy."</code> one if the extension does not
223*cdf0e10cSrcweir        explicitly specify one), or an empty <code>Optional</code> if this
224*cdf0e10cSrcweir        package does not represent an extension
225*cdf0e10cSrcweir    */
226*cdf0e10cSrcweir    com::sun::star::beans::Optional<string> getIdentifier();
227*cdf0e10cSrcweir
228*cdf0e10cSrcweir    /** returns the textual version representation of the package.
229*cdf0e10cSrcweir
230*cdf0e10cSrcweir        A textual version representation is a finite string following the
231*cdf0e10cSrcweir        BNF<br/>
232*cdf0e10cSrcweir        version ::= [element ("." element)*]<br/>
233*cdf0e10cSrcweir        element ::= ("0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9")+
234*cdf0e10cSrcweir
235*cdf0e10cSrcweir        @return
236*cdf0e10cSrcweir                the textual version representation
237*cdf0e10cSrcweir    */
238*cdf0e10cSrcweir    string getVersion()
239*cdf0e10cSrcweir        raises (ExtensionRemovedException);
240*cdf0e10cSrcweir
241*cdf0e10cSrcweir    /** returns the location of the package.
242*cdf0e10cSrcweir
243*cdf0e10cSrcweir        @return
244*cdf0e10cSrcweir                location of package
245*cdf0e10cSrcweir    */
246*cdf0e10cSrcweir    string getURL();
247*cdf0e10cSrcweir
248*cdf0e10cSrcweir    /** returns the display name of the package, e.g. for graphical user
249*cdf0e10cSrcweir        interfaces (GUI).
250*cdf0e10cSrcweir
251*cdf0e10cSrcweir        @return
252*cdf0e10cSrcweir                display name of the package
253*cdf0e10cSrcweir    */
254*cdf0e10cSrcweir    string getDisplayName()
255*cdf0e10cSrcweir        raises (ExtensionRemovedException);
256*cdf0e10cSrcweir
257*cdf0e10cSrcweir    /** returns a description string to describe the  package.
258*cdf0e10cSrcweir
259*cdf0e10cSrcweir        @return
260*cdf0e10cSrcweir                description
261*cdf0e10cSrcweir    */
262*cdf0e10cSrcweir    string getDescription()
263*cdf0e10cSrcweir         raises (ExtensionRemovedException);
264*cdf0e10cSrcweir
265*cdf0e10cSrcweir    /** returns a string containing the license text.
266*cdf0e10cSrcweir
267*cdf0e10cSrcweir        @return
268*cdf0e10cSrcweir                license
269*cdf0e10cSrcweir    */
270*cdf0e10cSrcweir    string getLicenseText()
271*cdf0e10cSrcweir         raises (ExtensionRemovedException);
272*cdf0e10cSrcweir
273*cdf0e10cSrcweir    /** returns a sequence of update information URLs.
274*cdf0e10cSrcweir
275*cdf0e10cSrcweir        The sequence may be empty in case no update information is available.
276*cdf0e10cSrcweir        If the sequence contains more than one URL, the extra URLs must mirror
277*cdf0e10cSrcweir        the information available at the first URL.
278*cdf0e10cSrcweir
279*cdf0e10cSrcweir        @return
280*cdf0e10cSrcweir                update information URLs
281*cdf0e10cSrcweir    */
282*cdf0e10cSrcweir    sequence<string> getUpdateInformationURLs()
283*cdf0e10cSrcweir        raises (ExtensionRemovedException);
284*cdf0e10cSrcweir    /** returns the publisher info for a package, the strings
285*cdf0e10cSrcweir        might be empty, if there are no publisher
286*cdf0e10cSrcweir
287*cdf0e10cSrcweir        <type scope="::com::sun::star::beans">StringPair</type>::First
288*cdf0e10cSrcweir        represents the publisher name and
289*cdf0e10cSrcweir        <type scope="::com::sun::star::beans">StringPair</type>::Second
290*cdf0e10cSrcweir        represents the URL to the publisher.
291*cdf0e10cSrcweir    */
292*cdf0e10cSrcweir
293*cdf0e10cSrcweir    ::com::sun::star::beans::StringPair getPublisherInfo()
294*cdf0e10cSrcweir        raises (ExtensionRemovedException);
295*cdf0e10cSrcweir    /** returns the <type>XPackageTypeInfo</type>, e.g. media-type etc.
296*cdf0e10cSrcweir
297*cdf0e10cSrcweir        @return
298*cdf0e10cSrcweir                media type of package
299*cdf0e10cSrcweir    */
300*cdf0e10cSrcweir    XPackageTypeInfo getPackageType();
301*cdf0e10cSrcweir
302*cdf0e10cSrcweir    /** exports package to given destination URL.
303*cdf0e10cSrcweir
304*cdf0e10cSrcweir        @param destFolderURL
305*cdf0e10cSrcweir               package destination folder URL, must be UCB conform
306*cdf0e10cSrcweir        @param newTitle
307*cdf0e10cSrcweir               new package name
308*cdf0e10cSrcweir        @param nameClashAction
309*cdf0e10cSrcweir               one of <type scope="com::sun::star::ucb">NameClash</type>
310*cdf0e10cSrcweir        @param xCmdEnv
311*cdf0e10cSrcweir               command environment for error and progress handling
312*cdf0e10cSrcweir    */
313*cdf0e10cSrcweir    void exportTo( [in] string destFolderURL,
314*cdf0e10cSrcweir                   [in] string newTitle,
315*cdf0e10cSrcweir                   [in] long nameClashAction,
316*cdf0e10cSrcweir                   [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
317*cdf0e10cSrcweir        raises (
318*cdf0e10cSrcweir            ExtensionRemovedException,
319*cdf0e10cSrcweir            com::sun::star::ucb::CommandFailedException,
320*cdf0e10cSrcweir            com::sun::star::ucb::CommandAbortedException);
321*cdf0e10cSrcweir
322*cdf0e10cSrcweir    /** returns an icon for a package.
323*cdf0e10cSrcweir
324*cdf0e10cSrcweir        @param highContrast
325*cdf0e10cSrcweir            return high contrast icon
326*cdf0e10cSrcweir        @return
327*cdf0e10cSrcweir            the icon which should be used to represent the table in the
328*cdf0e10cSrcweir            database application window, or <NULL/> if the default icon
329*cdf0e10cSrcweir            should be used.
330*cdf0e10cSrcweir    */
331*cdf0e10cSrcweir    com::sun::star::graphic::XGraphic getIcon( [in] boolean highContrast )
332*cdf0e10cSrcweir        raises (ExtensionRemovedException);
333*cdf0e10cSrcweir
334*cdf0e10cSrcweir    /** returns the name of the repository where this object comes from.
335*cdf0e10cSrcweir     */
336*cdf0e10cSrcweir    string getRepositoryName();
337*cdf0e10cSrcweir
338*cdf0e10cSrcweir    /** return a URL to a directory which contains the registration data.
339*cdf0e10cSrcweir
340*cdf0e10cSrcweir        This data may be created when calling
341*cdf0e10cSrcweir        <member>XPackage::registerPackage</member>.  If this is the case is
342*cdf0e10cSrcweir        indicated by <member
343*cdf0e10cSrcweir        scope="com::sun::star::beans">Optional::IsPresent</member> of the return
344*cdf0e10cSrcweir        value.
345*cdf0e10cSrcweir        If registration data are created during registration, but the package is
346*cdf0e10cSrcweir        currently not registered, for example after calling
347*cdf0e10cSrcweir        <member>XPackage::revokePackage</member>, then <member
348*cdf0e10cSrcweir        scope="com::sun::star::beans">Optional::IsPresent</member> is true and
349*cdf0e10cSrcweir        the <member scope="com::sun::star::beans">Optional::Value</member> may
350*cdf0e10cSrcweir        be an empty string.
351*cdf0e10cSrcweir    */
352*cdf0e10cSrcweir    com::sun::star::beans::Optional<string> getRegistrationDataURL()
353*cdf0e10cSrcweir        raises (ExtensionRemovedException);
354*cdf0e10cSrcweir
355*cdf0e10cSrcweir    /** indicates if this object represents a removed extension or extension
356*cdf0e10cSrcweir        item. This is the case when it was created by providing
357*cdf0e10cSrcweir        <code>true</code> for the <code>removed</code> parameter in the function
358*cdf0e10cSrcweir        <member>XPackageRegistry::bindPackage</member>.
359*cdf0e10cSrcweir     */
360*cdf0e10cSrcweir    boolean isRemoved();
361*cdf0e10cSrcweir
362*cdf0e10cSrcweir};
363*cdf0e10cSrcweir
364*cdf0e10cSrcweir}; }; }; };
365*cdf0e10cSrcweir
366*cdf0e10cSrcweir#endif
367