email_plat/nmail_client_api/nmapiemailservice.h
changeset 18 578830873419
child 20 ecc8def7944a
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef NMAPIEMAILSERVICE_H
       
    19 #define NMAPIEMAILSERVICE_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include "nmenginedef.h"
       
    24 #include "nmapimailbox.h"
       
    25 #include "nmapimessageenvelope.h"
       
    26 
       
    27 class NmEngine;
       
    28 
       
    29 /**
       
    30  * Client that wants to access mailboxes, messages and receive related events
       
    31  * use this class as "entry point". 
       
    32  */
       
    33 
       
    34 namespace EmailClientApi
       
    35 {
       
    36 class NMENGINE_EXPORT NmEmailService : public QObject
       
    37 {
       
    38     Q_OBJECT
       
    39 public:
       
    40 
       
    41     /*
       
    42      * constructor for NmEmailService
       
    43      */
       
    44     NmEmailService(QObject* parent);
       
    45 
       
    46     /*
       
    47      * destructor for NmEmailService
       
    48      */
       
    49     virtual ~NmEmailService();
       
    50 
       
    51     /*
       
    52      * Initialises email service. this must be called and initialised signal received 
       
    53      * before services of the library are used.
       
    54      */
       
    55     void initialise();
       
    56 
       
    57     /*
       
    58      *  frees resources.
       
    59      */
       
    60     void uninitialise();
       
    61 
       
    62     /*
       
    63      *gets mail message envelope by id (see also NmEventNotifier)
       
    64      */
       
    65     bool envelope( const quint64 mailboxId, const quint64 folderId, const quint64 envelopeId, NmMessageEnvelope &envelope );
       
    66 
       
    67     /*
       
    68      *  gets mailbox info by id (see also NmEventNotifier)
       
    69      */
       
    70     bool mailbox( const quint64 mailboxId, NmMailbox &mailboxInfo );
       
    71 
       
    72     /*
       
    73      * returns isrunning flag value
       
    74      */
       
    75     bool isRunning() const;
       
    76     signals:
       
    77     /*
       
    78      * this signal is emitted when initialisation is completed
       
    79      * boolean argument tells if initialisation succeeded
       
    80      */
       
    81     void initialized(bool);
       
    82 
       
    83 private:
       
    84     NmEngine* mEngine;
       
    85     bool mIsRunning;
       
    86 };
       
    87 }
       
    88 #endif /* NMEMAILSERVICE_H_ */