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_XController_idl__
28#define __com_sun_star_frame_XController_idl__
29
30#ifndef __com_sun_star_lang_XComponent_idl__
31#include <com/sun/star/lang/XComponent.idl>
32#endif
33
34//=============================================================================
35
36 module com {  module sun {  module star {  module frame {
37
38 published interface XFrame;
39 published interface XModel;
40
41//=============================================================================
42/** With this interface, components viewed in a <type>Frame</type> can serve
43    events (by supplying dispatches).
44
45    @see XFrame
46    @see com::sun::star::awt::XWindow
47    @see XModel
48 */
49published interface XController: com::sun::star::lang::XComponent
50{
51	//-------------------------------------------------------------------------
52	/** is called to attach the controller with its managing frame.
53
54        @param Frame
55            the new owner frame of this controller
56	 */
57    void attachFrame( [in] XFrame Frame );
58
59	//-------------------------------------------------------------------------
60	/** is called to attach the controller to a new model.
61
62        @param Model
63            the new model for this controller
64
65        @return
66            <TRUE/>if attach was successfully
67            <br>
68            <FALSE/>otherwise
69	 */
70    boolean attachModel( [in] XModel Model );
71
72	//-------------------------------------------------------------------------
73	/** is called to prepare the controller for closing the view
74
75        @param Suspend
76            <TRUE/>force the controller to suspend his work
77            <FALSE/>try to reactivate the controller
78
79        @return
80            <TRUE/>if request was accepted and of course successfully finished
81            <br>
82            <FALSE/>otherwise
83	 */
84    boolean suspend( [in] boolean Suspend );
85
86	//-------------------------------------------------------------------------
87    /** provides access to current view status
88
89        @returns
90            set of data that can be used to restore the current view status
91            at later time by using <member>XController::restoreViewData()</member>
92	 */
93	any getViewData();
94
95	//-------------------------------------------------------------------------
96	/** restores the view status using the data gotten from a previous call to
97        <member>XController::getViewData()</member>.
98
99        @param Data
100            set of data to restore it
101	 */
102    void restoreViewData( [in] any Data );
103
104	//-------------------------------------------------------------------------
105    /** provides access to currently attached model
106
107        @returns
108            the currently attached model.
109	 */
110	XModel getModel();
111
112	//-------------------------------------------------------------------------
113    /** provides access to owner frame of this controller
114
115        @returns
116            the frame containing this controller.
117	 */
118	XFrame getFrame();
119};
120
121//=============================================================================
122
123}; }; }; };
124
125#endif
126