xref: /aoo41x/main/offapi/com/sun/star/frame/XDesktop.idl (revision cdf0e10c)
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_XDesktop_idl__
28#define __com_sun_star_frame_XDesktop_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_frame_XTerminateListener_idl__
35#include <com/sun/star/frame/XTerminateListener.idl>
36#endif
37
38#ifndef __com_sun_star_container_XEnumerationAccess_idl__
39#include <com/sun/star/container/XEnumerationAccess.idl>
40#endif
41
42#ifndef __com_sun_star_lang_XComponent_idl__
43#include <com/sun/star/lang/XComponent.idl>
44#endif
45
46#ifndef __com_sun_star_frame_XFrame_idl__
47#include <com/sun/star/frame/XFrame.idl>
48#endif
49
50
51//=============================================================================
52
53 module com {  module sun {  module star {  module frame {
54
55//=============================================================================
56/** This is the main interface of a desktop service.
57
58    <p>
59    A desktop is an environment for components which can be viewed in
60	frames. Frames are like frames in HTML framesets. This does not imply
61	that a desktop can handle framesets; the frames may be top frames
62	only.
63    </p>
64
65    @see Desktop
66 */
67published interface XDesktop: com::sun::star::uno::XInterface
68{
69	//-------------------------------------------------------------------------
70	/** tries to terminate the desktop.
71
72        <p>
73        First, every terminate listener is called by his <member>XTerminateListener::queryTermination()</member> method.
74        Throwing of a <type>TerminationVetoException</type> can break the termination process and the listener how has
75        done that will be the new "controller" of the desktop lifetime. He should try to terminate it by himself after
76        his own processes will be finished.
77        If nobody disagree with the termination request, every listener will be called by his
78        <member>XTerminateListener::notifyTermination()</member> method.
79        </p>
80
81        @return
82            <TRUE/>if all listener agree with this request
83            <br>
84            <FALSE/>otherwise
85
86        @see XTerminateListener
87        @see TerminationVetoException
88	 */
89	boolean terminate();
90
91	//-------------------------------------------------------------------------
92	/** registers an event listener to the desktop, which is called
93		when the desktop is queried to terminate, and when it really
94		terminates.
95
96        @param Listener
97            listener for termination events
98
99        @see XDesktop::removeTerminateListener()
100	 */
101    [oneway] void addTerminateListener( [in] XTerminateListener Listener );
102
103	//-------------------------------------------------------------------------
104    /** unregisters an event listener for termination events.
105
106        @param Listener
107            listener which wish to be deregistered
108
109        @see XDesktop::addTerminateListener()
110	 */
111    [oneway] void removeTerminateListener( [in] XTerminateListener Listener );
112
113	//-------------------------------------------------------------------------
114    /** provides read access to collection of all currently loaded components
115        inside the frame tree
116
117        <p>
118        The component is, by definition, the model of the control which
119        is loaded into a frame, or if no model exists, into the control
120        itself.
121        The service <type>Components</type> which is available from this
122        method is a collection of all components of the desktop which are open
123        within a frame of the desktop.
124        </p>
125
126        @returns
127            the collection of all components
128
129        @see Components
130	 */
131	com::sun::star::container::XEnumerationAccess getComponents();
132
133	//-------------------------------------------------------------------------
134    /** provides read access to the component inside the tree which has the UI focus
135
136        <p>
137        Normally, the component is the model part of the
138        active component. If no model exists it is the active controller
139        (view) itself.
140        </p>
141
142        @returns
143            the component within the desktop environment which has the UI focus.
144
145        @see XDesktop::getCurrentFrame()
146	 */
147	com::sun::star::lang::XComponent getCurrentComponent();
148
149	//-------------------------------------------------------------------------
150    /** provides read access to the frame wich contains the current component
151
152        @returns
153            the frame of the component which has the
154            UI focus within this desktop enviroment
155
156        @see XDesktop::getCurrentComponent()
157	 */
158    XFrame getCurrentFrame();
159};
160
161//=============================================================================
162
163}; }; }; };
164
165#endif
166