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

Setting Class Reference

The Setting class provides applications with a mechanism to add their own settings to a profile. More...

Public Functions

Detailed Description

The Setting class provides applications with a mechanism to add their own settings to a profile.

Applications may integrate with the Qt Extended profiles by adding their own settings. Optionally, when the profile changes the application will be notified and instructed to apply the new settings.

Most profile editing applications (such as Ring Profiles in Qt Extended Phone) will use the Settings service to interactively acquire settings from applications to add in this way, but it is not necessary to do so.

Application settings are added to a profile through the QPhoneProfile::setApplicationSettings() or QPhoneProfile::setApplicationSetting() methods and read via the QPhoneProfile::applicationSetting() call.

See also QPhoneProfile.

Member Function Documentation

Setting::Setting ()

Constructs a null application setting object.

Setting::Setting ( const QString & application )

Constructs an empty application setting object for application.

Setting::Setting ( const Setting & other )

Constructs a copy of other.

QString Setting::applicationName () const

Returns the application to which this setting object applies, or an empty string if this is a null settings object.

See also setApplicationName().

QString Setting::data () const

Returns the data portion of this setting.

See also setData().

QString Setting::description () const

Returns an optional visual description for this setting. Generally this is the visual name of the application.

See also setDescription().

bool Setting::isNull () const

Returns true if this setting is null; otherwise returns false. A null object is one that has an empty applicationName().

bool Setting::notifyOnChange () const

Returns true if the application will be notified when the profile changes; otherwise returns false.

Applications will be notified with a Settings::activateSettings(QString) message via QPE/Application/appname when they are to apply settings. appname is applicationName() and the parameter is data() portion of the setting.

If the profile changes to one where the application has not added a custom setting from one where the application has added a custom setting, a Settings::activateDefault() message will be sent.

Therefore applications should be listening to the Qt Extended application channels to handle these requests. For example, in the application:

        connect( qApp, SIGNAL(appMessage(QString,QByteArray)),
            this, SLOT(receive(QString,QByteArray)) );

    void SomeApplication::receive( const QString& message, const QByteArray& data )
        QDataStream stream( data );
        if ( message == "Settings::activateSettings(QString)" ) {
            ... // parse and apply application settings data
        } else if ( message == "Settings::activateDefault()" ) {
            applyDefault(); // apply application default settings

See also setNotifyOnChange(), SettingsService, and QtopiaApplication::appMessage().

void Setting::setApplicationName ( const QString & name )

Sets the application name for this setting.

See also applicationName().

void Setting::setData ( const QString & data )

Set the setting data for this setting.

See also data().

void Setting::setDescription ( const QString & description )

Sets the setting description for this setting.

See also description().

void Setting::setNotifyOnChange ( bool notifyOnChange )

Sets whether the application is notified on changes to the profile or not. If notifyOnChange is true applications are notified, otherwise they are not.

See also notifyOnChange().

bool Setting::operator!= ( const Setting & other ) const

Returns true if setting other is not equal to this setting; otherwise returns false.

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

Assigns other to this setting and returns a reference to this setting.

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

Returns true if setting other is equal to this setting; otherwise returns false.

Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3