Home · All Classes · Annotated · Functions

QtopiaNetwork Class Reference

#include <QtopiaNetwork>

Public Types

Static Public Members


Detailed Description

This class provides static convinience functions for various network parameter.

In general it allows the managing of existing network configurations. The managment functions include the starting and stopping of interfaces and other functions which may be useful for applications which monitor the connectivity state of the Qtopia device.


Member Type Documentation

enum QtopiaNetwork::TypeFlag
flags QtopiaNetwork::Type

This enum is used to describe the type of a network connection.

ConstantValueDescription
QtopiaNetwork::LAN0x0001Ethernet based network
QtopiaNetwork::WirelessLAN0x0002Wireless network
QtopiaNetwork::Dialup0x0004The connection is established via a dial-up connection
QtopiaNetwork::GPRS0x0008The connection is established via GPRS
QtopiaNetwork::Bluetooth0x0010The network is based on bluetooth
QtopiaNetwork::Any0xFFFFA place holder for any arbitrary network type.

These sub types are used in conjunction with QtopiaNetwork::GPRS and QtopiaNetwork::Dialup only:

ConstantValueDescription
QtopiaNetwork::PhoneModem The network connection is established via the internal phone modem (this flag is defined for Qtopia Phone Edition only).
QtopiaNetwork::NamedModem0x0200A serial network connection using a specific device such as /dev/ttyS0 is established. The device name is given in the configuration file.

These sub types specify the type of the external device which is used to establish the connection.

ConstantValueDescription
QtopiaNetwork::PCMCIA0x0400The network device is an attached PCMCIA card

The Type type is a typedef for QFlags<TypeFlag>. It stores an OR combination of TypeFlag values.


Member Function Documentation

QStringList QtopiaNetwork::availableNetworkConfigs ( QtopiaNetwork::Type t = QtopiaNetwork::Any, const QString & path = QString() )   [static]

Returns a list of file names (absolute path). These file names point to QSettings files which contain the settings for all known QtopiaNetworkInterfaces of type t. path specifies the directory where the lookup takes place.

If t is Any it returns all known NetworkInterfaces. If path is empty the lookup will take place in settingsDir().

QPointer<QtopiaNetworkInterface> QtopiaNetwork::loadPlugin ( const QString & confFile )   [static]

Loads the appropriate network plugin for the configuration in confFile.

bool QtopiaNetwork::networkOnline ()   [static]

Returns true if any known network interface is online/connected. This can be used to check the general connectivity status of the Qtopia environment.

Dynamic state updates can be obtained by subscribing to "QPE/Network" channel. Whenever the network state changes to either online and offline the "up()" and "down()" are sent respectively.

void QtopiaNetwork::setDefaultGateway ( const QString & confFile )   [static]

Sets the network interface defined by confFile as default gateway. If the device is connected to more than one network at a time this can be used to choose a preferred network for data transfers.

QString QtopiaNetwork::settingsDir ()   [static]

Returns the default directory for network interface configurations.

void QtopiaNetwork::shutdownNetwork ()   [static]

Stops all active network interfaces.

void QtopiaNetwork::startInterface ( const QString & confFile, const QVariant & options = QVariant() )   [static]

Requests that the network interface defined by confFile be started.

options is used internally by some network plugins. It allows to specify additional parameters which are specific to particular network plugins. Otherwise this parameter can safely be ignored.

void QtopiaNetwork::stopInterface ( const QString & confFile, bool deleteIface = false )   [static]

Stops the network interface defined by confFile. If deleteIface is true the server will delete any reference to and configuration information about this interface.

Type QtopiaNetwork::toType ( const QString & confFile )   [static]

Returns the type of network interface defined by confFile.

void QtopiaNetwork::unsetDefaultGateway ( const QString & confFile )   [static]

If excludeInterface is true the Qtopia network will set the default gateway to an interface that is not equal to confFile. This is useful if confFile goes offline and the caller doesn't care what interface should become the new default gateway. If excludeInterface is false the given confFile becomes the new default gateway.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7