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 ************************************************************************/
28 #ifndef __com_sun_star_frame_XLayoutManager_idl__
29 #define __com_sun_star_frame_XLayoutManager_idl__
31 #ifndef __com_sun_star_uno_XInterface_idl__
32 #include
<com
/sun
/star
/uno
/XInterface.idl
>
35 #ifndef __com_sun_star_frame_XFrame_idl__
36 #include
<com
/sun
/star
/frame
/XFrame.idl
>
39 #ifndef __com_sun_star_awt_Point_idl__
40 #include
<com
/sun
/star
/awt
/Point.idl
>
43 #ifndef __com_sun_star_awt_Size_idl__
44 #include
<com
/sun
/star
/awt
/Size.idl
>
47 #ifndef __com_sun_star_awt_XWindow_idl__
48 #include
<com
/sun
/star
/awt
/XWindow.idl
>
51 #ifndef __com_sun_star_ui_XUIElement_idl__
52 #include
<com
/sun
/star
/ui
/XUIElement.idl
>
55 #ifndef __com_sun_star_ui_DockingArea_idl__
56 #include
<com
/sun
/star
/ui
/DockingArea.idl
>
59 #ifndef __com_sun_star_ui_XDockingAreaAcceptor_idl__
60 #include
<com
/sun
/star
/ui
/XDockingAreaAcceptor.idl
>
63 //=============================================================================
65 module com
{ module sun
{ module star
{ module frame
{
67 //=============================================================================
69 /** central interface to query for, create, destroy and manipulate user
70 interface elements which are bound to a layout manager.
73 Every user interface element which is controlled by a layout manager has
74 a unique identifier called resource URL.
76 A resourcce URL must meet the following syntax:
77 "private:resource/$type/$name". It is only allowed to use ascii characters
80 Currently the following user interface element types are defined:
82 <li><b>menubar</b>A configurable user interface element representing
84 <li><b>popupmenu</b>A configurable user interface element representing
86 <li><b>toolbar</b>A configurable user interface element a tool
88 <li><b>statusbar</b>A configurable user interfave element representing
90 <li><b>floater</b>A basic user interface element representing a
94 @see com::sun::star::ui::UIElementTypes
95 @see com::sun::star::frame::XFrame
101 interface XLayoutManager
: com
::sun
::star
::uno
::XInterface
103 /** attaches a <type scope="com::sun::star::frame">XFrame</type> to a layout manager.
106 specifies the frame that should be attached to the layout manager
109 A layout manager needs a <type scope="com::sun::star::frame">XFrame</type> to be
110 able to work. Without a it no user interface elements can be created.
113 void attachFrame
( [in] com
::sun
::star
::frame
::XFrame Frame
);
115 /** resets the layout manager and remove all of its internal user interface
119 This call should be handled with care as all user interface elements will
120 be destroyed and the layout manager is reseted to a state after a
121 <member>attachFrame</member> has been made. That means an attached frame
122 which has been set by <member>attachFrame</member> is not released.
123 The layout manager itself calls reset after a component has been attached
124 or reattached to a frame.
129 /** provides the current docking area size of the layout manager.
132 The <type scope="com::sun::star::awt">Rectangle</type> contains pixel values. The
133 members of <type scope="com::sun::star::awt">Rectangle</type> are filled as following:
135 <li>X = docking area on left side (in pixel)</li>
136 <li>Y = docking area on top side (in pixel)</li>
137 <li>Width = docking area on right side (in pixel)</li>
138 <li>Height = docking area on bottom side (in pixel)</li>
141 com
::sun
::star
::awt
::Rectangle getCurrentDockingArea
();
143 /** retrieves the current docking area acceptor that controls the border space of the frame's
147 current docking area acceptor which controls the border space of frame's container window.
150 A docking area acceptor retrieved by this method is owned by the layout manager. It is not
151 allowed to dispose this object, it will be destroyed on reference count!
154 com
::sun
::star
::ui
::XDockingAreaAcceptor getDockingAreaAcceptor
();
156 /** sets a docking area acceptor that controls the border space of the frame's container window.
158 @param xDockingAreaAcceptor
159 a docking area acceptor which controls the border space of frame's container window.
162 A docking area acceptor decides if the layout manager can use requested border space for
163 docking windows. If the acceptor denies the requested space the layout manager automatically
164 set all docked windows into floating state and will not use this space for docking.<br/>
165 After setting a docking area acceptor the object is owned by the layout manager. It is not
166 allowed to dispose this object, it will be destroyed on reference count!
169 void setDockingAreaAcceptor
( [in] com
::sun
::star
::ui
::XDockingAreaAcceptor xDockingAreaAcceptor
);
171 /** creates a new user interface element.
174 specifies which user interface element should be created. A resourcce URL must meet the following
175 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
178 void createElement
( [in] string ResourceURL
);
180 /** destroys a user interface element.
183 specifies which user interface element should be destroyed. A resourcce URL must meet
184 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii
185 characters for type and name.
187 void destroyElement
( [in] string ResourceURL
);
189 /** request to make a user interface element visible if it is not in hidden state.
192 specifies which user interface element should be made visible. A resourcce URL must
193 meet the following syntax: "private:resource/$type/$name". It is only allowed to use
194 ascii characters for type and
198 returns <TRUE/> if the user interface element could be made visible, otherwise
199 <FALSE/> will be returned.
202 If a user interface element should forced to the visible state
203 <member>XLayoutManager::showElement</member> should be used. This function can be
204 used for context dependent elements which should respect a the current visibility
208 boolean requestElement
( [in] string ResourceURL
);
210 /** retrieves a user interface element which has been created before.
213 specifies which user interface element should be retrieved. A resourcce URL must meet the following
214 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
218 The layout manager instance is owner of the returned user interface element. That means that the life time of
219 the user interface element is controlled by the layout manager. It can be disposed at every time!
222 com
::sun
::star
::ui
::XUIElement getElement
( [in] string ResourceURL
);
224 /** retrieves all user interface elements which are currently instanciated.
227 a sequence of user interface elements providing <type scope="com::sun::star::ui">XUIElement</type>
231 The layout manager instance is owner of the returned user interface elements. That means that the life time of
232 the user interface elements is controlled by the layout manager. They can be disposed at every time!
235 sequence
< com
::sun
::star
::ui
::XUIElement
> getElements
();
237 /** shows a user interface element.
240 specifies which user interface element should be shown. A resourcce URL must meet the following
241 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
245 returns <TRUE/> if the user interface element has been shown, otherwise <FALSE/> will be returned.
247 boolean showElement
( [in] string ResourceURL
);
249 /** hides a user interface element.
252 specifies which user interface element should be hidden. A resourcce URL must meet the following
253 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
257 returns <TRUE/> if the user interface element has been hidden, otherwise <FALSE/> will be returned.
259 boolean hideElement
( [in] string ResourceURL
);
261 /** docks a window based user interface element to a specified docking area.
264 specifies which user interface element should be docked. A resourcce URL must meet the following
265 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
269 specifies on which docking area the window based user interface element should docked.
272 specifies the position inside the docking area.
275 returns <TRUE/> if the user interface element has been docked, otherwise <FALSE/> will be returned.
277 @see com::sun::star::ui::DockingArea
279 boolean dockWindow
( [in] string ResourceURL
, [in] com
::sun
::star
::ui
::DockingArea DockingArea
, [in] com
::sun
::star
::awt
::Point Pos
);
281 /** docks all windows which are member of the provided user interface element type.
284 specifies which user interface element type should be docked.
287 returns <TRUE/> if all user interface elements of the requested type could be
288 docked, otherwise <FALSE/> will be returned.
290 @see com::sun::star::ui::UIElementType
292 boolean dockAllWindows
( [in] short nElementType
);
294 /** forces a window based user interface element to float.
297 specifies which user interface element should be float. A resourcce URL must meet the following
298 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
302 returns <TRUE/> if the user interface element has been docked, otherwise <FALSE/> will be returned.
304 boolean floatWindow
( [in] string ResourceURL
);
306 /** locks a window based user interface element if it's in a docked state.
309 specifies which user interface element should be locked. A resourcce URL must meet the following
310 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
314 returns <TRUE/> if the user interface element has been locked, otherwise <FALSE/> will be returned.
316 boolean lockWindow
( [in] string ResourceURL
);
318 /** unlocks a window based user interface element if it's in a docked state.
321 specifies which user interface element should be unlocked. A resourcce URL must
322 meet the following syntax: "private:resource/$type/$name". It is only allowed
323 to use ascii characters for type and name.
326 returns <TRUE/> if the user interface element has been unlocked, otherwise
327 <FALSE/> will be returned.
329 boolean unlockWindow
( [in] string ResourceURL
);
331 /** sets a new size for a window based user interface element.
334 specifies which user interface element should be resized. A resourcce URL must meet the following
335 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
339 specifies the new size in pixel.
342 It is up to the layout manager to decide if the user interface element can be resized. The new size can be retrieved
343 by calling <member>getElementSize</member>.
346 void setElementSize
( [in] string ResourceURL
, [in] com
::sun
::star
::awt
::Size Size
);
348 /** sets a new position for a window based user interface element.
351 specifies which user interface element should be moved. A resourcce URL must meet the following
352 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
356 specifies the new position in pixel.
359 It is up to the layout manager to decide if the user interface element can be moved. The new position can be retrieved
360 by calling <member>getElementPos</member>.
363 void setElementPos
( [in] string ResourceURL
, [in] com
::sun
::star
::awt
::Point Pos
);
365 /** sets a new position and size for a window based user interface element.
368 specifies which user interface element should be moved and resized. A resourcce URL must meet the following
369 syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
373 specifies the new position in pixel.
376 specifies the new position in pixel.
379 It is up to the layout manager to decide if the user interface element can be moved and resized. The new position and size can
380 be retrieved by calling <member>getElementPos</member> and <member>getElementSize</member>.
383 void setElementPosSize
( [in] string ResourceURL
, [in] com
::sun
::star
::awt
::Point Pos
, [in] com
::sun
::star
::awt
::Size Size
);
385 /** retrieves the current visibility state of a window based user interface element.
388 specifies for which user interface element the visibility state should be retrieved. A resource URL must meet
389 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
393 <TRUE/> if the user interface element is visible, otherwise <FALSE/>.
395 boolean isElementVisible
( [in] string ResourceURL
);
397 /** retrieves the current floating state of a window based user interface element.
400 specifies for which user interface element the floating state should be retrieved. A resource URL must meet
401 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
405 <TRUE/> if the user interface element is floating, otherwise <FALSE/>.
407 boolean isElementFloating
( [in] string ResourceURL
);
409 /** retrieves the current docking state of a window based user interface element.
412 specifies for which user interface element the docking state should be retrieved. A resource URL must meet
413 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
417 <TRUE/> if the user interface element is docked, otherwise <FALSE/>.
419 boolean isElementDocked
( [in] string ResourceURL
);
421 /** retrieves the current lock state of a window based user interface element.
424 specifies for which user interface element the lock state should be retrieved. A resource URL must meet
425 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
429 <TRUE/> if the user interface element is locked, otherwise <FALSE/>.
431 boolean isElementLocked
( [in] string ResourceURL
);
433 /** retrieves the current size of a window based user interface element.
436 specifies for which user interface element the current size should be retrieved. A resource URL must meet
437 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
441 the size in pixel of the user interface element. A non-window based user interface element provides a zero size.
443 com
::sun
::star
::awt
::Size getElementSize
( [in] string ResourceURL
);
445 /** retrieves the current pixel position of a window based user interface element.
448 specifies for which user interface element the current position should be retrieved. A resource URL must meet
449 the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and
453 the size in pixel of the user interface element. A non-window based user interface element provides a zero size.
455 com
::sun
::star
::awt
::Point getElementPos
( [in] string ResourceURL
);
457 /** prohibit all layout updates until unlock is called again.
460 This call can be used to speed up the creation process of serveral user interface elements. Otherwise the layout manager
461 would calculate the layout for every creation.
466 /** permit layout updates again.
469 This function should be called to permit layout updates. The layout manager starts to calculate the new layout after
475 /** forces a complete new layouting of all user interface elements.
479 /** sets the layout manager to invisible state and hides all user interface elements.
482 A layout manager can be set to invisible state to force it to hide all of its
483 user interface elements. If another component wants to use the window for its
484 own user interface elements it can use this function. This function is normally
485 used to implement inplace editing.
489 provide <FALSE/> to make layout manager invisible otherwise this must be
492 void setVisible
( [in] boolean Visible
);
494 /** retrieves the visibility state of a layout manager.
497 A layout manager can be set to invisible state to force it to hide all of its
498 user interface elements. If another component wants to use the window for its
499 own user interface elements it can use this function. This function is normally
500 used to implement inplace editing.