email_plat/nmail_client_api/nmapiemailservice.h
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 68 83cc6bae1de8
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    16  */
    16  */
    17 
    17 
    18 #ifndef NMAPIEMAILSERVICE_H
    18 #ifndef NMAPIEMAILSERVICE_H
    19 #define NMAPIEMAILSERVICE_H
    19 #define NMAPIEMAILSERVICE_H
    20 
    20 
       
    21 #include <nmapidef.h>
    21 #include <QObject>
    22 #include <QObject>
    22 
    23 
    23 #include "nmenginedef.h"
    24 class NmApiEngine;
    24 #include "nmapimailbox.h"
       
    25 #include "nmapimessageenvelope.h"
       
    26 
    25 
    27 class NmEngine;
    26 /*!
    28 
    27    Client that wants to access mailboxes, messages and receive related events
    29 /**
    28    use this class as "entry point". 
    30  * Client that wants to access mailboxes, messages and receive related events
       
    31  * use this class as "entry point". 
       
    32  */
    29  */
    33 
    30 
    34 namespace EmailClientApi
    31 namespace EmailClientApi
    35 {
    32 {
    36 class NMENGINE_EXPORT NmEmailService : public QObject
    33 
       
    34 class NmApiMessageEnvelope;
       
    35 class NmApiMailbox;
       
    36 
       
    37 class NMAPI_EXPORT NmApiEmailService : public QObject
    37 {
    38 {
    38     Q_OBJECT
    39     Q_OBJECT
    39 public:
    40 public:
    40 
    41 
    41     /*
    42     /*!
    42      * constructor for NmEmailService
    43        constructor for NmApiEmailService
    43      */
    44      */
    44     NmEmailService(QObject* parent);
    45     NmApiEmailService(QObject* parent);
    45 
    46 
    46     /*
    47     /*!
    47      * destructor for NmEmailService
    48        destructor for NmApiEmailService
    48      */
    49      */
    49     virtual ~NmEmailService();
    50     virtual ~NmApiEmailService();
    50 
    51 
    51     /*
    52     /*!
    52      * Initialises email service. this must be called and initialised signal received 
    53        Initialises email service. this must be called and initialised signal received 
    53      * before services of the library are used.
    54        before services of the library are used.
    54      */
    55      */
    55     void initialise();
    56     void initialise();
    56 
    57 
    57     /*
    58     /*!
    58      *  frees resources.
    59         frees resources.
    59      */
    60      */
    60     void uninitialise();
    61     void uninitialise();
    61 
    62 
    62     /*
    63     /*!
    63      *gets mail message envelope by id (see also NmEventNotifier)
    64        gets mail message envelope by id (see also NmApiEventNotifier)
    64      */
    65      */
    65     bool getEnvelope( const quint64 mailboxId, const quint64 folderId, const quint64 envelopeId, NmMessageEnvelope &envelope );
    66     bool getEnvelope(const quint64 mailboxId, 
       
    67                      const quint64 folderId, 
       
    68                      const quint64 envelopeId, 
       
    69                      EmailClientApi::NmApiMessageEnvelope &envelope);
    66 
    70 
    67     /*
    71     /*!
    68      *  gets mailbox info by id (see also NmEventNotifier)
    72         gets mailbox info by id (see also NmApiEventNotifier)
    69      */
    73      */
    70     bool getMailbox( const quint64 mailboxId, NmMailbox &mailboxInfo );
    74     bool getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo);
    71 
    75 
    72     /*
    76     /*!
    73      * returns isrunning flag value
    77        returns isrunning flag value
    74      */
    78      */
    75     bool isRunning() const;
    79     bool isRunning() const;
    76     signals:
    80     signals:
    77     /*
    81     /*!
    78      * this signal is emitted when initialisation is completed
    82        this signal is emitted when initialisation is completed
    79      * boolean argument tells if initialisation succeeded
    83        boolean argument tells if initialisation succeeded
    80      */
    84      */
    81     void initialized(bool);
    85     void initialized(bool);
    82 
    86 
    83 private:
    87 private:
    84     NmEngine* mEngine;
    88     NmApiEngine *mEngine;
    85     bool mIsRunning;
    89     bool mIsRunning;
    86 };
    90 };
    87 }
    91 }
    88 #endif /* NMEMAILSERVICE_H_ */
    92 #endif /* NMAPIEMAILSERVICE_H */