a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none }body { background: white; color: black; } -->

| Classes - Annotated - Tree - Functions - Home - Structure Qte

# QWSServer Class Reference

Server-specific functionality in Qt/Embedded More...

`#include <qwindowsystem_qws.h>`

Inherits QObject.

List of all member functions.

## Public Members

- QWSServer ( int flags = 0, QObject * parent=0, const char * name=0 )
- ~QWSServer ()
- enum ServerFlags { DisableKeyboard = 0x01, DisableMouse = 0x02 }
- enum GUIMode { NoGui = FALSE, NormalGUI = TRUE, Server }
- enum IMState { Reserved, IMCompose, IMEnd, IMInternal = 42, IMMarkedText }
- enum IMMouse { MousePress, MouseRelease, MouseMove }
- void sendIMEvent ( IMState state, const QString & txt, int cpos, int selLen ) (internal)
- class KeyboardFilter { public: virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )
- QWSWindow* windowAt ( const QPoint & pos )
- const QList<QWSWindow>& clientWindows ()
- void openMouse ()
- void closeMouse ()
- void openKeyboard ()
- void closeKeyboard ()
- void refresh ()
- void refresh ( const QRegion & )
- void enablePainting ( bool )
- void sendPropertyNotifyEvent ( int property, int state ) (internal)
- QWSPropertyManager* manager ()
- enum WindowEvent { Create=0x0001, Destroy=0x0002, Hide=0x0004, Show=0x0008, Raise=0x0010, Lower=0x0020, Geometry=0x0040, Active=0x0080, Name=0x0100 }

## Signals

- void windowEvent ( QWSWindow * w, QWSServer::WindowEvent e )
- void newChannel ( const QString & channel )
- void removedChannel ( const QString & channel )
- void markedText ( const QString & )

## Static Public Members

- void sendKeyEvent ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )
- void processKeyEvent ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) (internal)
- typedef const KeyMap* keyMap ()
- void setOverrideKeys ( QIntDict<QWSServer::KeyMap> * map )
- void setKeyboardFilter ( KeyboardFilter * f )
- void setCurrentInputMethod ( QWSInputMethod * im )
- void resetInputMethod ()
- void setMicroFocus ( int x, int y )
- void requestMarkedText () (internal)
- void setCurrentGestureMethod ( QWSGestureMethod * im ) (internal)
- void resetGestureMethod () (internal)
- void setDefaultMouse ( const char * )
- void setDefaultKeyboard ( const char * )
- void setMaxWindowRect ( const QRect & )
- void sendMouseEvent ( const QPoint & pos, int state )
- void setDesktopBackground ( const QImage & img )
- void setDesktopBackground ( const QColor & )
- QWSMouseHandler* mouseHandler ()
- void setMouseHandler ( QWSMouseHandler * ) (internal)
- QWSKeyboardHandler* keyboardHandler ()
- void setKeyboardHandler ( QWSKeyboardHandler * kh )
- void setScreenSaver ( QWSScreenSaver * ) (internal)
- void setScreenSaverIntervals ( int * ms, int eventBlockLevel )
- void setScreenSaverInterval ( int, int eventBlockLevel )
- void setScreenSaverIntervals ( int * ms )
- void setScreenSaverInterval ( int )
- bool screenSaverActive ()
- void screenSaverActivate ( bool )
- void restartScreenSaverTimer ()
- void processEventQueue () (internal)
- QList<QWSInternalWindowInfo>* windowList () (internal)
- void startup ( int flags ) (internal)
- void closedown () (internal)
- void beginDisplayReconfigure () (internal)
- void endDisplayReconfigure () (internal)
- void setCursorVisible ( bool )
- bool isCursorVisible ()

## Detailed Description

Server-specific functionality in Qt/Embedded

When you run a Qt/Embedded application, it either runs as a server or connects to an existing server. If it runs as a server, some additional operations are provided via the QWSServer class.

This class is instantiated by QApplication for Qt/Embedded server processes. You should never construct this class yourself.

A pointer to the QWSServer instance can be obtained via the global qwsServer variable.

## Member Type Documentation

### QWSServer::GUIMode

