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