Top   Module   Use   Manual   Index 
 EXPORTING SERVICES | METHODS' SUMMARY | METHODS' DETAILS 

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

interface XFrame

Base Interface
com::sun::star::lang::XComponent

Description
makes it possible to control a Frame


Known Services which Export this Interface

com::sun::star::frame::DesktopTask specifies a separate task within a desktop environment.
com::sun::star::frame::Frame represents the environment for a desktop component.

Methods' Summary

initialize is called to initialize the frame within a window.
getContainerWindow provides access to the window of the frame.
setCreator sets the frame container that created this frame.
getCreator
getName
setName sets the name of the frame.
findFrame searches for a frame with the specified name.
isTop determines if the frame is a top frame.
activate activates this frame and thus the component within.
deactivate is called by the creator frame when another sub-frame gets activated.
isActive determines if the frame is active.
setComponent sets a new component into the frame.
getComponentWindow
getController
contextChanged notifies the frame that the context of the controller within this frame changed (i.e., the selection).
addFrameActionListener registers an event listener, which will be called when certain things happen to the components within this frame or within sub-frames of this frame.
removeFrameActionListener unregisters an event listener which was registered with XFrame::addFrameActionListener() .

Methods' Details

initialize
 
void
initialize(
[ in ] com::sun::star::awt::XWindow xWindow );

Description
is called to initialize the frame within a window.
See also
XFrame::getContainerWindow
getContainerWindow
 
com::sun::star::awt::XWindow
getContainerWindow();
Description
provides access to the window of the frame.

Normally this is used as the parent window of the controller window.

See also
XFrame::initialize
setCreator
 
[ oneway ] void
setCreator(
[ in ] com::sun::star::frame::XFramesSupplier xCreator );

Description
sets the frame container that created this frame.

Only the creator is allowed to call this method.

getCreator
 
com::sun::star::frame::XFramesSupplier
getCreator();
Returns
the frame container that created this frame.
getName
 
string
getName();
Returns
the programmatic name of this frame.

See specification of HTML framesets for reference.

setName
 
[ oneway ] void
setName(
[ in ] string aName );

Description
sets the name of the frame.

Normally the name of the frame is set initially.

findFrame
 
com::sun::star::frame::XFrame
findFrame(
[ in ] string aTargetFrameName,
[ in ] long nSearchFlags );

Description
searches for a frame with the specified name.

Frames may contain other frames (e.g., a frameset) and may be contained in other frames. This hierarchy is searched with this method.

First some special names are taken into account, i.e. "", "_self", "_top", "_active" etc. nSearchFlags is ignored when comparing these names with aTargetFrameName ; further steps are controlled by nSearchFlags . If allowed, the name of the frame itself is compared with the desired one, and then ( again if allowed ) the method is called for all children of the frame. Finally may be called for the parent frame (if allowed).

If no frame with the given name is found, a new top frame is created; if this is not suppressed by a special FrameSearchFlag . The new frame also gets the desired name.

isTop
 
boolean
isTop();
Description
determines if the frame is a top frame.

In general a top frame is the frame which is a direct child of a task frame or which does not have a parent. If a frame returns true for this method, all calls to XDispatchProvider::queryDispatch have to stop the search at such a frame unless the flag FrameSearchFlag::TASKS is set.

activate
 
[ oneway ] void
activate();
Description
activates this frame and thus the component within.

At first the frame sets itself as the active frame of its creator by calling , then it broadcasts a FrameActionEvent with FrameAction::FRAME_ACTIVATED . The component within this frame may listen to this event to grab the focus on activation. For simple components this can be done by the FrameLoader .

Finally, most frames may grab the focus to one of its windows or forward the activation to a sub-frame.

deactivate
 
[ oneway ] void
deactivate();
Description
is called by the creator frame when another sub-frame gets activated.

At first the frame deactivates its active sub-frame, if any. Then broadcasts a FrameActionEvent with FrameAction::FRAME_DEACTIVATING .

isActive
 
boolean
isActive();
Description
determines if the frame is active.
setComponent
 
boolean
setComponent(
[ in ] com::sun::star::awt::XWindow xComponentWindow,
[ in ] com::sun::star::frame::XController xController );

Description
sets a new component into the frame.
getComponentWindow
 
com::sun::star::awt::XWindow
getComponentWindow();
Returns
the current visible component in this frame.

The frame is the owner of the window.

getController
 
com::sun::star::frame::XController
getController();
Returns
the current controller within this frame.

Normally it is set by a frame loader.

contextChanged
 
void
contextChanged();
Description
notifies the frame that the context of the controller within this frame changed (i.e., the selection).

According to a call to this interface, the frame calls with FrameAction::CONTEXT_CHANGED to all listeners which are registered using . For external controllers this event can be used to requery dispatches.

addFrameActionListener
 
[ oneway ] void
addFrameActionListener(
[ in ] com::sun::star::frame::XFrameActionListener xListener );

Description
registers an event listener, which will be called when certain things happen to the components within this frame or within sub-frames of this frame.

E.g., it is possible to determine instantiation/destruction and activation/deactivation of components.

removeFrameActionListener
 
[ oneway ] void
removeFrameActionListener(
[ in ] com::sun::star::frame::XFrameActionListener xListener );

Description
unregisters an event listener which was registered with XFrame::addFrameActionListener() .

Top of Page