Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: frame ::

interface XLayoutManager
Description
central interface to query for, create, destroy and manipulate user interface elements which are bound to a layout manager.

Every user interface element which is controlled by a layout manager has a unique identifier called resource URL. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name. Currently the following user interface element types are defined:

  • menubarA configurable user interface element representing a menu bar.
  • popupmenuA configurable user interface element representing a popup menu.
  • toolbarA configurable user interface element a tool bar.
  • statusbarA configurable user interfave element representing a status bar.
  • floaterA basic user interface element representing a floating window.
Since
OOo 2.0
See also
com::sun::star::ui::UIElementTypes
See also
XFrame


Methods' Summary
attachFrame attaches a XFrame to a layout manager.  
reset resets the layout manager and remove all of its internal user interface elements.  
getCurrentDockingArea provides the current docking area size of the layout manager.  
getDockingAreaAcceptor retrieves the current docking area acceptor that controls the border space of the frame's container window.  
setDockingAreaAcceptor sets a docking area acceptor that controls the border space of the frame's container window.  
createElement creates a new user interface element.  
destroyElement destroys a user interface element.  
requestElement request to make a user interface element visible if it is not in hidden state.  
getElement retrieves a user interface element which has been created before.  
getElements retrieves all user interface elements which are currently instanciated.  
showElement shows a user interface element.  
hideElement hides a user interface element.  
dockWindow docks a window based user interface element to a specified docking area.  
dockAllWindows docks all windows which are member of the provided user interface element type.  
floatWindow forces a window based user interface element to float.  
lockWindow locks a window based user interface element if it's in a docked state.  
unlockWindow unlocks a window based user interface element if it's in a docked state.  
setElementSize sets a new size for a window based user interface element.  
setElementPos sets a new position for a window based user interface element.  
setElementPosSize sets a new position and size for a window based user interface element.  
isElementVisible retrieves the current visibility state of a window based user interface element.  
isElementFloating retrieves the current floating state of a window based user interface element.  
isElementDocked retrieves the current docking state of a window based user interface element.  
isElementLocked retrieves the current lock state of a window based user interface element.  
getElementSize retrieves the current size of a window based user interface element.  
getElementPos retrieves the current pixel position of a window based user interface element.  
lock prohibit all layout updates until unlock is called again.  
unlock permit layout updates again.  
doLayout forces a complete new layouting of all user interface elements.  
setVisible sets the layout manager to invisible state and hides all user interface elements.  
isVisible retrieves the visibility state of a layout manager.  
Methods' Details
attachFrame
void
attachFrame( [in] XFrame  Frame );

Description
attaches a XFrame to a layout manager.
Parameter Frame
specifies the frame that should be attached to the layout manager

A layout manager needs a XFrame to be able to work. Without a it no user interface elements can be created.

reset
void
reset();

Description
resets the layout manager and remove all of its internal user interface elements.

This call should be handled with care as all user interface elements will be destroyed and the layout manager is reseted to a state after a attachFrame has been made. That means an attached frame which has been set by attachFrame is not released. The layout manager itself calls reset after a component has been attached or reattached to a frame.

getCurrentDockingArea
::com::sun::star::awt::Rectangle
getCurrentDockingArea();

Description
provides the current docking area size of the layout manager.
Returns
The ::com::sun::star::awt::Rectangle contains pixel values. The members of ::com::sun::star::awt::Rectangle are filled as following:
  • X = docking area on left side (in pixel)
  • Y = docking area on top side (in pixel)
  • Width = docking area on right side (in pixel)
  • Height = docking area on bottom side (in pixel)
getDockingAreaAcceptor
::com::sun::star::ui::XDockingAreaAcceptor
getDockingAreaAcceptor();

Description
retrieves the current docking area acceptor that controls the border space of the frame's container window.
Returns
current docking area acceptor which controls the border space of frame's container window.

A docking area acceptor retrieved by this method is owned by the layout manager. It is not allowed to dispose this object, it will be destroyed on reference count!

setDockingAreaAcceptor
void
setDockingAreaAcceptor( [in] ::com::sun::star::ui::XDockingAreaAcceptor  xDockingAreaAcceptor );

