merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / frame / XFrame.idl
blobe74a15446d1e55c621a0ca7e624e35234806ab23
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_frame_XFrame_idl__
28 #define __com_sun_star_frame_XFrame_idl__
30 #ifndef __com_sun_star_lang_XComponent_idl__
31 #include <com/sun/star/lang/XComponent.idl>
32 #endif
34 #ifndef __com_sun_star_awt_XWindow_idl__
35 #include <com/sun/star/awt/XWindow.idl>
36 #endif
38 //=============================================================================
40 module com { module sun { module star { module frame {
42 published interface XFrameActionListener;
43 published interface XController;
44 published interface XFramesSupplier;
46 //=============================================================================
47 /** a frame object can be considered to be an "anchor" object where a component
48 can be attached to.
50 <p>
51 A frame can be (it's not a must!) a part of a frame tree. If not this frame willn't be
52 accessible by using the api. This mode make sense for previews.
53 The root node of the tree can be a <type>Desktop</type> implementation.
54 </p>
56 @see Desktop
58 published interface XFrame: com::sun::star::lang::XComponent
60 //-------------------------------------------------------------------------
61 /** is called to initialize the frame within a window - the container window.
63 <p>
64 This window will be used as parent for the component window and to support
65 some UI relevant features of the frame service.
66 Note: Re-parenting mustn't supported by a real frame implementation!
67 It's designed for initializing - not for setting.
68 </p>
70 <p>This frame will take over ownership of the window refered from
71 <var>xWindow</var>. Thus, the previous owner is not allowed to
72 dispose this window anymore. </p>
74 @param xWindow
75 the new container window
77 @see XFrame::getContainerWindow()
79 void initialize( [in] com::sun::star::awt::XWindow xWindow );
81 //-------------------------------------------------------------------------
82 /** provides access to the container window of the frame.
84 <p>
85 Normally this is used as the parent window of the
86 component window.
87 </p>
89 @return
90 the container window of this frame
92 @see XFrame::initialize()
94 com::sun::star::awt::XWindow getContainerWindow();
96 //-------------------------------------------------------------------------
97 /** sets the frame container that created this frame.
99 <p>
100 Only the creator is allowed to call this method.
101 But creator doesn't mean the implementation which creates this instance ...
102 it means the parent frame of the frame hierarchy.
103 Because; normaly a frame should be created by using the api
104 and is neccessary for searches inside the tree (e.g. <member>XFrame::findFrame()</member>)
105 </p>
107 @param Creator
108 the creator (parent) of this frame
110 @see XFrame::getCreator()
112 [oneway] void setCreator( [in] XFramesSupplier Creator );
114 //-------------------------------------------------------------------------
115 /** provides access to the creator (parent) of this frame
117 @returns
118 the frame container that created and contains this frame.
120 @see XFrame::setCreator()
122 XFramesSupplier getCreator();
124 //-------------------------------------------------------------------------
125 /** access to the name property of this frame
127 @returns
128 the programmatic name of this frame.
130 @see XFrame::setName()
132 string getName();
134 //-------------------------------------------------------------------------
135 /** sets the name of the frame.
138 Normally the name of the frame is set initially (e.g. by the creator).
139 The name of a frame will be used for identifying it if a frame search was started.
140 These searches can be forced by:
141 <ul>
142 <li><member>XFrame::findFrame()</member>
143 <li><member>XDispatchProvider::queryDispatch()</member>
144 <li><member>XComponentLoader::loadComponentFromURL()</member>
145 </ul>
146 Note: Special targets like "_blank", "_self" etc. are not allowed.
147 That's why frame names shouldn't start with a sign "_".
148 </p>
150 @param aName
151 the new programmatic name of this frame
153 @see XFrame::findFrame()
154 @see XFrame::getName()
155 @see XDispatchProvider
156 @see XComponentLoader
158 [oneway] void setName( [in] string aName );
160 //-------------------------------------------------------------------------
161 /** searches for a frame with the specified name.
164 Frames may contain other frames (e.g., a frameset) and may
165 be contained in other frames. This hierarchy is searched with
166 this method.
167 First some special names are taken into account, i.e. "",
168 "_self", "_top", "_blank" etc. <var>SearchFlags</var> is ignored when
169 comparing these names with <var>TargetFrameName</var>; further steps are
170 controlled by <var>SearchFlags</var>. If allowed, the name of the frame
171 itself is compared with the desired one, and then ( again if allowed )
172 the method is called for all children of the frame. Finally may be called
173 for the siblings and then for parent frame (if allowed).
174 </p>
177 List of special target names:
178 <table border=1>
179 <tr><td>""/"_self"</td><td>address the starting frame itself</td></tr>
180 <tr><td>"_parent"</td><td>address the direct parent frame only</td></tr>
181 <tr><td>"_top"</td><td>address the top frame of this subtree of the frametree</td></tr>
182 <tr><td>"_blank"</td><td>creates a new top frame</td></tr>
183 </table>
184 </p>
187 If no frame with the given name is found, a new top frame is
188 created; if this is allowed by a special flag <const>FrameSearchFlag::CREATE</const>.
189 The new frame also gets the desired name.
190 </p>
192 @param aTargetFrameName
193 identify
194 <ul><li>(a) a special target ("_blank","_self" ...) or</li>
195 <li>(b) any well known frame</li><ul>
196 to search it inside the current hierarchy
198 @param nSearchFlags
199 optional parameter to regulate search if no special target was used for <var>TargetFrameName</var>
201 @see FrameSearchFlag
203 XFrame findFrame(
204 [in] string aTargetFrameName,
205 [in] long nSearchFlags);
207 //-------------------------------------------------------------------------
208 /** determines if the frame is a top frame.
211 In general a top frame is the frame which is a direct child of
212 a task frame or which does not have a parent. Possible frame searches must
213 stop the search at such a frame unless the flag <const>FrameSearchFlag::TASKS</const>
214 is set.
215 </p>
217 @return
218 <TRUE/> if frame supports top frame specification
219 <br>
220 <FALSE/> otherwise
222 boolean isTop();
224 //-------------------------------------------------------------------------
225 /** activates this frame and thus the component within.
228 At first the frame sets itself as the active frame of its
229 creator by calling <member>XFramesSupplier::setActiveFrame()</member>,
230 then it broadcasts an <type>FrameActionEvent</type> with
231 <const>FrameAction::FRAME_ACTIVATED</const>. The component within
232 this frame may listen to this event to grab the focus on activation;
233 for simple components this can be done by the <type>FrameLoader</type>.
234 </p>
237 Finally, most frames may grab the focus to one of its windows
238 or forward the activation to a sub-frame.
239 </p>
241 @see XFrame::deactivate()
242 @see XFrame::isActive()
244 [oneway] void activate();
246 //-------------------------------------------------------------------------
247 /** is called by the creator frame when another sub-frame gets activated.
250 At first the frame deactivates its active sub-frame, if any.
251 Then broadcasts a <type>FrameActionEvent</type> with
252 <const>FrameAction::FRAME_DEACTIVATING</const>.
253 </p>
255 @see XFrame::activate()
256 @see XFrame::isActive()
258 [oneway] void deactivate();
260 //-------------------------------------------------------------------------
261 /** determines if the frame is active.
263 @return
264 <TRUE/> for active or UI active frames
265 <br>
266 <FALSE/> otherwise
268 @see XFrame::activate()
269 @see XFrame::deactivate()
271 boolean isActive();
273 //-------------------------------------------------------------------------
274 /** sets a new component into the frame or release an existing one from a frame.
276 @param xComponentWindow
277 the window of the new component or <NULL/> for release
280 A valid component window should be a child of the frame container window.
281 </p>
283 @param xController
284 the controller of the new component or <NULL/> for release
287 Simple components may implement a <type scope="com::sun::star::awt">XWindow</type> only.
288 In this case no controller must be given here.
289 </p>
291 @return
292 <TRUE/>if setting of new component or release of an existing one was successfully
293 <br>
294 <FALSE/> otherwise (especialy, if an existing controller disagree within his
295 <member>XController::suspend()</member> call)
297 @see XFrame::getComponentWindow()
298 @see XFrame::getContainerWindow()
299 @see XFrame::getController()
301 boolean setComponent(
302 [in] com::sun::star::awt::XWindow xComponentWindow,
303 [in] XController xController);
305 //-------------------------------------------------------------------------
306 /** provides access to the component window
309 Note: Don't dispose this window - the frame is the owner of it.
310 </p>
312 @returns
313 the current visible component in this frame
314 <br>
315 or <NULL/> if no one currently exist
317 @see XFrame::setComponent()
319 com::sun::star::awt::XWindow getComponentWindow();
321 //-------------------------------------------------------------------------
322 /** provides access to the controller
325 Note: Don't dispose it - the frame is the owner of it.
326 Use <member>XController::getFrame()</member> to dispose
327 the frame after you the controller agreed with a
328 <member>XController::suspend()</member> call.
329 </p>
331 @returns
332 the current controller within this frame
333 <br>
334 or <NULL/> if no one currently exist
336 @see XFrame::setComponent()
338 XController getController();
340 //-------------------------------------------------------------------------
341 /** notifies the frame that the context of the controller within this
342 frame changed (i.e. the selection).
345 According to a call to this interface, the frame calls
346 <method>XFrameEventListener::frameAction</method> with
347 <const>FrameAction::CONTEXT_CHANGED</const> to all listeners which
348 are registered using <member>XFrame::addFrameActionListener</member>.
349 For external controllers this event can be used to requery dispatches.
351 @see XFrameEventListener
352 @see FrameAction
353 @see XFrame::addFrameActionListener()
355 void contextChanged();
357 //-------------------------------------------------------------------------
358 /** registers an event listener, which will be called when certain things
359 happen to the components within this frame or within sub-frames of this frame.
362 E.g., it is possible to determine instantiation/destruction and
363 activation/deactivation of components.
364 </p>
366 @param xListener
367 specifies the listener which will be informed
369 @see XFrame::removeFrameActionListener()
371 [oneway] void addFrameActionListener( [in]XFrameActionListener xListener );
373 //-------------------------------------------------------------------------
374 /** unregisters an event listener
376 @param xListener
377 specifies the listener which willn't be informed any longer
379 @see XFrame::addFrameActionListener()
381 [oneway] void removeFrameActionListener( [in] XFrameActionListener xListener );
384 //=============================================================================
386 }; }; }; };
388 #endif