/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __com_sun_star_frame_XLayoutManager_idl__
#define __com_sun_star_frame_XLayoutManager_idl__
#ifndef __com_sun_star_uno_XInterface_idl__
#include
#endif
#ifndef __com_sun_star_frame_XFrame_idl__
#include
#endif
#ifndef __com_sun_star_awt_Point_idl__
#include
#endif
#ifndef __com_sun_star_awt_Size_idl__
#include
#endif
#ifndef __com_sun_star_awt_XWindow_idl__
#include
#endif
#ifndef __com_sun_star_ui_XUIElement_idl__
#include
#endif
#ifndef __com_sun_star_ui_DockingArea_idl__
#include
#endif
#ifndef __com_sun_star_ui_XDockingAreaAcceptor_idl__
#include
#endif
//=============================================================================
module com { module sun { module star { module frame {
//=============================================================================
/** 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.
@see com::sun::star::ui::UIElementTypes
@see com::sun::star::frame::XFrame
@since OpenOffice 2.0
*/
published interface XLayoutManager : com::sun::star::uno::XInterface
{
/** attaches a XFrame to a layout manager.
@param 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.
*/
void attachFrame( [in] com::sun::star::frame::XFrame Frame );
/** 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.
*/
void reset();
/** provides the current docking area size of the layout manager.
@return
The Rectangle contains pixel values. The
members of 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)
*/
com::sun::star::awt::Rectangle getCurrentDockingArea();
/** retrieves the current docking area acceptor that controls the border space of the frame's
container window.
@return
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!
*/
com::sun::star::ui::XDockingAreaAcceptor getDockingAreaAcceptor();
/** sets a docking area acceptor that controls the border space of the frame's container window.
@param 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!
*/
void setDockingAreaAcceptor( [in] com::sun::star::ui::XDockingAreaAcceptor xDockingAreaAcceptor );
/** creates a new user interface element.
@param 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.
*/
void createElement( [in] string ResourceURL );
/** destroys a user interface element.
@param 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.
*/
void destroyElement( [in] string ResourceURL );
/** request to make a user interface element visible if it is not in hidden state.
@param 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.
@return
returns if the user interface element could be made visible, otherwise
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.
*/
boolean requestElement( [in] string ResourceURL );
/** retrieves a user interface element which has been created before.
@param 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!
*/
com::sun::star::ui::XUIElement getElement( [in] string ResourceURL );
/** retrieves all user interface elements which are currently instanciated.
@return
a sequence of user interface elements providing 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!
*/
sequence< com::sun::star::ui::XUIElement > getElements();
/** shows a user interface element.
@param 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.
@return
returns if the user interface element has been shown, otherwise will be returned.
*/
boolean showElement( [in] string ResourceURL );
/** hides a user interface element.
@param 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.
@return
returns if the user interface element has been hidden, otherwise will be returned.
*/
boolean hideElement( [in] string ResourceURL );
/** docks a window based user interface element to a specified docking area.
@param 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.
@param DockingArea
specifies on which docking area the window based user interface element should docked.
@param Pos
specifies the position inside the docking area.
@return
returns if the user interface element has been docked, otherwise will be returned.
@see com::sun::star::ui::DockingArea
*/
boolean dockWindow( [in] string ResourceURL, [in] com::sun::star::ui::DockingArea DockingArea, [in] com::sun::star::awt::Point Pos );
/** docks all windows which are member of the provided user interface element type.
@param nElementType
specifies which user interface element type should be docked.
@return
returns if all user interface elements of the requested type could be
docked, otherwise will be returned.
@see com::sun::star::ui::UIElementType
*/
boolean dockAllWindows( [in] short nElementType );
/** forces a window based user interface element to float.
@param 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.
@return
returns if the user interface element has been docked, otherwise will be returned.
*/
boolean floatWindow( [in] string ResourceURL );
/** locks a window based user interface element if it's in a docked state.
@param 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.
@return
returns if the user interface element has been locked, otherwise will be returned.
*/
boolean lockWindow( [in] string ResourceURL );
/** unlocks a window based user interface element if it's in a docked state.
@param 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.
@return
returns if the user interface element has been unlocked, otherwise
will be returned.
*/
boolean unlockWindow( [in] string ResourceURL );
/** sets a new size for a window based user interface element.
@param 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.
@param 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.
*/
void setElementSize( [in] string ResourceURL, [in] com::sun::star::awt::Size Size );
/** sets a new position for a window based user interface element.
@param 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.
@param 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.
*/
void setElementPos( [in] string ResourceURL, [in] com::sun::star::awt::Point Pos );
/** sets a new position and size for a window based user interface element.
@param 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.
@param Pos
specifies the new position in pixel.
@param 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.
*/
void setElementPosSize( [in] string ResourceURL, [in] com::sun::star::awt::Point Pos, [in] com::sun::star::awt::Size Size );
/** retrieves the current visibility state of a window based user interface element.
@param 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.
@return
if the user interface element is visible, otherwise .
*/
boolean isElementVisible( [in] string ResourceURL );
/** retrieves the current floating state of a window based user interface element.
@param 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.
@return
if the user interface element is floating, otherwise .
*/
boolean isElementFloating( [in] string ResourceURL );
/** retrieves the current docking state of a window based user interface element.
@param 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.
@return
if the user interface element is docked, otherwise .
*/
boolean isElementDocked( [in] string ResourceURL );
/** retrieves the current lock state of a window based user interface element.
@param 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.
@return
if the user interface element is locked, otherwise .
*/
boolean isElementLocked( [in] string ResourceURL );
/** retrieves the current size of a window based user interface element.
@param 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.
@return
the size in pixel of the user interface element. A non-window based user interface element provides a zero size.
*/
com::sun::star::awt::Size getElementSize( [in] string ResourceURL );
/** retrieves the current pixel position of a window based user interface element.
@param 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.
@return
the size in pixel of the user interface element. A non-window based user interface element provides a zero size.
*/
com::sun::star::awt::Point getElementPos( [in] string ResourceURL );
/** 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.
*/
void lock();
/** 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.
*/
void unlock();
/** forces a complete new layouting of all user interface elements.
*/
void doLayout();
/** 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.
@param Visible
provide to make layout manager invisible otherwise this must be
set to .
*/
void setVisible( [in] boolean Visible );
/** 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.
*/
boolean isVisible();
};
}; }; }; };
#endif