Description
sets a docking area acceptor that controls the border space of the frame's container window.
Parameter xDockingAreaAcceptor
a docking area acceptor which controls the border space of frame's container window.

A docking area acceptor decides if the layout manager can use requested border space for docking windows. If the acceptor denies the requested space the layout manager automatically set all docked windows into floating state and will not use this space for docking.
After setting a docking area acceptor the object is owned by the layout manager. It is not allowed to dispose this object, it will be destroyed on reference count!

createElement
void
createElement( [in] string  ResourceURL );

Description
creates a new user interface element.
Parameter ResourceURL
specifies which user interface element should be created. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
destroyElement
void
destroyElement( [in] string  ResourceURL );

Description
destroys a user interface element.
Parameter ResourceURL
specifies which user interface element should be destroyed. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
requestElement
boolean
requestElement( [in] string  ResourceURL );

Description
request to make a user interface element visible if it is not in hidden state.
Parameter ResourceURL
specifies which user interface element should be made visible. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
returns true if the user interface element could be made visible, otherwise false will be returned.

If a user interface element should forced to the visible state XLayoutManager::showElement should be used. This function can be used for context dependent elements which should respect a the current visibility state.

getElement
::com::sun::star::ui::XUIElement
getElement( [in] string  ResourceURL );

Description
retrieves a user interface element which has been created before.
Parameter ResourceURL
specifies which user interface element should be retrieved. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.

The layout manager instance is owner of the returned user interface element. That means that the life time of the user interface element is controlled by the layout manager. It can be disposed at every time!

getElements
sequence< ::com::sun::star::ui::XUIElement >
getElements();

Description
retrieves all user interface elements which are currently instanciated.
Returns
a sequence of user interface elements providing ::com::sun::star::ui::XUIElement interface.

The layout manager instance is owner of the returned user interface elements. That means that the life time of the user interface elements is controlled by the layout manager. They can be disposed at every time!

showElement
boolean
showElement( [in] string  ResourceURL );

Description
shows a user interface element.
Parameter ResourceURL
specifies which user interface element should be shown. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
returns true if the user interface element has been shown, otherwise false will be returned.
hideElement
boolean
hideElement( [in] string  ResourceURL );

Description
hides a user interface element.
Parameter ResourceURL
specifies which user interface element should be hidden. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
returns true if the user interface element has been hidden, otherwise false will be returned.
dockWindow
boolean
dockWindow( [in] string  ResourceURL,
[in] ::com::sun::star::ui::DockingArea  DockingArea,
[in] ::com::sun::star::awt::Point  Pos );

Description
docks a window based user interface element to a specified docking area.
Parameter ResourceURL
specifies which user interface element should be docked. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Parameter DockingArea
specifies on which docking area the window based user interface element should docked.
Parameter Pos
specifies the position inside the docking area.
Returns
returns true if the user interface element has been docked, otherwise false will be returned.
See also
::com::sun::star::ui::DockingArea
dockAllWindows
boolean
dockAllWindows( [in] short  nElementType );

Description
docks all windows which are member of the provided user interface element type.
Parameter nElementType
specifies which user interface element type should be docked.
Returns
returns true if all user interface elements of the requested type could be docked, otherwise false will be returned.
See also
::com::sun::star::ui::UIElementType
floatWindow
boolean
floatWindow( [in] string  ResourceURL );

Description
forces a window based user interface element to float.
Parameter ResourceURL
specifies which user interface element should be float. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
returns true if the user interface element has been docked, otherwise false will be returned.
lockWindow
boolean
lockWindow( [in] string  ResourceURL );

Description
locks a window based user interface element if it's in a docked state.
Parameter ResourceURL
specifies which user interface element should be locked. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
returns true if the user interface element has been locked, otherwise false will be returned.
unlockWindow
boolean
unlockWindow( [in] string  ResourceURL );

Description
unlocks a window based user interface element if it's in a docked state.
Parameter ResourceURL
specifies which user interface element should be unlocked. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
returns true if the user interface element has been unlocked, otherwise false will be returned.
setElementSize
void
setElementSize( [in] string  ResourceURL,
[in] ::com::sun::star::awt::Size  Size );

