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_XPackageRegistry_idl 25cdf0e10cSrcweir#define INCLUDED_com_sun_star_deployment_XPackageRegistry_idl 26cdf0e10cSrcweir 27cdf0e10cSrcweir#include <com/sun/star/deployment/XPackage.idl> 28cdf0e10cSrcweir#include <com/sun/star/deployment/XPackageTypeInfo.idl> 29cdf0e10cSrcweir#include <com/sun/star/deployment/InvalidRemovedParameterException.idl> 30cdf0e10cSrcweir#include <com/sun/star/beans/StringPair.idl> 31cdf0e10cSrcweir 32cdf0e10cSrcweir 33cdf0e10cSrcweirmodule com { module sun { module star { module deployment { 34cdf0e10cSrcweir 35cdf0e10cSrcweir/** Interface to bind an UNO package. 36cdf0e10cSrcweir 37*34c958abSJürgen Schmidt @since OpenOffice 2.0 38cdf0e10cSrcweir*/ 39cdf0e10cSrcweirinterface XPackageRegistry 40cdf0e10cSrcweir{ 41cdf0e10cSrcweir /** binds a package URL to a <type>XPackage</type> handle. 42cdf0e10cSrcweir The returned UNO package handle ought to late-initialize itself, 43cdf0e10cSrcweir thus the process of binding must not be an expensive operation, because 44cdf0e10cSrcweir it is not abortable. 45cdf0e10cSrcweir 46cdf0e10cSrcweir Calling the function several time with the same parameters must result 47cdf0e10cSrcweir in returning the same object. 48cdf0e10cSrcweir 49cdf0e10cSrcweir The file or folder at the location where url points to may not exist or 50cdf0e10cSrcweir it was replaced. This can happen, for example, when a bundled extension 51cdf0e10cSrcweir was removed by the setup and a user later starts OOo. Then the user data 52cdf0e10cSrcweir may still contain all registration data of that extension, but the 53cdf0e10cSrcweir actual extension files do not exist anymore. The registration data must 54cdf0e10cSrcweir then be cleaned of all the remains of that extension. To to that one 55cdf0e10cSrcweir creates an <type>XPackage</type> object on behalf of that extension and 56cdf0e10cSrcweir calls <member>XPackage::revokePakage</member>. The parameter 57cdf0e10cSrcweir <code>removed</code> indicates this case. The returned object may not 58cdf0e10cSrcweir rely on the file or folder to which refers <code>url</url>. Instead it 59cdf0e10cSrcweir must use previously saved data to successfully carry out the revocation 60cdf0e10cSrcweir of this object (<member>XPackage::revokePackage</member>). 61cdf0e10cSrcweir 62cdf0e10cSrcweir The implementation must ensure that there is only one instance of 63cdf0e10cSrcweir <type>XPackage</type> for the same <code>url</code> at any 64cdf0e10cSrcweir time. Therefore calling <member>bindPackage</member> again with the same 65cdf0e10cSrcweir <code>url</code> but different <code>mediaType<code> (the exeption is, 66cdf0e10cSrcweir if previsously an empty string was proveded to cause the determination 67cdf0e10cSrcweir of the media type) or <code>removed</code> parameters will cause an 68cdf0e10cSrcweir exception. An <type 69cdf0e10cSrcweir scope="com::sun::star::lang">IllegalArgumentException</type> will be 70cdf0e10cSrcweir thrown in case of a different <code>mediaType</code> parameter and a 71cdf0e10cSrcweir <type>InvalidRemovedParameterException</type> is thrown if the 72cdf0e10cSrcweir <code>removed</code> parameter is different. 73cdf0e10cSrcweir 74cdf0e10cSrcweir The <code>identifier</code> parameter must be provided when 75cdf0e10cSrcweir <code>removed</code> = true. If not, then an <type 76cdf0e10cSrcweir scope="com::sun::star::lang">IllegalArgumentException</type> will be 77cdf0e10cSrcweir thrown. 78cdf0e10cSrcweir 79cdf0e10cSrcweir @param url 80cdf0e10cSrcweir package URL, must be UCB conform 81cdf0e10cSrcweir @param mediaType 82cdf0e10cSrcweir media type of package, empty string if to be detected 83cdf0e10cSrcweir @param removed 84cdf0e10cSrcweir 85cdf0e10cSrcweir @para unfulfilledPrerequisites 86cdf0e10cSrcweir has a value other null if the extension could not be installed previously 87cdf0e10cSrcweir because <member>XPackage::checkPrerequisites</member> failed. 88cdf0e10cSrcweir 89cdf0e10cSrcweir @param identifier 90cdf0e10cSrcweir the identifier of the extension 91cdf0e10cSrcweir 92cdf0e10cSrcweir @param xCmdEnv 93cdf0e10cSrcweir command environment for error and progress handling 94cdf0e10cSrcweir @return 95cdf0e10cSrcweir <type>XPackage</type> handle 96cdf0e10cSrcweir */ 97cdf0e10cSrcweir XPackage bindPackage( 98cdf0e10cSrcweir [in] string url, 99cdf0e10cSrcweir [in] string mediaType, 100cdf0e10cSrcweir [in] boolean removed, 101cdf0e10cSrcweir [in] string identifier, 102cdf0e10cSrcweir [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv ) 103cdf0e10cSrcweir raises (DeploymentException, 104cdf0e10cSrcweir InvalidRemovedParameterException, 105cdf0e10cSrcweir com::sun::star::ucb::CommandFailedException, 106cdf0e10cSrcweir com::sun::star::lang::IllegalArgumentException); 107cdf0e10cSrcweir 108cdf0e10cSrcweir /** gets the supported <type>XPackageTypeInfo</type>s. 109cdf0e10cSrcweir 110cdf0e10cSrcweir @return 111cdf0e10cSrcweir supported <type>XPackageTypeInfo</type>s. 112cdf0e10cSrcweir */ 113cdf0e10cSrcweir sequence<XPackageTypeInfo> getSupportedPackageTypes(); 114cdf0e10cSrcweir 115cdf0e10cSrcweir void packageRemoved( 116cdf0e10cSrcweir [in] string url, 117cdf0e10cSrcweir [in] string mediaType) 118cdf0e10cSrcweir raises (DeploymentException, 119cdf0e10cSrcweir com::sun::star::lang::IllegalArgumentException); 120cdf0e10cSrcweir 121cdf0e10cSrcweir}; 122cdf0e10cSrcweir 123cdf0e10cSrcweir}; }; }; }; 124cdf0e10cSrcweir 125cdf0e10cSrcweir#endif 126