For internal use only.

### QWSServer::IMMouse

For internal use only.

### QWSServer::IMState

This enum type defines the Qt/Embedded Input Method events:

- `IMCompose` - an input method has sent composition text.
- `IMEnd` - an input method has sent accepted text.

See also QWSInputMethod::sendIMEvent().

### QWSServer::ServerFlags

For internal use only.

### QWSServer::WindowEvent

This enum type defines the Qt/Embedded window system events:

- `Create` - a new window has been created.
- `Destroy` - a window has been destroyed.
- `Hide` - a window has been hidden.
- `Show` - a window has been shown.
- `Raise` - a window has been raised.
- `Lower` - a window has been lowered.
- `Geometry` - the size and/or position of a window has changed.
- `Active` - a window has become the active window (has keyboard focus).

## Member Function Documentation

### QWSServer::QWSServer ( int flags = 0, QObject * parent=0, const char * name=0 )

Construct a QWSServer class.

This class is instantiated by QApplication for Qt/Embedded server processes. You should never construct this class yourself.

### QWSServer::~QWSServer ()

Destruct QWSServer.

### const QList<QWSWindow> & QWSServer::clientWindows ()

Returns the list of top-level windows. This list will change as applications add and remove wigdets so it should not be stored for future use. The windows are sorted in stacking order from top-most to lowest.

### void QWSServer::closeKeyboard ()

Closes keyboard device(s).

### void QWSServer::closeMouse ()

Closes pointer device(s).

### void QWSServer::enablePainting ( bool e )

Disables all painting on the display.

### bool QWSServer::isCursorVisible () `[static]`

Returns TRUE is the cursor is visible, or FALSE if it is hidden.

See also setCursorVisible().

### QWSKeyboardHandler* QWSServer::keyboardHandler () `[static]`

Returns the primary keyboard handler.

### QWSPropertyManager * QWSServer::manager ()

For internal use only.

### void QWSServer::markedText ( const QString & marked ) `[signal]`

For internal use only.

### QWSMouseHandler * QWSServer::mouseHandler () `[static]`

Returns the primary mouse handler.

### void QWSServer::newChannel ( const QString & channel ) `[signal]`

This signal is emitted when QCopChannel channel is created.

### void QWSServer::openKeyboard ()

Open keyboard device(s).

### void QWSServer::openMouse ()

Opens the mouse device(s).

### void QWSServer::refresh ()

Refreshes the entire display.

### void QWSServer::refresh ( const QRegion & region )

Refreshes the display defined by region.

### void QWSServer::removedChannel ( const QString & channel ) `[signal]`

This signal is emitted immediately after the QCopChannel channel is destroyed. Note that a channel is not destroyed until all listeners have unregistered.

### void QWSServer::resetInputMethod () `[static]`

Resets the state of the current input method if one is set and currently in a compose text state.

If input method doesn't send an accept or reject the compose text will force a reject of compose text.

### void QWSServer::screenSaverActivate ( bool activate ) `[static]`

Activates the screensaver immediately if `activate` is TRUE otherwise deactivates the screensaver.

### bool QWSServer::screenSaverActive () `[static]`

Returns TRUE if the screensaver is active (i.e. blanked).

### void QWSServer::sendKeyEvent ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) `[static]`

Send a key event. You can use this to send key events generated by "virtual keyboards".

### void QWSServer::sendMouseEvent ( const QPoint & pos, int state ) `[static]`

Send a mouse event.

### void QWSServer::setCurrentInputMethod ( QWSInputMethod * im ) `[static]`

Sets the current QWSInputMethod to im. The current input method is able to filter keys produced by keyboard devices before they are sent to any Qt/Embedded applications. If im is 0 clears the current input method.

See also resetInputMethod().

### void QWSServer::setCursorVisible ( bool visible ) `[static]`

Shows the cursor if visible is TRUE, otherwise hides the cursor.

See also isCursorVisible().

### void QWSServer::setDefaultKeyboard ( const char * k ) `[static]`

Set the keyboard driver to use if $QWS_KEYBOARD is not defined. The default is platform-dependant.

### void QWSServer::setDefaultMouse ( const char * m ) `[static]`

