1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_embed_InstanceLocker_idl__
21 #define __com_sun_star_embed_InstanceLocker_idl__
23 #include
<com
/sun
/star
/lang
/XComponent.idl
>
24 #include
<com
/sun
/star
/uno
/XInterface.idl
>
25 #include
<com
/sun
/star
/embed
/XActionsApproval.idl
>
26 #include
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
27 #include
<com
/sun
/star
/frame
/DoubleInitializationException.idl
>
29 module com
{ module sun
{ module star
{ module embed
{
31 /** The main task of this service is to prevent closing, terminating and/or
32 etc. of controlled object.
35 After creation the service adds a listener of requested type
36 ( close, terminate and/or etc. ) to the controlled object and let
37 the listener throw related veto exception until the service is disposed.
40 published service InstanceLocker
: com
::sun
::star
::lang
::XComponent
42 /** is used to initialize the object on it's creation.
45 the controlled object. Must implement the related to the
46 requested actions broadcaster interface.
49 specifies the actions that should be done ( prevent closing,
50 prevent termination and/or etc. ). It must not be empty and can
51 currently contain following values or their combination:
52 Actions::PREVENT_CLOSE and
53 Actions::PREVENT_TERMINATION.
55 InstanceLockerCtor1
( [in] com
::sun
::star
::uno
::XInterface xInstance
,
57 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
58 ::com
::sun
::star
::frame
::DoubleInitializationException
,
59 ::com
::sun
::star
::uno
::Exception
);
61 /** is used to initialize the object on it's creation.
64 the controlled object. Must implement the related to the
65 requested actions broadcaster interface.
68 specifies the actions that should be done ( prevent closing,
69 prevent termination and/or etc. ). It must not be empty and can
70 currently contain following values or their combination:
71 Actions::PREVENT_CLOSE and
72 Actions::PREVENT_TERMINATION.
75 The object implementing XActionsApproval interface.
76 If this parameter is an empty reference the object will proceed
77 with the specified in the first parameter action until it is
78 disposed ( just like in the case of the first constructor ).
79 If the instance is provided, it will be asked for approval each
80 time before proceeding with the action ( the action is
81 specified using string and can take following
82 values in this case: "PreventClose", "PreventTermination" ).
84 InstanceLockerCtor2
( [in] com
::sun
::star
::uno
::XInterface xInstance
,
86 [in] XActionsApproval xApprove
)
87 raises
( ::com
::sun
::star
::lang
::IllegalArgumentException
,
88 ::com
::sun
::star
::frame
::DoubleInitializationException
,
89 ::com
::sun
::star
::uno
::Exception
);
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */