xref: /aoo41x/main/offapi/com/sun/star/frame/XDesktop.idl (revision cdf0e10c)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XDesktop_idl__
28*cdf0e10cSrcweir#define __com_sun_star_frame_XDesktop_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XTerminateListener_idl__
35*cdf0e10cSrcweir#include <com/sun/star/frame/XTerminateListener.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_container_XEnumerationAccess_idl__
39*cdf0e10cSrcweir#include <com/sun/star/container/XEnumerationAccess.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__
43*cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XFrame_idl__
47*cdf0e10cSrcweir#include <com/sun/star/frame/XFrame.idl>
48*cdf0e10cSrcweir#endif
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir//=============================================================================
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir module com {  module sun {  module star {  module frame {
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir//=============================================================================
56*cdf0e10cSrcweir/** This is the main interface of a desktop service.
57*cdf0e10cSrcweir
58*cdf0e10cSrcweir    <p>
59*cdf0e10cSrcweir    A desktop is an environment for components which can be viewed in
60*cdf0e10cSrcweir	frames. Frames are like frames in HTML framesets. This does not imply
61*cdf0e10cSrcweir	that a desktop can handle framesets; the frames may be top frames
62*cdf0e10cSrcweir	only.
63*cdf0e10cSrcweir    </p>
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir    @see Desktop
66*cdf0e10cSrcweir */
67*cdf0e10cSrcweirpublished interface XDesktop: com::sun::star::uno::XInterface
68*cdf0e10cSrcweir{
69*cdf0e10cSrcweir	//-------------------------------------------------------------------------
70*cdf0e10cSrcweir	/** tries to terminate the desktop.
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir        <p>
73*cdf0e10cSrcweir        First, every terminate listener is called by his <member>XTerminateListener::queryTermination()</member> method.
74*cdf0e10cSrcweir        Throwing of a <type>TerminationVetoException</type> can break the termination process and the listener how has
75*cdf0e10cSrcweir        done that will be the new "controller" of the desktop lifetime. He should try to terminate it by himself after
76*cdf0e10cSrcweir        his own processes will be finished.
77*cdf0e10cSrcweir        If nobody disagree with the termination request, every listener will be called by his
78*cdf0e10cSrcweir        <member>XTerminateListener::notifyTermination()</member> method.
79*cdf0e10cSrcweir        </p>
80*cdf0e10cSrcweir
81*cdf0e10cSrcweir        @return
82*cdf0e10cSrcweir            <TRUE/>if all listener agree with this request
83*cdf0e10cSrcweir            <br>
84*cdf0e10cSrcweir            <FALSE/>otherwise
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir        @see XTerminateListener
87*cdf0e10cSrcweir        @see TerminationVetoException
88*cdf0e10cSrcweir	 */
89*cdf0e10cSrcweir	boolean terminate();
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir	//-------------------------------------------------------------------------
92*cdf0e10cSrcweir	/** registers an event listener to the desktop, which is called
93*cdf0e10cSrcweir		when the desktop is queried to terminate, and when it really
94*cdf0e10cSrcweir		terminates.
95*cdf0e10cSrcweir
96*cdf0e10cSrcweir        @param Listener
97*cdf0e10cSrcweir            listener for termination events
98*cdf0e10cSrcweir
99*cdf0e10cSrcweir        @see XDesktop::removeTerminateListener()
100*cdf0e10cSrcweir	 */
101*cdf0e10cSrcweir    [oneway] void addTerminateListener( [in] XTerminateListener Listener );
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir	//-------------------------------------------------------------------------
104*cdf0e10cSrcweir    /** unregisters an event listener for termination events.
105*cdf0e10cSrcweir
106*cdf0e10cSrcweir        @param Listener
107*cdf0e10cSrcweir            listener which wish to be deregistered
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir        @see XDesktop::addTerminateListener()
110*cdf0e10cSrcweir	 */
111*cdf0e10cSrcweir    [oneway] void removeTerminateListener( [in] XTerminateListener Listener );
112*cdf0e10cSrcweir
113*cdf0e10cSrcweir	//-------------------------------------------------------------------------
114*cdf0e10cSrcweir    /** provides read access to collection of all currently loaded components
115*cdf0e10cSrcweir        inside the frame tree
116*cdf0e10cSrcweir
117*cdf0e10cSrcweir        <p>
118*cdf0e10cSrcweir        The component is, by definition, the model of the control which
119*cdf0e10cSrcweir        is loaded into a frame, or if no model exists, into the control
120*cdf0e10cSrcweir        itself.
121*cdf0e10cSrcweir        The service <type>Components</type> which is available from this
122*cdf0e10cSrcweir        method is a collection of all components of the desktop which are open
123*cdf0e10cSrcweir        within a frame of the desktop.
124*cdf0e10cSrcweir        </p>
125*cdf0e10cSrcweir
126*cdf0e10cSrcweir        @returns
127*cdf0e10cSrcweir            the collection of all components
128*cdf0e10cSrcweir
129*cdf0e10cSrcweir        @see Components
130*cdf0e10cSrcweir	 */
131*cdf0e10cSrcweir	com::sun::star::container::XEnumerationAccess getComponents();
132*cdf0e10cSrcweir
133*cdf0e10cSrcweir	//-------------------------------------------------------------------------
134*cdf0e10cSrcweir    /** provides read access to the component inside the tree which has the UI focus
135*cdf0e10cSrcweir
136*cdf0e10cSrcweir        <p>
137*cdf0e10cSrcweir        Normally, the component is the model part of the
138*cdf0e10cSrcweir        active component. If no model exists it is the active controller
139*cdf0e10cSrcweir        (view) itself.
140*cdf0e10cSrcweir        </p>
141*cdf0e10cSrcweir
142*cdf0e10cSrcweir        @returns
143*cdf0e10cSrcweir            the component within the desktop environment which has the UI focus.
144*cdf0e10cSrcweir
145*cdf0e10cSrcweir        @see XDesktop::getCurrentFrame()
146*cdf0e10cSrcweir	 */
147*cdf0e10cSrcweir	com::sun::star::lang::XComponent getCurrentComponent();
148*cdf0e10cSrcweir
149*cdf0e10cSrcweir	//-------------------------------------------------------------------------
150*cdf0e10cSrcweir    /** provides read access to the frame wich contains the current component
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir        @returns
153*cdf0e10cSrcweir            the frame of the component which has the
154*cdf0e10cSrcweir            UI focus within this desktop enviroment
155*cdf0e10cSrcweir
156*cdf0e10cSrcweir        @see XDesktop::getCurrentComponent()
157*cdf0e10cSrcweir	 */
158*cdf0e10cSrcweir    XFrame getCurrentFrame();
159*cdf0e10cSrcweir};
160*cdf0e10cSrcweir
161*cdf0e10cSrcweir//=============================================================================
162*cdf0e10cSrcweir
163*cdf0e10cSrcweir}; }; }; };
164*cdf0e10cSrcweir
165*cdf0e10cSrcweir#endif
166