1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10d1766043SAndrew Rist * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12d1766043SAndrew Rist * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19d1766043SAndrew Rist * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_frame_XDesktop_idl__ 24cdf0e10cSrcweir#define __com_sun_star_frame_XDesktop_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_frame_XTerminateListener_idl__ 31cdf0e10cSrcweir#include <com/sun/star/frame/XTerminateListener.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_container_XEnumerationAccess_idl__ 35cdf0e10cSrcweir#include <com/sun/star/container/XEnumerationAccess.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__ 39cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir#ifndef __com_sun_star_frame_XFrame_idl__ 43cdf0e10cSrcweir#include <com/sun/star/frame/XFrame.idl> 44cdf0e10cSrcweir#endif 45cdf0e10cSrcweir 46cdf0e10cSrcweir 47cdf0e10cSrcweir//============================================================================= 48cdf0e10cSrcweir 49cdf0e10cSrcweir module com { module sun { module star { module frame { 50cdf0e10cSrcweir 51cdf0e10cSrcweir//============================================================================= 52cdf0e10cSrcweir/** This is the main interface of a desktop service. 53cdf0e10cSrcweir 54cdf0e10cSrcweir <p> 55cdf0e10cSrcweir A desktop is an environment for components which can be viewed in 56cdf0e10cSrcweir frames. Frames are like frames in HTML framesets. This does not imply 57cdf0e10cSrcweir that a desktop can handle framesets; the frames may be top frames 58cdf0e10cSrcweir only. 59cdf0e10cSrcweir </p> 60cdf0e10cSrcweir 61cdf0e10cSrcweir @see Desktop 62cdf0e10cSrcweir */ 63cdf0e10cSrcweirpublished interface XDesktop: com::sun::star::uno::XInterface 64cdf0e10cSrcweir{ 65cdf0e10cSrcweir //------------------------------------------------------------------------- 66cdf0e10cSrcweir /** tries to terminate the desktop. 67cdf0e10cSrcweir 68cdf0e10cSrcweir <p> 69cdf0e10cSrcweir First, every terminate listener is called by his <member>XTerminateListener::queryTermination()</member> method. 70cdf0e10cSrcweir Throwing of a <type>TerminationVetoException</type> can break the termination process and the listener how has 71cdf0e10cSrcweir done that will be the new "controller" of the desktop lifetime. He should try to terminate it by himself after 72cdf0e10cSrcweir his own processes will be finished. 73cdf0e10cSrcweir If nobody disagree with the termination request, every listener will be called by his 74cdf0e10cSrcweir <member>XTerminateListener::notifyTermination()</member> method. 75cdf0e10cSrcweir </p> 76cdf0e10cSrcweir 77cdf0e10cSrcweir @return 78cdf0e10cSrcweir <TRUE/>if all listener agree with this request 79cdf0e10cSrcweir <br> 80cdf0e10cSrcweir <FALSE/>otherwise 81cdf0e10cSrcweir 82cdf0e10cSrcweir @see XTerminateListener 83cdf0e10cSrcweir @see TerminationVetoException 84cdf0e10cSrcweir */ 85cdf0e10cSrcweir boolean terminate(); 86cdf0e10cSrcweir 87cdf0e10cSrcweir //------------------------------------------------------------------------- 88cdf0e10cSrcweir /** registers an event listener to the desktop, which is called 89cdf0e10cSrcweir when the desktop is queried to terminate, and when it really 90cdf0e10cSrcweir terminates. 91cdf0e10cSrcweir 92cdf0e10cSrcweir @param Listener 93cdf0e10cSrcweir listener for termination events 94cdf0e10cSrcweir 95cdf0e10cSrcweir @see XDesktop::removeTerminateListener() 96cdf0e10cSrcweir */ 97cdf0e10cSrcweir [oneway] void addTerminateListener( [in] XTerminateListener Listener ); 98cdf0e10cSrcweir 99cdf0e10cSrcweir //------------------------------------------------------------------------- 100cdf0e10cSrcweir /** unregisters an event listener for termination events. 101cdf0e10cSrcweir 102cdf0e10cSrcweir @param Listener 103cdf0e10cSrcweir listener which wish to be deregistered 104cdf0e10cSrcweir 105cdf0e10cSrcweir @see XDesktop::addTerminateListener() 106cdf0e10cSrcweir */ 107cdf0e10cSrcweir [oneway] void removeTerminateListener( [in] XTerminateListener Listener ); 108cdf0e10cSrcweir 109cdf0e10cSrcweir //------------------------------------------------------------------------- 110cdf0e10cSrcweir /** provides read access to collection of all currently loaded components 111cdf0e10cSrcweir inside the frame tree 112cdf0e10cSrcweir 113cdf0e10cSrcweir <p> 114cdf0e10cSrcweir The component is, by definition, the model of the control which 115cdf0e10cSrcweir is loaded into a frame, or if no model exists, into the control 116cdf0e10cSrcweir itself. 117cdf0e10cSrcweir The service <type>Components</type> which is available from this 118cdf0e10cSrcweir method is a collection of all components of the desktop which are open 119cdf0e10cSrcweir within a frame of the desktop. 120cdf0e10cSrcweir </p> 121cdf0e10cSrcweir 122cdf0e10cSrcweir @returns 123cdf0e10cSrcweir the collection of all components 124cdf0e10cSrcweir 125cdf0e10cSrcweir @see Components 126cdf0e10cSrcweir */ 127cdf0e10cSrcweir com::sun::star::container::XEnumerationAccess getComponents(); 128cdf0e10cSrcweir 129cdf0e10cSrcweir //------------------------------------------------------------------------- 130cdf0e10cSrcweir /** provides read access to the component inside the tree which has the UI focus 131cdf0e10cSrcweir 132cdf0e10cSrcweir <p> 133cdf0e10cSrcweir Normally, the component is the model part of the 134cdf0e10cSrcweir active component. If no model exists it is the active controller 135cdf0e10cSrcweir (view) itself. 136cdf0e10cSrcweir </p> 137cdf0e10cSrcweir 138cdf0e10cSrcweir @returns 139cdf0e10cSrcweir the component within the desktop environment which has the UI focus. 140cdf0e10cSrcweir 141cdf0e10cSrcweir @see XDesktop::getCurrentFrame() 142cdf0e10cSrcweir */ 143cdf0e10cSrcweir com::sun::star::lang::XComponent getCurrentComponent(); 144cdf0e10cSrcweir 145cdf0e10cSrcweir //------------------------------------------------------------------------- 146*a893be29SPedro Giffuni /** provides read access to the frame which contains the current component 147cdf0e10cSrcweir 148cdf0e10cSrcweir @returns 149cdf0e10cSrcweir the frame of the component which has the 150*a893be29SPedro Giffuni UI focus within this desktop environment 151cdf0e10cSrcweir 152cdf0e10cSrcweir @see XDesktop::getCurrentComponent() 153cdf0e10cSrcweir */ 154cdf0e10cSrcweir XFrame getCurrentFrame(); 155cdf0e10cSrcweir}; 156cdf0e10cSrcweir 157cdf0e10cSrcweir//============================================================================= 158cdf0e10cSrcweir 159cdf0e10cSrcweir}; }; }; }; 160cdf0e10cSrcweir 161cdf0e10cSrcweir#endif 162