1/************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28#ifndef __com_sun_star_embed_InstanceLocker_idl__ 29#define __com_sun_star_embed_InstanceLocker_idl__ 30 31#ifndef __com_sun_star_lang_XComponent_idl__ 32#include <com/sun/star/lang/XComponent.idl> 33#endif 34#ifndef __com_sun_star_uno_XInterface_idl__ 35#include <com/sun/star/uno/XInterface.idl> 36#endif 37#ifndef __com_sun_star_embed_XActionsApproval_idl__ 38#include <com/sun/star/embed/XActionsApproval.idl> 39#endif 40#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 41#include <com/sun/star/lang/IllegalArgumentException.idl> 42#endif 43#ifndef __com_sun_star_frame_DoubleInitializationException_idl__ 44#include <com/sun/star/frame/DoubleInitializationException.idl> 45#endif 46 47//============================================================================= 48module com { module sun { module star { module embed { 49 50//----------------------------------------------------------------------------- 51/** The main task of this service is to prevent closing, terminating and/or 52 etc. of controlled object. 53 54 <p> 55 After creation the service adds a listener of requested type 56 ( close, terminate and/or etc. ) to the controlled object and let 57 the listener throw related veto exception until the service is disposed. 58 </p> 59*/ 60published service InstanceLocker : com::sun::star::lang::XComponent 61{ 62 /** is used to initialize the object on it's creation. 63 64 @param xInstance 65 the controlled object. Must implement the related to the 66 requested actions broadcaster interface. 67 68 @param nActions 69 specifies the actions that should be done ( prevent closing, 70 prevent termination and/or etc. ). It must not be empty and can 71 currently contain following values or their combination: 72 <type>Actions</type>::PREVENT_CLOSE and 73 <type>Actions</type>::PREVENT_TERMINATION. 74 */ 75 InstanceLockerCtor1( [in] com::sun::star::uno::XInterface xInstance, 76 [in] long nActions ) 77 raises( ::com::sun::star::lang::IllegalArgumentException, 78 ::com::sun::star::frame::DoubleInitializationException, 79 ::com::sun::star::uno::Exception ); 80 81 /** is used to initialize the object on it's creation. 82 83 @param xInstance 84 the controlled object. Must implement the related to the 85 requested actions broadcaster interface. 86 87 @param nActions 88 specifies the actions that should be done ( prevent closing, 89 prevent termination and/or etc. ). It must not be empty and can 90 currently contain following values or their combination: 91 <type>Actions</type>::PREVENT_CLOSE and 92 <type>Actions</type>::PREVENT_TERMINATION. 93 94 @param xApprove 95 The object implementing <type>XActionsApproval</type> interface. 96 If this parameter is an empty reference the object will proceed 97 with the specified in the first parameter action until it is 98 disposed ( just like in the case of the first constructor ). 99 If the instance is provided, it will be asked for approval each 100 time before proceeding with the action ( the action is 101 specified using <type>string</type> and can take following 102 values in this case: "PreventClose", "PreventTermination" ). 103 */ 104 InstanceLockerCtor2( [in] com::sun::star::uno::XInterface xInstance, 105 [in] long aActions, 106 [in] XActionsApproval xApprove ) 107 raises( ::com::sun::star::lang::IllegalArgumentException, 108 ::com::sun::star::frame::DoubleInitializationException, 109 ::com::sun::star::uno::Exception ); 110}; 111 112//============================================================================= 113 114}; }; }; }; 115 116#endif 117 118