Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# ServerInterface Class Reference

The ServerInterface class provides an interface for Qtopia custom launchers. More...

`#include <serverinterface.h>`

List of all member functions.

## Public Members

- virtual ~ServerInterface ()
- virtual void createGUI () = 0
- virtual void showGUI () = 0
- virtual void destroyGUI () = 0
- virtual void typeAdded ( const QString & type, const QString & name, const QPixmap & pixmap, const QPixmap & bgPixmap ) = 0
- virtual void typeRemoved ( const QString & type ) = 0
- virtual void applicationAdded ( const QString & type, const AppLnk & app ) = 0
- virtual void applicationRemoved ( const QString & type, const AppLnk & app ) = 0
- virtual void allApplicationsRemoved () = 0
- enum ApplicationState { Launching, Running, Terminated, Raised }
- virtual void applicationStateChanged ( const QString & name, ApplicationState state ) = 0
- virtual void documentAdded ( const DocLnk & doc ) = 0
- virtual void documentRemoved ( const DocLnk & doc ) = 0
- virtual void allDocumentsRemoved () = 0
- virtual void documentChanged ( const DocLnk & oldDoc, const DocLnk & newDoc ) = 0
- virtual void storageChanged ( const QList<FileSystem> & ) = 0
- virtual void applicationScanningProgress ( int percent ) = 0
- virtual void documentScanningProgress ( int percent ) = 0
- virtual bool requiresApplications () const = 0
- virtual bool requiresDocuments () const = 0
- enum DockArea { Top, Bottom, Left, Right }

## Static Public Members

- const AppLnkSet & appLnks ()
- void dockWidget ( QWidget * w, DockArea placement )
- void dockWidget ( QWidget * w, DockArea placement, const QSize & s )

## Detailed Description

The ServerInterface class provides an interface for Qtopia custom launchers.

The ServerInterface allows the user interface of the launcher to be customized to suit the device. For a PDA style device, the default launcher is strongly recommended, however specialist devices may choose to provide a launcher better suited to the application.

The launcher is fixed for any particular device and is not loaded as a plugin. Launcher interfaces must be compilied into the server by editing server.pro and server.cpp.

## Member Type Documentation

### ServerInterface::ApplicationState

The ApplicationState enum type specifies the state of an application. The possible values are:

- Launching - the application has been requested, but is not yet running.
- Running - the application is running.
- Terminated - the application has been terminated.

### ServerInterface::DockArea

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

- Top - the top of the screen.
- Bottom - the Bottom of the screen.
- Left - the Left of the screen.
- Right - the Right of the screen.

## Member Function Documentation

### void ServerInterface::allApplicationsRemoved ()`[pure virtual]`

Remove all applications from the launcher.

### void ServerInterface::allDocumentsRemoved ()`[pure virtual]`

Remove all documents from the launcher.

### const AppLnkSet & ServerInterface::appLnks ()`[static]`

Returns the current set of available applications.

### void ServerInterface::applicationAdded ( const QString & type, const AppLnk & app )`[pure virtual]`

Add an application app of type type to the launcher.

See also applicationRemoved().

### void ServerInterface::applicationRemoved ( const QString & type, const AppLnk & app )`[pure virtual]`

Remove an application app of type type from the launcher.

See also applicationAdded().

### void ServerInterface::applicationScanningProgress ( int percent )`[pure virtual]`

The system is scanning for installed applications. percent provides the percentage of the filesystems scanned. This function will always be called with percent equal to zero when scanning starts, and with percent equal to 100 when scanning is complete.

### void ServerInterface::applicationStateChanged ( const QString & name, ApplicationState state )`[pure virtual]`

The application name has changed state to state. This can be used to show launch notification and update a list of running applications.

### void ServerInterface::createGUI ()`[pure virtual]`

Implement this function to create the custom launcher UI.

See also showGUI().

### void ServerInterface::destroyGUI ()`[pure virtual]`

Implement this function to destroy the custom launcher UI. All resources allocated by createGUI() must be released.

### void ServerInterface::dockWidget ( QWidget * w, DockArea placement )`[static]`

Docks a top-level widget w 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.

### void ServerInterface::documentAdded ( const DocLnk & doc )`[pure virtual]`

Add a document doc to the launcher.

See also documentRemoved().

### void ServerInterface::documentChanged ( const DocLnk & oldDoc, const DocLnk & newDoc )`[pure virtual]`

Change document properties of existing document oldDoc to newDoc.

### void ServerInterface::documentRemoved ( const DocLnk & doc )`[pure virtual]`

Remove a document doc to the launcher.

See also documentAdded().

### void ServerInterface::documentScanningProgress ( int percent )`[pure virtual]`

The system is scanning for documents. percent provides the percentage of the filesystems scanned. This function will always be called with percent equal to zero when scanning starts, and with percent equal to 100 when scanning is complete.

### bool ServerInterface::requiresApplications () const`[pure virtual]`

Return TRUE if the custom launcher requires the server to scan for applications.

### bool ServerInterface::requiresDocuments () const`[pure virtual]`

Return TRUE if the custom launcher requires the server to scan for documents.

### void ServerInterface::showGUI ()`[pure virtual]`

Implement this function to show the custom launcher UI for the first time. Will be called after createGUI().

### void ServerInterface::storageChanged ( const QList<FileSystem> & )`[pure virtual]`

A filesystem has been added or removed.

### void ServerInterface::typeAdded ( const QString & type, const QString & name, const QPixmap & pixmap, const QPixmap & bgPixmap )`[pure virtual]`

An application category type has been added, for example "Games". name is the translated name of the category. pixmap and bgPixmap are small and large icons for the new type.

Types can be added or removed at any time, for example, when a storage card containing a non-standard category is inserted or removed.

See also typeRemoved().

### void ServerInterface::typeRemoved ( const QString & type )`[pure virtual]`

An application category type has been removed.

Types can be added or removed at any time, for example, when a storage card containing a non-standard category is inserted or removed.

See also typeAdded().

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.