Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QNetworkState class provides very generic information about the connectivity state of the Qt Extended device. More...
#include <QNetworkState>
Inherits QObject.
The QNetworkState class provides very generic information about the connectivity state of the Qt Extended device.
In addition to QtopiaNetwork::online() which returns the current connectivity state QNetworkState provides the connected() and disconnected() signals which are emitted when the connectivity changes. If more specific information about a particular device is required QNetworkDevice should be used.
interfacesOnline() returns the list of interfaces which are online. An network interface is identified via its device handle which is the configuration file that specifies the device parameter. If it is required to enumerate all or a particular type of network devices (regardless of their state) availableNetworkDevices() can be used. The reverse operation is provided by deviceType().
QNetworkState also provides gateway/routing information. The gateway() function returns the devHandle belonging to the network device that currently provides the default route. The defaultGatewayChanged() signal is emitted when the default route changes. The default WAP configuration is returned via defaultWapAccount().
See also QtopiaNetwork, QNetworkDevice, and QNetworkConnection.
Constructs a QNetworkState object with the specified parent.
Destructs the QNetworkState object.
Returns the list of known network devices of type. If type is QtopiaNetwork::Any it returns all known devices. A device is considered to be known if a configuration file exists for it. The returned Qt Extended network interface handles are equivalent to the full qualified path to the configuration file.
See also QtopiaNetwork::availableNetworkConfigs().
This signal is emitted when Qt Extended changes from offline to online. If the connectivity state of a particular device is required QNetworkDevice::state() should be used.
See also QtopiaNetwork::online().
This signal is emitted when the default gateway for network packages changes. Such a change usually implies that a new route and new DNS information have been set. handle is the new default interface and local contains the IP details for handle. An empty handle implies that no new default gateway is available. This may happen when the last online interface changes its state to offline.
See also gateway().
Returns the default WAP account. If no default account has been set this function returns an empty string. The returned account can be accessed via QWapAccount.
QNetworkState state;
QString wapConf = state.defaultWapAccount();
if ( !wapConf.isEmpty() ) {
QWapAccount acc( state.defaultWapAccount() );
QString name = acc.name(); //returns user visibile name
}
See also QWapAccount.
Returns the type of devHandle.
This signal is emitted when Qt Extended changes from online to offline. If the connectivity state of a particular device is required QNetworkDevice::state() should be used.
See also QtopiaNetwork::online().
Returns the handle to the network interface that is currently used as default gateway for network packages. If QtopiaNetwork::online() returns false this function returns an empty string.
This function returns the list of all interface which are online at the time of the function call. The returned list contains the device handles for these interfaces.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |