qtcontactsmobility/src/contacts/qcontactaction.h
changeset 27 de1630741fbe
parent 25 76a2435edfd4
equal deleted inserted replaced
25:76a2435edfd4 27:de1630741fbe
    71 
    71 
    72 public:
    72 public:
    73     virtual ~QContactAction() = 0;
    73     virtual ~QContactAction() = 0;
    74 
    74 
    75     virtual QContactActionDescriptor actionDescriptor() const = 0;          // the descriptor which uniquely identifies this action
    75     virtual QContactActionDescriptor actionDescriptor() const = 0;          // the descriptor which uniquely identifies this action
    76     virtual QVariantMap Q_DECL_DEPRECATED metadata() const = 0;             // label, icon etc - under discussion! - deprecated
       
    77     virtual QVariantMap metaData() const = 0;                               // label, icon etc - under discussion! - replaces the above
    76     virtual QVariantMap metaData() const = 0;                               // label, icon etc - under discussion! - replaces the above
    78 
    77 
    79     virtual QContactFilter contactFilter(const QVariant& value = QVariant()) const = 0; // use for matching
    78     virtual QContactFilter contactFilter(const QVariant& value = QVariant()) const = 0; // use for matching
    80     virtual bool supportsDetail(const QContactDetail& detail) const = 0;    // whether this implementation supports the given detail
    79     virtual bool isDetailSupported(const QContactDetail &detail, const QContact &contact = QContact()) const = 0;
    81     virtual QList<QContactDetail> supportedDetails(const QContact& contact) const;
    80     virtual QList<QContactDetail> supportedDetails(const QContact& contact) const = 0;
    82 
    81 
    83     /* Initiate the asynchronous action on the given contact (and optionally detail) */
    82     /* Initiate the asynchronous action on the given contact (and optionally detail) */
    84     virtual void invokeAction(const QContact& contact, const QContactDetail& detail = QContactDetail()) = 0;
    83     virtual bool invokeAction(const QContact& contact, const QContactDetail& detail = QContactDetail(), const QVariantMap& parameters = QVariantMap()) = 0;
    85 
    84 
    86     /* The possible states of an action */
    85     /* The possible states of an action */
    87     enum State {
    86     enum State {
    88         InactiveState = 0,      // operation not yet started
    87         InactiveState = 0,      // operation not yet started
    89         AutonomousState,        // operation started, no further information available - name under discussion.
       
    90         ActiveState,            // operation started, not yet finished
    88         ActiveState,            // operation started, not yet finished
    91         FinishedState,          // operation successfully completed
    89         FinishedState,          // operation successfully completed
       
    90         FinishedDetachedState,  // operation started, no further information available - name under discussion.
    92         FinishedWithErrorState  // operation finished, but error occurred
    91         FinishedWithErrorState  // operation finished, but error occurred
    93     };
    92     };
    94 
    93 
    95     /* The possible statuses of an action - DEPRECATED to be replaced by State */
    94     virtual State state() const = 0;
    96     enum Status {
       
    97         Inactive = InactiveState,                   // operation not yet started
       
    98         Autonomous = AutonomousState,               // operation started, no further information available - name under discussion.
       
    99         Active = ActiveState,                       // operation started, not yet finished
       
   100         Finished = FinishedState,                   // operation successfully completed
       
   101         FinishedWithError = FinishedWithErrorState  // operation finished, but error occurred
       
   102     };
       
   103 
    95 
   104     /* Returns the most recently received result, or an invalid QVariantMap if no results received */
    96     /* Returns the most recently received result, or an empty QVariantMap if no results received */
   105     virtual QVariantMap result() const = 0;
    97     virtual QVariantMap results() const = 0;
   106 
    98 
   107 signals:
    99 Q_SIGNALS:
   108     void progress(QContactAction::Status status, const QVariantMap& result); // deprecated by the following signal
   100     void stateChanged(QContactAction::State);
   109     void progress(QContactAction::State state, const QVariantMap& result);   // replaces the above
   101     void resultsAvailable();
   110 };
   102 };
   111 
   103 
   112 QTM_END_NAMESPACE
   104 QTM_END_NAMESPACE
   113 
   105 
   114 #endif
   106 #endif