Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QWapAccount Class Reference
[QtBaseModule]

The QWapAccount class provides a wrapper around configuration files for WAP accounts. More...

    #include <QWapAccount>

Public Types

Public Functions


Detailed Description

The QWapAccount class provides a wrapper around configuration files for WAP accounts.

Qt Extended WAP account configurations are saved under $HOME/Applications/Network/wap and can either be accessed via QSettings or QWapAccount. However QWapAccount should be the preferred option because it does not require any knowledge of configuration file format which may change in the future.

    QString configPath = Qtopia::applicationFileName( "Network", "wap" );
    QDir configDir( configPath );
    QStringList files = configDir.entryList( QStringList("*.conf") );

    //just use first entry
    foreach(QString acc, files )
    {
        QWapAccount wap( acc );
    }

The various functions in this class reflect the various parameters which are stored in the WAP configuration.


Member Type Documentation

enum QWapAccount::MMSVisibility

This enum specifies the sender vsibility for MMS messages.

ConstantValueDescription
QWapAccount::Default0the visibility is chosen by the transfer agent
QWapAccount::SenderHidden1the sender address is not revealed
QWapAccount::SenderVisible2the sender address is part of the message


Member Function Documentation

QWapAccount::QWapAccount ()

Creates a new WAP account.

QWapAccount::QWapAccount ( const QString & wapConfig )

Creates a new WAP account and reads the details from wapConfig. If wapConfig is empty or doesn't exist a new account is created.

QWapAccount::QWapAccount ( const QWapAccount & other )

Creates a new WAP account by copying the other WAP account.

QWapAccount::~QWapAccount ()   [virtual]

Destroys the WAP account object.

QString QWapAccount::configuration () const

Returns the configuration file (file path and name ) where the details for this WAP account are stored.

QString QWapAccount::dataInterface () const

Returns the data interface that is related to this WAP account. This is useful when providers require specific APNs, usernames or passwords when connecting to the WAP gateway. The returns string is the path to the associated data account. The status of the data interface can be retrieved by using QNetworkDevice.

    QWapAccount acc;
    ...
    if ( !acc.dataInterface().isEmpty() ) {
        //get state of associated account
        QNetworkDevice interface( acc.dataInterface() );
        QtopiaNetworkInterface::Status s = interface.state();
        ...
        //start interface so that we can use this WAP account
        if ( s != QtopiaNetworkInterface::Up )
            QtopiaNetwork::startInterface( acc.dataInterface() );
    }

This function returns an empty string if there is no associated account.

See also setDataInterface(), QNetworkDevice, and QtopiaNetwork.

QUrl QWapAccount::gateway () const

Returns the URL of the WAP gateway (including port, login and password).

    QWapAccount acc(...)
    ...
    QUrl gateway = acc.gateway();
    QString password = gateway.password();
    QString username = gateway.userName();

See also setGateway() and QUrl.

bool QWapAccount::mmsDeliveryReport () const

Returns true when the sender permits delivery reports for send MMS messages.

See also setMmsDeliveryReport().

int QWapAccount::mmsExpiry () const

Returns the expiry time for MMS messages in hours.

See also setMmsExpiry().

QWapAccount::MMSVisibility QWapAccount::mmsSenderVisibility () const

Returns the sender visibility for MMS messages.

See also setMmsSenderVisibility().

QUrl QWapAccount::mmsServer () const

Returns the URL of the MMS serveri (including the port).

See also setMmsServer() and QUrl.

QString QWapAccount::name () const

Returns the user visible name of this WAP account.

See also setName().

void QWapAccount::setDataInterface ( const QString & ifaceHandle )

ifaceHandle becomes the default data interface for this WAP account.

See also dataInterface().

void QWapAccount::setGateway ( const QUrl & url )

url points to the new WAP gateway.

See also gateway().

void QWapAccount::setMmsDeliveryReport ( bool delRpt )

Sets the MMS delivery report permission to delRpt.

See also mmsDeliveryReport().

void QWapAccount::setMmsExpiry ( int mmsExpiry )

Sets the expiry time for MMS messages to mmsExpiry hours.

See also mmsExpiry().

void QWapAccount::setMmsSenderVisibility ( QWapAccount::MMSVisibility v )

Sets the MMS sender visibility to v.

See also mmsSenderVisibility().

void QWapAccount::setMmsServer ( const QUrl & url )

url points to the new MMS server.

See also mmsServer().

void QWapAccount::setName ( const QString & name )

name becomes the new name for this WAP account.

See also name().

QWapAccount & QWapAccount::operator= ( const QWapAccount & other )

Assignment operator. Sets data on this to be what is set on other.

bool QWapAccount::operator== ( const QWapAccount & other )

Returns true if this WAP account is the same as other. Two QWapAccount object are equal if they refer to the same configuration file.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3