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#ifndef __com_sun_star_embed_XLinkageSupport_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_embed_XLinkageSupport_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XStorage_idl__ 35*cdf0e10cSrcweir#include <com/sun/star/embed/XStorage.idl> 36*cdf0e10cSrcweir#endif 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XCommonEmbedPersist_idl__ 39*cdf0e10cSrcweir#include <com/sun/star/embed/XCommonEmbedPersist.idl> 40*cdf0e10cSrcweir#endif 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__ 43*cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl> 44*cdf0e10cSrcweir#endif 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir#ifndef __com_sun_star_embed_WrongStateException_idl__ 47*cdf0e10cSrcweir#include <com/sun/star/embed/WrongStateException.idl> 48*cdf0e10cSrcweir#endif 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir//============================================================================ 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir module com { module sun { module star { module embed { 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir//============================================================================ 55*cdf0e10cSrcweir/** specifies an additional implementation for linked embedded object support. 56*cdf0e10cSrcweir */ 57*cdf0e10cSrcweirpublished interface XLinkageSupport: XCommonEmbedPersist 58*cdf0e10cSrcweir{ 59*cdf0e10cSrcweir //------------------------------------------------------------------------ 60*cdf0e10cSrcweir /** breaks the link and provides the object with a parent storage and a 61*cdf0e10cSrcweir name for object's entry 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir <p> 64*cdf0e10cSrcweir This method can be used only for links implementations that implement 65*cdf0e10cSrcweir the whole set of embedded object interfaces. Usually the sets of 66*cdf0e10cSrcweir interfaces are the same for links and objects. An example of exception 67*cdf0e10cSrcweir from this are OOo links that do not implement 68*cdf0e10cSrcweir <type>XEmbedPersist</type> interface. For such cases the method will 69*cdf0e10cSrcweir throw an exception. 70*cdf0e10cSrcweir </p> 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir <p> 73*cdf0e10cSrcweir The link will be broken and the linked object will become a normal 74*cdf0e10cSrcweir embedded object. 75*cdf0e10cSrcweir </p> 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir <p> 78*cdf0e10cSrcweir An entry with the specified name should be created\opened inside 79*cdf0e10cSrcweir provided storage. This entry will be used for the object persistence. 80*cdf0e10cSrcweir If the entry exists already all it's contents will be ignored. 81*cdf0e10cSrcweir </p> 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir @param xStorage 84*cdf0e10cSrcweir a parent storage the entry should be created\opened in 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir @param sEntryName 87*cdf0e10cSrcweir a name for the entry 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 90*cdf0e10cSrcweir one of arguments is illegal 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir @throws com::sun::star::embed::WrongStateException 93*cdf0e10cSrcweir the object is in wrong state or not a linked object 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir @throws com::sun::star::io::IOException 96*cdf0e10cSrcweir in case object has not persistence or other io problems 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir @throws com::sun::star::uno::Exception 99*cdf0e10cSrcweir in case of other problems 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir @see also XEmbedPersist::setPersistentEntry 102*cdf0e10cSrcweir */ 103*cdf0e10cSrcweir void breakLink( [in] ::com::sun::star::embed::XStorage xStorage, 104*cdf0e10cSrcweir [in] string sEntryName ) 105*cdf0e10cSrcweir raises( ::com::sun::star::lang::IllegalArgumentException, 106*cdf0e10cSrcweir ::com::sun::star::embed::WrongStateException, 107*cdf0e10cSrcweir ::com::sun::star::io::IOException, 108*cdf0e10cSrcweir ::com::sun::star::uno::Exception ); 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir //------------------------------------------------------------------------ 112*cdf0e10cSrcweir /** allows to detect whether the object is a linked one. 113*cdf0e10cSrcweir <p> 114*cdf0e10cSrcweir Most of embedded objects will not support this interface, but some 115*cdf0e10cSrcweir of them can do it, to allow conversion from link to object. After 116*cdf0e10cSrcweir the conversion the object does not change, so interface set staies the 117*cdf0e10cSrcweir same, but the object is not a link any more. 118*cdf0e10cSrcweir </p> 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir @return 121*cdf0e10cSrcweir <TRUE/> - the object is a linked one. 122*cdf0e10cSrcweir <FALSE/> - otherwise 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir @throws com::sun::star::embed::WrongStateException 125*cdf0e10cSrcweir the object is in wrong state 126*cdf0e10cSrcweir */ 127*cdf0e10cSrcweir boolean isLink() 128*cdf0e10cSrcweir raises( ::com::sun::star::embed::WrongStateException ); 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir //------------------------------------------------------------------------ 131*cdf0e10cSrcweir /** returns the URL of the link object. 132*cdf0e10cSrcweir 133*cdf0e10cSrcweir @throws com::sun::star::embed::WrongStateException 134*cdf0e10cSrcweir the object is in wrong state or is not a link 135*cdf0e10cSrcweir */ 136*cdf0e10cSrcweir string getLinkURL() 137*cdf0e10cSrcweir raises( ::com::sun::star::embed::WrongStateException, 138*cdf0e10cSrcweir ::com::sun::star::uno::Exception ); 139*cdf0e10cSrcweir}; 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir//============================================================================ 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir}; }; }; }; 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir#endif 146*cdf0e10cSrcweir 147