Set the mouse driver to use if $QWS_MOUSE_PROTO is not defined. The default is platform-dependant.

### void QWSServer::setDesktopBackground ( const QColor & c ) `[static]`

Sets the color to use as the background in the absence of obscuring windows.

### void QWSServer::setDesktopBackground ( const QImage & img ) `[static]`

Sets the image to use as the background in the absence of obscuring windows.

### void QWSServer::setKeyboardFilter ( KeyboardFilter * f ) `[static]`

Adds a filter to be invoked for all key events from physical keyboard drivers (events sent via processKeyEvent()).

The filter is not invoked for keys generated by virtual keyboard drivers (events send via sendKeyEvent()).

If f is 0, the most-recently added filter is removed and deleted. The caller is responsible for matching each addition with a corresponding removal.

### void QWSServer::setKeyboardHandler ( QWSKeyboardHandler * kh ) `[static]`

Sets the primary keyboard handler to kh.

### void QWSServer::setMaxWindowRect ( const QRect & r ) `[static]`

Sets the area of the screen which Qt/Embedded application will consider to be the maximum area to use for windows.

See also QWidget::showMaximized().

### void QWSServer::setOverrideKeys ( QIntDict<QWSServer::KeyMap> * map ) `[static]`

Changes the mapping of the keyboard; adding the scancode to Unicode mappings from map. The server takes over ownership of map and will delete it. Use QCollection::setAutoDelete() to control whether the contents of map should be deleted.

Passing a null pointer for map will revert to the default keymap.

### void QWSServer::setScreenSaverInterval ( int ms ) `[static]`

Sets a timeout for the screensaver to a ms milliseconds. A setting of zero turns off the screensaver. Events will be blocked at level -1.

### void QWSServer::setScreenSaverInterval ( int ms, int eventBlockLevel ) `[static]`

Sets a timeout for the screensaver to a ms milliseconds. A setting of zero turns off the screensaver. eventBlockLevel is the level at which events get blocked.

### void QWSServer::setScreenSaverIntervals ( int * ms ) `[static]`

Sets an array of timeouts for the screensaver to a list of ms milliseconds. A setting of zero turns off the screensaver. The array must be 0-terminated. Events will be blocked at level -1.

### void QWSServer::setScreenSaverIntervals ( int * ms, int eventBlockLevel ) `[static]`

Sets an array of timeouts for the screensaver to a list of ms milliseconds. A setting of zero turns off the screensaver. The array must be 0-terminated. eventBlockLevel is the level at which events get blocked.

### QWSWindow * QWSServer::windowAt ( const QPoint & pos )

Returns the window containing the point `pos` or 0 if there is no window under the point.

### void QWSServer::windowEvent ( QWSWindow * window, QWSServer::WindowEvent event ) `[signal]`

This signal is emitted when a window system event event has been processed for window.

### void QWSServer::beginDisplayReconfigure () `[static]`

For internal use only.

### void QWSServer::closedown () `[static]`

For internal use only.

### void QWSServer::endDisplayReconfigure () `[static]`

For internal use only.

### void QWSServer::processEventQueue () `[static]`

For internal use only.

### void QWSServer::processKeyEvent ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) `[static]`

For internal use only.

### void QWSServer::requestMarkedText () `[static]`

For internal use only.

### void QWSServer::resetGestureMethod () `[static]`

For internal use only.

### void QWSServer::sendIMEvent ( QWSServer::IMState state, const QString & txt, int cpos, int selLen )

For internal use only.

### void QWSServer::sendPropertyNotifyEvent ( int property, int state )

For internal use only.

### void QWSServer::setCurrentGestureMethod ( QWSGestureMethod * im ) `[static]`

For internal use only.

### void QWSServer::setMouseHandler ( QWSMouseHandler * mh ) `[static]`

For internal use only.

### void QWSServer::setScreenSaver ( QWSScreenSaver * ss ) `[static]`

For internal use only.

### void QWSServer::startup ( int flags ) `[static]`

For internal use only.

### QList<QWSInternalWindowInfo> * QWSServer::windowList () `[static]`

For internal use only.

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):

This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.