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