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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QContactAction Class

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

 #include <QContactAction>

Inherits: QObject.

Public Types

enum State { InactiveState, FinishedDetachedState, ActiveState, FinishedState, FinishedWithErrorState }

Public Functions

virtual ~QContactAction() = 0
virtual bool invokeAction(const QList<QContactActionTarget> & targets, const QVariantMap & parameters = QVariantMap()) = 0
bool invokeAction(const QContact & contact, const QContactDetail & detail = QContactDetail(), const QVariantMap & parameters = QVariantMap())
bool invokeAction(const QContactActionTarget & target, const QVariantMap & parameters = QVariantMap())
virtual QVariantMap results() const = 0
virtual State state() const = 0
  • 31 public functions inherited from QObject

Signals

void resultsAvailable()
void stateChanged(QContactAction::State newState)

Static Public Members

const QString ActionCall()
const QString ActionChat()
const QString ActionEmail()
const QString ActionMms()
const QString ActionOpenInEditor()
const QString ActionOpenInViewer()
const QString ActionSms()
const QString ActionVideoCall()
QContactAction * action(const QContactActionDescriptor & descriptor)
QList<QContactActionDescriptor> actionDescriptors(const QString & actionName = QString())
QStringList availableActions(const QString & serviceName = QString())
  • 11 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 9 protected functions 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 stateChanged() signal. Any results of the action may be retrieved by calling results(), and as results become available the action will emit resultsAvailable().

Each instance of a QContactAction is created by a QContactActionFactory when QContactAction::action() is called; the caller takes ownership of the action instance. Each action is uniquely described by a QContactActionDescriptor, which is passed to the QContactAction::action() function to instantiate an action.

See also QContactActionFactory and QContactActionFilter.

Member Type Documentation

enum QContactAction::State

Describes the current status of the asynchronous action operation

ConstantValueDescription
QContactAction::InactiveState0The operation has not yet been initiated
QContactAction::FinishedDetachedState3The operation was initiated but no further information is or will be available
QContactAction::ActiveState1The operation was initiated and is not yet finished
QContactAction::FinishedState2The operation successfully completed
QContactAction::FinishedWithErrorState4The 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

const QString QContactAction::ActionCall() [static]

The name of the default call action. Actions of this name will allow the client to call the specified action target (contact or detail of a contact).

See also actionDescriptors().

const QString QContactAction::ActionChat() [static]

The name of the default IM chat action. Actions of this name will allow the client to begin an IM chat session with the specified action target.

See also actionDescriptors().

const QString QContactAction::ActionEmail() [static]

The name of the default send email action. Actions of this name will either open a graphical element which allows the client to send the specified action target an email, or directly send the specified action target an email if the correct parameters to invocation are specified.

See also actionDescriptors().

const QString QContactAction::ActionMms() [static]

The name of the default send mms action. Actions of this name will allow the client to send the specified action target an mms.

See also actionDescriptors().

const QString QContactAction::ActionOpenInEditor() [static]

The name of the default "edit contact" action. Actions of this name will open a graphical element which allows the user to edit the contact.

See also actionDescriptors().

const QString QContactAction::ActionOpenInViewer() [static]

The name of the default view contact action. Actions of this name will open a graphical element which allows the user to view the contact.

See also actionDescriptors().

const QString QContactAction::ActionSms() [static]

The name of the default send sms action. Actions of this name will allow the client to send the specified action target an sms.

See also actionDescriptors().

const QString QContactAction::ActionVideoCall() [static]

The name of the default video call action. Actions of this name will allow clients to initiate a video call with the specified action target.

See also actionDescriptors().

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. The caller is able to delete the action at any time, however doing so prior to when the action transitions to a finished state may have an undefined outcome depending on the implementation of the action.

QList<QContactActionDescriptor> QContactAction::actionDescriptors(const QString & actionName = QString()) [static]

Returns a list of QContactActionDescriptor instances which identified implementations of the given actionName. The action name may either be one of the default action names, or any other arbitrary string.

Example:

 QList<QContactActionDescriptor> availableCallActions = QContactAction::actionDescriptors(QContactAction::ActionCall());

Example 2:

 QList<QContactActionDescriptor> customActions = QContactAction::actionDescriptors(QStringLiteral("customActionName"));

The actions which are available depend on which action plugins have been installed. For more information on this topic (for example, if you are interested in providing an action plugin for third-party developers to use) please see the relevant documentation for action providers.

QStringList QContactAction::availableActions(const QString & serviceName = QString()) [static]

Returns a list of identifiers of the available actions which are provided by the service provider with the given serviceName. If serviceName is empty, actions from all service providers and of any implementation version are returned.

bool QContactAction::invokeAction(const QList<QContactActionTarget> & targets, const QVariantMap & parameters = QVariantMap()) [pure virtual]

This is an overloaded function.

Initiates the action on the specified list of targets with the optional supplied parameters.

At some point after invocation, one or more resultsAvailable() signals will be emitted by the action instance. The results of the action (if any) may be retrieved by calling results(). When the state of the action changes, the stateChanged() signal will be emitted.

Returns true if the action was invoked successfully, otherwise false. The return value says nothing about whether the action which was invoked was successful or not, only whether it was initiated or the request for it to be initiated was sent successfully (e.g., if the action is implemented as a one-way RPC call).

See also results() and stateChanged().

bool QContactAction::invokeAction(const QContact & contact, const QContactDetail & detail = QContactDetail(), const QVariantMap & parameters = QVariantMap())

This is an overloaded function.

This is a convenience function.

Initiates the 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, with the given parameters specified.

See also results() and stateChanged().

bool QContactAction::invokeAction(const QContactActionTarget & target, const QVariantMap & parameters = QVariantMap())

This is an overloaded function.

This is a convenience function,

Initiates the action on the specified target with the given parameters specified.

See also results() and stateChanged().

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

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

void QContactAction::resultsAvailable() [signal]

This signal is emitted by an action instance whose functionality has been initiated with invokeAction() when results of the action are available. Not all actions will have results, and these actions will not emit the resultsAvailable() signal.

If the action implementation is incapable of reporting results of the operation (for example, the action is implemented via a one-way IPC call) it should transition to the QContactAction::FinishedDetachedState state immediately upon invocation.

State QContactAction::state() const [pure virtual]

Returns the current state of the action.

See also stateChanged().

void QContactAction::stateChanged(QContactAction::State newState) [signal]

This signal is emitted when the state of an action changes to the given newState.

See also state().

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 5.0-snapshot
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