Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QContactAction Class Reference

The QContactAction class provides an interface for performing an action on a QContact or QContactDetail. More...

    #include <QContactAction>

Inherits QObject.


Public Types

enum Status { Inactive, Autonomous, Active, Finished, FinishedWithError }

Public Functions

virtual ~QContactAction () = 0
virtual QContactActionDescriptor actionDescriptor () const = 0
virtual QContactFilter contactFilter ( const QVariant & value = QVariant() ) const = 0
virtual void invokeAction ( const QContact & contact, const QContactDetail & detail = QContactDetail() ) = 0
virtual QVariantMap metadata () const = 0
virtual QVariantMap result () const = 0
virtual QList<QContactDetail> supportedDetails ( const QContact & contact ) const
virtual bool supportsDetail ( const QContactDetail & detail ) const = 0
  • 29 public functions inherited from QObject

Signals

void progress ( QContactAction::Status status, const QVariantMap & result )

Static Public Members

QContactAction * action ( const QContactActionDescriptor & descriptor )
QList<QContactActionDescriptor> actionDescriptors ( const QString & actionName = QString(), const QString & vendorName = QString(), int implementationVersion = -1 )
QStringList availableActions ( const QString & vendor = QString(), int implementationVersion = -1 )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QContactAction class provides an interface for performing an action on a QContact or QContactDetail.

An action is anything that can be performed on a contact, or a detail of a contact. An example of an action might be "Send Email" or "Dial" or "Plot Navigation Route". One action may be implemented by multiple vendors, and indeed one vendor may provide multiple implementations of the same action. The name of an action identifies its semantics, while its implementation version distinguishes it from other implementations of the action by the same vendor.

Invocation of an action is asynchronous; at some stage after calling invokeAction() the action instance will emit the progress() signal. Any results of the action may be retrieved by calling result().

Each instance of a QContactAction is created by a QContactActionFactory when QContactActionFactory::instance() is called; the caller takes ownership of the action instance.

See also QContactActionFactory.


Member Type Documentation

enum QContactAction::Status

Describes the current status of the asynchronous action operation

ConstantValueDescription
QContactAction::Inactive0The operation has not yet been initiated
QContactAction::Autonomous1The operation was initiated but no further information is or will be available
QContactAction::Active2The operation was initiated and is not yet finished
QContactAction::Finished3The operation successfully completed
QContactAction::FinishedWithError4The operation has finished, but an error occurred


Member Function Documentation

QContactAction::~QContactAction ()   [pure virtual]

Clears any memory in use by this instance of the action implementation

QContactAction * QContactAction::action ( const QContactActionDescriptor & descriptor )   [static]

Returns a pointer to a new instance of the action implementation identified by the given descriptor. The caller takes ownership of the action implementation and must delete it to avoid leaking memory.

QContactActionDescriptor QContactAction::actionDescriptor () const   [pure virtual]

Returns the descriptor which uniquely identifies this action implementation. A descriptor consists of an action name, a vendor name and an implementation version. The name of the action identifies the action provided; different implementations of an action with the same name must provide the same functionality, but may differ in implementation semantics. Hence, the action name includes the major version of the interface definition implemented. The vendor name is the identification string of the vendor which has provided this implementation. The implementation version is the (minor) version of the implementation, and is vendor-specific.

See also QContactActionDescriptor.

QList<QContactActionDescriptor> QContactAction::actionDescriptors ( const QString & actionName = QString(), const QString & vendorName = QString(), int implementationVersion = -1 )   [static]

Returns a list of QContactActionDescriptor instances which identified implementations of the given actionName which are provided by the given vendorName and are of the given implementationVersion. If actionName is empty, descriptors for implementations of all actions are returned; if vendorName is empty, descriptors for implementations provided by any vendor and of any implementation version are returned; if implementationVersion is empty, descriptors for any implementations provided by the given vendorName of the given actionName are returned.

QStringList QContactAction::availableActions ( const QString & vendor = QString(), int implementationVersion = -1 )   [static]

Returns a list of identifiers of the available actions which are provided by the given vendor and of the given implementationVersion. If vendor is empty, actions from all vendors and of any implementation version are returned; if implementationVersion is empty, any actions from the given vendor (regardless of implementation version) are returned.

QContactFilter QContactAction::contactFilter ( const QVariant & value = QVariant() ) const   [pure virtual]

Returns a filter which may be used to filter contacts by the availability of this action implementation for them. If value is valid, only contacts which have a detail with the given value and for which the action is available are returned

void QContactAction::invokeAction ( const QContact & contact, const QContactDetail & detail = QContactDetail() )   [pure virtual]

Initiates the implemented action on the specified detail of the given contact, or on the first eligible detail saved in the contact if the given detail is empty. At some point after invocation, one or more progress() signals will be emitted by the action instance. The results of the action (if any) may be retrieved by calling result().

See also result() and progress().

QVariantMap QContactAction::metadata () const   [pure virtual]

Returns the metadata associated with this action, such as icons, labels or sound cues

void QContactAction::progress ( QContactAction::Status status, const QVariantMap & result )   [signal]

This signal is emitted by an action instance whose functionality has been initiated with invokeAction(). It provides clients with the current status of the action, and any result associated with the action. This signal must be emitted at least once by every action instance after invokeAction() is called.

If the action implementation is incapable of reporting the status of the operation (for example, the action is implemented via a one-way IPC call) it should emit the progress signal with status set to QContactAction::Autonomous.

QVariantMap QContactAction::result () const   [pure virtual]

Returns the result of the action, if any exists. Calling this function prior to receiving the progress() signal will not return a meaningful result.

QList<QContactDetail> QContactAction::supportedDetails ( const QContact & contact ) const   [virtual]

Returns a list of the details saved in the given contact which contain the fields required for this action to be performed on them.

The default implementation of this function simply tests all the details in the contact using supportsDetail()

bool QContactAction::supportsDetail ( const QContactDetail & detail ) const   [pure virtual]

Returns true if the provided detail contains the fields required for this action to be performed on it; otherwise, returns false

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.0-tp
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web