Home · All Classes · Grouped Classes · Annotated · Functions

WindowManagement Class Reference

The WindowManagement class allows you to monitor and control the application windows in the system. More...

    #include <WindowManagement>

Inherits QObject.

Public Types

Public Functions

Signals

Static Public Members

Additional Inherited Members


Detailed Description

The WindowManagement class allows you to monitor and control the application windows in the system.

The WindowManagement class allows server windows to be protected, preventing other windows from obscuring them, and docked to the edge of the screen.

The WindowManagement class also updates the value space with the following keys that can be used to track window status:

KeyDescription
/UI/ActiveWindow/TitleThe title of the currently active window
/UI/ActiveWindow/RectThe rectangle of the currently active window
/UI/ActiveWindow/CaptionThe caption of the currently active window. The caption is the same as the title except that it isn't changed for popup windows that only consume a small part of the screen.

These value space keys are updated if either the WindowManagement task is running, or at least one instance of the WindowManagement class has been instantiated.

This class is part of the Qtopia server and cannot be used by other Qtopia applications.


Member Type Documentation

enum WindowManagement::DockArea

The DockArea enum type defines the areas where widgets can be docked:

ConstantValueDescription
WindowManagement::Top0- the top of the screen.
WindowManagement::Bottom1- the Bottom of the screen.
WindowManagement::Left2- the Left of the screen.
WindowManagement::Right3- the Right of the screen.


Member Function Documentation

WindowManagement::WindowManagement ( QObject * parent = 0 )

Construct a new WindowManagement instance with the specified parent.

QString WindowManagement::activeAppName ()   [static]

Returns a reference to the name of the active application, ie the one that is visible. If there is no active application, the string is returned empty.

void WindowManagement::closeWindow ( WId winId )   [static]

Sends a close message to the window winId. This is used for applications that do not support Qtopia's soft menu bar.

See also supportsSoftMenus().

void WindowManagement::dockWindow ( QWidget * window, DockArea placement, int screen = -1 )   [static]

Docks a top-level widget window on a side of the screen specified by placement. The widget is placed according to the order that it was docked, its sizeHint() and whether previously docked widgets are visible. The desktop area available to QWidget::showMaximized() will exclude any visible docked widgets.

For example, if a widget is docked at the bottom of the screen, its sizeHint() will define its height and it will use the full width of the screen. If a widget is then docked to the right, its sizeHint() will define its width and it will be as high as possible without covering the widget docked at the bottom.

This function is useful for reserving system areas such as taskbars and input methods that should not be covered by applications. Even after calling this method, an application can manually position itself over the docked window. To prevent this, also call WindowManagement::protectWindow() on the window.

void WindowManagement::dockWindow ( QWidget * window, DockArea placement, const QSize & size, int screen = -1 )   [static]

This is an overloaded member function, provided for convenience.

Normally the QWidget::sizeHint() of the docked widget is used to determine its docked size. If the sizeHint() is not correct, the size parameter can be used to override it. The window, placement and screen parameters are used as above.

void WindowManagement::hideDockedWindow ( QWidget * window )   [static]

Hides the docked window. While you can call QWidget::hide() on the docked window, using this function will result in smoother screen updates.

void WindowManagement::protectWindow ( QWidget * window )   [static]

Prevent application windows from being raised above the provided toplevel window. If an application window attempts to obscure any of the protected region, the protected window will immediately be raised above it.

void WindowManagement::setLowestWindow ( QWidget * window )   [static]

Sets window as the lowest in the screen stacking order, below all normal and docked windows. This is normally used only for the QAbstractServerInterface widget.

void WindowManagement::showDockedWindow ( QWidget * window )   [static]

Shows the docked window. While you can call QWidget::show() on the docked window, using this function may result in smoother screen updates.

bool WindowManagement::supportsSoftMenus ( WId winId )   [static]

Returns true if winId supports the Qtopia soft menu bar via the QSoftMenuBar class; false otherwise.

Under QWS, this function always returns true. Under X11, it will return false if the application uses a foreign widget toolkit other than Qtopia's. The soft menu bar changes its behavior so that the "back" button will send a close message to the foreign application using closeWindow().

See also closeWindow().

void WindowManagement::windowActive ( const QString & caption, const QRect & rect, WId window )   [signal]

Emitted whenever a window becomes active or the active window's caption changes. rect is the rectangle covered by the window.

void WindowManagement::windowCaption ( const QString & caption )   [signal]

Emitted whenever the active window caption changes.


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3