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 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 |
77 |
77 |
78 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 |
79 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; |
80 virtual QList<QContactDetail> supportedDetails(const QContact& contact) const; |
80 virtual QList<QContactDetail> supportedDetails(const QContact& contact) const = 0; |
81 |
81 |
82 /* Initiate the asynchronous action on the given contact (and optionally detail) */ |
82 /* Initiate the asynchronous action on the given contact (and optionally detail) */ |
83 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; |
84 |
84 |
85 /* The possible states of an action */ |
85 /* The possible states of an action */ |
86 enum State { |
86 enum State { |
87 InactiveState = 0, // operation not yet started |
87 InactiveState = 0, // operation not yet started |
88 AutonomousState, // operation started, no further information available - name under discussion. |
|
89 ActiveState, // operation started, not yet finished |
88 ActiveState, // operation started, not yet finished |
90 FinishedState, // operation successfully completed |
89 FinishedState, // operation successfully completed |
|
90 FinishedDetachedState, // operation started, no further information available - name under discussion. |
91 FinishedWithErrorState // operation finished, but error occurred |
91 FinishedWithErrorState // operation finished, but error occurred |
92 }; |
92 }; |
93 |
93 |
94 /* Returns the most recently received result, or an invalid QVariantMap if no results received */ |
94 virtual State state() const = 0; |
95 virtual QVariantMap result() const = 0; |
95 |
|
96 /* Returns the most recently received result, or an empty QVariantMap if no results received */ |
|
97 virtual QVariantMap results() const = 0; |
96 |
98 |
97 Q_SIGNALS: |
99 Q_SIGNALS: |
98 void progress(QContactAction::State state, const QVariantMap& result); |
100 void stateChanged(QContactAction::State); |
|
101 void resultsAvailable(); |
99 }; |
102 }; |
100 |
103 |
101 QTM_END_NAMESPACE |
104 QTM_END_NAMESPACE |
102 |
105 |
103 #endif |
106 #endif |