1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_frame_XController_idl__
24#define __com_sun_star_frame_XController_idl__
25
26#ifndef __com_sun_star_lang_XComponent_idl__
27#include <com/sun/star/lang/XComponent.idl>
28#endif
29
30//=============================================================================
31
32 module com {  module sun {  module star {  module frame {
33
34 published interface XFrame;
35 published interface XModel;
36
37//=============================================================================
38/** With this interface, components viewed in a <type>Frame</type> can serve
39    events (by supplying dispatches).
40
41    @see XFrame
42    @see com::sun::star::awt::XWindow
43    @see XModel
44 */
45published interface XController: com::sun::star::lang::XComponent
46{
47	//-------------------------------------------------------------------------
48	/** is called to attach the controller with its managing frame.
49
50        @param Frame
51            the new owner frame of this controller
52	 */
53    void attachFrame( [in] XFrame Frame );
54
55	//-------------------------------------------------------------------------
56	/** is called to attach the controller to a new model.
57
58        @param Model
59            the new model for this controller
60
61        @return
62            <TRUE/>if attach was successfully
63            <br>
64            <FALSE/>otherwise
65	 */
66    boolean attachModel( [in] XModel Model );
67
68	//-------------------------------------------------------------------------
69	/** is called to prepare the controller for closing the view
70
71        @param Suspend
72            <TRUE/>force the controller to suspend his work
73            <FALSE/>try to reactivate the controller
74
75        @return
76            <TRUE/>if request was accepted and of course successfully finished
77            <br>
78            <FALSE/>otherwise
79	 */
80    boolean suspend( [in] boolean Suspend );
81
82	//-------------------------------------------------------------------------
83    /** provides access to current view status
84
85        @returns
86            set of data that can be used to restore the current view status
87            at later time by using <member>XController::restoreViewData()</member>
88	 */
89	any getViewData();
90
91	//-------------------------------------------------------------------------
92	/** restores the view status using the data gotten from a previous call to
93        <member>XController::getViewData()</member>.
94
95        @param Data
96            set of data to restore it
97	 */
98    void restoreViewData( [in] any Data );
99
100	//-------------------------------------------------------------------------
101    /** provides access to currently attached model
102
103        @returns
104            the currently attached model.
105	 */
106	XModel getModel();
107
108	//-------------------------------------------------------------------------
109    /** provides access to owner frame of this controller
110
111        @returns
112            the frame containing this controller.
113	 */
114	XFrame getFrame();
115};
116
117//=============================================================================
118
119}; }; }; };
120
121#endif
122