diff -r 6c59112cfd31 -r 38bf5461e270 email_plat/nmail_client_api/inc/nmapieventnotifier.h --- a/email_plat/nmail_client_api/inc/nmapieventnotifier.h Thu Sep 30 11:43:07 2010 +0300 +++ b/email_plat/nmail_client_api/inc/nmapieventnotifier.h Thu Oct 14 17:33:43 2010 +0300 @@ -22,8 +22,6 @@ #include #include -struct NmApiEvent; - namespace EmailClientApi { class NmApiEventNotifierPrivate; @@ -35,8 +33,8 @@ \code NmApiEventNotifier *notifier = new NmApiEventNotifier(this); notifier->start(); - connect(notifier,SIGNAL(messageEvent(MessageEvent,quint64,quint64,QList)),this, - SLOT(processMessage(MessageEvent,quint64,quint64,QList)),Qt::QueuedConnection); + connect(notifier,SIGNAL(messageEvent(EmailClientApi::MessageEvent,quint64,quint64,QList)),this, + SLOT(processMessage(EmailClientApi::MessageEvent,quint64,quint64,QList)),Qt::QueuedConnection); \endcode And then when want to end need to do: \code @@ -48,70 +46,20 @@ { Q_OBJECT public: - /*! - Constructor - */ + NmApiEventNotifier(QObject *parent); - - /*! - Destructor - */ virtual ~NmApiEventNotifier(); - - /*! - Start monitoring email events - - Return value informs if monitoring system is up - */ virtual bool start(); - - /*! - Cancels monitoring. - - In user responsibility is to cancel monitoring. - On end it clear buffer events and emits \sa NmApiMessageTask::canceled() signal. - */ virtual void cancel(); - - /*! - Checks if event notifier is running. - */ bool isRunning() const; - signals: - /*! - This signal is emited when buffer of mailbox events is ready to send. Buffer is list of mailbox events with id. - - - It emits signals grouped by events. So there will be as much signals as much there are events. - For safety when connect it need to use \sa Qt::QueuedConnection. - After that use \sa EmailClientApi::NmEmailService::getMailbox to get object. - \param event Event of mailbox - \param id List of mailbox ids where event occur. - */ +signals: + void mailboxEvent(EmailClientApi::NmApiMailboxEvent event, QList id); - - /*! - This signal is emited when buffer of messages events is ready to send. Buffer is list of messages events with id. - * - It emits signals grouped by events, mailbox and folder. So there will be as much signals as much there are events. - For safety when connect it need to use \sa Qt::QueuedConnection. - After that use \sa EmailClientApi::NmApiEmailService::getEnvelope to get object. - - \param event Event of messages - \param mailboxId Message mailbox - \param folderId Message folder - \param envelopeIdList List of messages ids where event occur - */ void messageEvent(EmailClientApi::NmApiMessageEvent event, quint64 mailboxId, quint64 folderId, QList envelopeIdList); public slots: - /*! - It check each object in buffer and emit signal with it. - - After end of work of this function buffer is empty. - It is called by timeout signal from timer. - */ + void sendEventsFromBuffer(); private: