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#ifndef __com_sun_star_frame_XSessionManagerListener_idl__
28#define __com_sun_star_frame_XSessionManagerListener_idl__
29
30#ifndef __com_sun_star_lang_XEventListener_idl__
31#include <com/sun/star/lang/XEventListener.idl>
32#endif
33//=============================================================================
34
35module com {  module sun {  module star {  module frame {
36
37    interface XSessionManagerListener : com::sun::star::lang::XEventListener
38    {
39
40        /** doSave gets called when a save event was issued by the session manager
41        the listener should do what is necessary to restore
42        the current state of the application
43
44        <p>If the listener desires to interact with the user
45        it must first issue a user interaction request and
46        only do so if interaction was granted</p>
47
48        <p>When the save request is processed (with or without
49        user interaction) the listener must call
50        <member>XSessionManagerClient::saveDone()</member>
51        on the session manager client service object.</p>
52
53        @param bShutdown
54        <TRUE/> if a shutdown is in progress,
55        <FALSE/> if just a save point was requested
56
57        @param bCancelable
58        <TRUE/> if a shutdown in progress can be canceled by the listener,
59        <FALSE/> else
60
61        <p>the listener may choose to ignore the <member>saveDone</member>
62        event in case no real shutdown is in progress. He
63        still has to call
64        <member>XSessionManagerClient::saveDone()</member>
65        in that case.</p>
66
67        @see XSessionManagerClient
68        @see XSessionManagerClient::saveDone()
69        */
70        [oneway] void doSave( [in] boolean bShutdown, [in] boolean bCancelable );
71
72        /** approveInteraction is called when an outstanding
73            interaction request was processed by the session manager
74
75        @param bInteractionGranted
76        If <FALSE/> the listener must not interact with the user.
77        If <TRUE/> the listener can interact with the user now.
78        After interaction the listener must call
79        <member>XSessionManagerClient::interactionDone</member>
80        on the session manager client service object.
81
82        @see XSessionManagerClient
83        @see XSessionManagerClient::interactionDone()
84        */
85        [oneway] void approveInteraction( [in] boolean bInteractionGranted );
86
87        /** shutdownCanceled is called when a shutdown was canceled by the user
88            The listener can cancel his saving operations. No
89            further interaction is necessary and further calls
90            on the session manager client service object will
91            be ignored.
92        */
93        [oneway] void shutdownCanceled();
94
95        /** returns true, if a session was restored
96        */
97        boolean doRestore();
98    };
99
100}; }; }; };
101
102
103#endif
104