Description
sets a new size for a window based user interface element.
Parameter ResourceURL
specifies which user interface element should be resized. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Parameter Size
specifies the new size in pixel.

It is up to the layout manager to decide if the user interface element can be resized. The new size can be retrieved by calling getElementSize.

setElementPos
void
setElementPos( [in] string  ResourceURL,
[in] ::com::sun::star::awt::Point  Pos );

Description
sets a new position for a window based user interface element.
Parameter ResourceURL
specifies which user interface element should be moved. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Parameter Pos
specifies the new position in pixel.

It is up to the layout manager to decide if the user interface element can be moved. The new position can be retrieved by calling getElementPos.

setElementPosSize
void
setElementPosSize( [in] string  ResourceURL,
[in] ::com::sun::star::awt::Point  Pos,
[in] ::com::sun::star::awt::Size  Size );

Description
sets a new position and size for a window based user interface element.
Parameter ResourceURL
specifies which user interface element should be moved and resized. A resourcce URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Parameter Pos
specifies the new position in pixel.
Parameter Size
specifies the new position in pixel.

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 be retrieved by calling getElementPos and getElementSize.

isElementVisible
boolean
isElementVisible( [in] string  ResourceURL );

Description
retrieves the current visibility state of a window based user interface element.
Parameter ResourceURL
specifies for which user interface element the visibility state should be retrieved. A resource URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
true if the user interface element is visible, otherwise false.
isElementFloating
boolean
isElementFloating( [in] string  ResourceURL );

Description
retrieves the current floating state of a window based user interface element.
Parameter ResourceURL
specifies for which user interface element the floating state should be retrieved. A resource URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
true if the user interface element is floating, otherwise false.
isElementDocked
boolean
isElementDocked( [in] string  ResourceURL );

Description
retrieves the current docking state of a window based user interface element.
Parameter ResourceURL
specifies for which user interface element the docking state should be retrieved. A resource URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
true if the user interface element is docked, otherwise false.
isElementLocked
boolean
isElementLocked( [in] string  ResourceURL );

Description
retrieves the current lock state of a window based user interface element.
Parameter ResourceURL
specifies for which user interface element the lock state should be retrieved. A resource URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
true if the user interface element is locked, otherwise false.
getElementSize
::com::sun::star::awt::Size
getElementSize( [in] string  ResourceURL );

Description
retrieves the current size of a window based user interface element.
Parameter ResourceURL
specifies for which user interface element the current size should be retrieved. A resource URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
the size in pixel of the user interface element. A non-window based user interface element provides a zero size.
getElementPos
::com::sun::star::awt::Point
getElementPos( [in] string  ResourceURL );

Description
retrieves the current pixel position of a window based user interface element.
Parameter ResourceURL
specifies for which user interface element the current position should be retrieved. A resource URL must meet the following syntax: "private:resource/$type/$name". It is only allowed to use ascii characters for type and name.
Returns
the size in pixel of the user interface element. A non-window based user interface element provides a zero size.
lock
void
lock();

Description
prohibit all layout updates until unlock is called again.

This call can be used to speed up the creation process of serveral user interface elements. Otherwise the layout manager would calculate the layout for every creation.

unlock
void
unlock();

Description
permit layout updates again.

This function should be called to permit layout updates. The layout manager starts to calculate the new layout after this call.

doLayout
void
doLayout();

Description
forces a complete new layouting of all user interface elements.
setVisible
void
setVisible( [in] boolean  Visible );

Description
sets the layout manager to invisible state and hides all user interface elements.

A layout manager can be set to invisible state to force it to hide all of its user interface elements. If another component wants to use the window for its own user interface elements it can use this function. This function is normally used to implement inplace editing.

Parameter Visible
provide false to make layout manager invisible otherwise this must be set to true.
isVisible
boolean
isVisible();

Description
retrieves the visibility state of a layout manager.

A layout manager can be set to invisible state to force it to hide all of its user interface elements. If another component wants to use the window for its own user interface elements it can use this function. This function is normally used to implement inplace editing.

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.