|
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 <nmapidef.h> |
|
22 #include <QObject> |
|
23 |
|
24 class NmApiEngine; |
|
25 |
|
26 /*! |
|
27 Client that wants to access mailboxes, messages and receive related events |
|
28 use this class as "entry point". |
|
29 */ |
|
30 |
|
31 namespace EmailClientApi |
|
32 { |
|
33 |
|
34 class NmApiFolder; |
|
35 class NmApiMessageEnvelope; |
|
36 class NmApiMailbox; |
|
37 class NmApiMessage; |
|
38 |
|
39 class NMAPI_EXPORT NmApiEmailService : public QObject |
|
40 { |
|
41 Q_OBJECT |
|
42 public: |
|
43 |
|
44 /*! |
|
45 constructor for NmApiEmailService |
|
46 */ |
|
47 NmApiEmailService(QObject* parent); |
|
48 |
|
49 /*! |
|
50 destructor for NmApiEmailService |
|
51 */ |
|
52 virtual ~NmApiEmailService(); |
|
53 |
|
54 /*! |
|
55 Initialises email service. this must be called and initialised signal received |
|
56 before services of the library are used. |
|
57 */ |
|
58 void initialise(); |
|
59 |
|
60 /*! |
|
61 frees resources. |
|
62 */ |
|
63 void uninitialise(); |
|
64 |
|
65 /*! |
|
66 gets mail message envelope by id (see also NmApiEventNotifier) |
|
67 */ |
|
68 bool getEnvelope(const quint64 mailboxId, |
|
69 const quint64 folderId, |
|
70 const quint64 envelopeId, |
|
71 EmailClientApi::NmApiMessageEnvelope &envelope); |
|
72 |
|
73 /*! |
|
74 gets mailbox folder by id (see also NmApiEventNotifier) |
|
75 */ |
|
76 bool getFolder(const quint64 mailboxId, |
|
77 const quint64 folderId, |
|
78 EmailClientApi::NmApiFolder &mailboxFolder); |
|
79 |
|
80 /*! |
|
81 gets mailbox info by id (see also NmApiEventNotifier) |
|
82 */ |
|
83 bool getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo); |
|
84 |
|
85 /*! |
|
86 gets mail message by id (see also NmApiEventNotifier) |
|
87 */ |
|
88 bool getMessage(const quint64 mailboxId, |
|
89 const quint64 folderId, |
|
90 const quint64 messageId, |
|
91 EmailClientApi::NmApiMessage &message); |
|
92 |
|
93 |
|
94 |
|
95 /*! |
|
96 returns isrunning flag value |
|
97 */ |
|
98 bool isRunning() const; |
|
99 signals: |
|
100 /*! |
|
101 this signal is emitted when initialisation is completed |
|
102 boolean argument tells if initialisation succeeded |
|
103 */ |
|
104 void initialized(bool); |
|
105 |
|
106 private: |
|
107 NmApiEngine *mEngine; |
|
108 bool mIsRunning; |
|
109 }; |
|
110 } |
|
111 #endif /* NMAPIEMAILSERVICE_H */ |