Home · All Classes · Grouped Classes · Annotated · Functions

QAbstractServerInterface Class Reference

The QAbstractServerInterface class allows the Qtopia Server UI to be replaced. More...

    #include <QAbstractServerInterface>

Inherits QWidget.

Inherited by PhoneLauncher.

Public Functions

Additional Inherited Members

Detailed Description

The QAbstractServerInterface class allows the Qtopia Server UI to be replaced.

While it is usually easier to customize one of the existing Qtopia server interfaces, when building a product on top of the Qtopia system, it is sometimes desirable to replace the entire Qtopia server user interface. Qtopia supports replacing the server user interface through the QAbstractServerInterface class.

The Qtopia server user interface is reponsible for direct interaction with the user. Core system services, such as telephony and application launching, are handled independently within the system and are not affected by replacing the UI. Likewise, Qtopia APIs that require a server-side UI component, such as QSoftMenuBar, also include server side APIs, QSoftMenuBarProvider in the case of QSoftMenuBar, which allows their functionality to be maintained or adapted to the new UI model. In this way, it is relatively simple to replace the server's visual interface while maintaining a functioning and featureful Qtopia platform.

Replacing the entire server user interface consists of three steps:

  1. Implement a QAbstractServerInterface derived class that provides the user interface.

    The Qtopia server itself provides no UI outside of this implementation (with the exception of some dialogs, all of which can be disabled through the StandardDialogs class) and so the implementation must provide all aspects of the user interface.

    Some helpful widget and backend classes are provided that make implementing a server UI easier. The documentation for these classes can be perused in the QtopiaServer group.

  2. Mark the QAbstractServerInterface implementation as a replacable widget using the QTOPIA_REPLACE_WIDGET() or QTOPIA_REPLACE_WIDGET_OVERRIDE() macros.

    For example, if creating a new UI implementation class named TestServerInterface, the following stub code may be appropriate:

        // testserverinterface.h
        class TestServerInterface : public QAbstractServerInterface
            TestServerInterface(QWidget *parent = 0, Qt::WFlags flags = 0);
            // ... declaration ...
        // testserverinterface.cpp
        // ... definition ...
        QTOPIA_REPLACE_WIDGET(QAbstractServerInterface, TestServerInterface);

    Note that QAbstractServerInterface derived type, like all that use the widget replacement mechanism, must have a standard (QWidget *, Qt::WFlags) constructor.

  3. Set the custom implementation as the in-use server interface.

    During startup, the Qtopia Server uses the standard qtopiaWidget() method to acquire a server interface instance. As such, all the mechanisms available for configuring server widgets also work in configuring the server interface. In summary,

    1. Explicitly specify the new server interface in the Mapping/ServerInterface key of the Trolltech/ServerWidgets configuration file.
    2. Specify the default in the Trolltech/ServerWidgets file such that it will select your implementation.
    3. Remove all other implementations of QAbstractServerInterface from the build.
    4. Use QTOPIA_REPLACE_WIDGET_OVERRIDE() to ensure that the correct implementation is always selected.

The server interface is constructed after all other Qtopia Server tasks. The server constructs it as a toplevel, frameless widget. If during startup an appropriate QAbstractServerInterface implementation cannot be found, the system will run without a primary user interface.

For more details can be found in the server widget documentation.

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

Member Function Documentation

QAbstractServerInterface::QAbstractServerInterface ( QWidget * parent = 0, Qt::WFlags flags = 0 )

Construct a new QAbstractServerInterface with the specified parent and widget flags.

Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3