|
1 /* |
|
2 * Copyright (c) 2010 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 NMATTACHMENTMANAGER_H_ |
|
19 #define NMATTACHMENTMANAGER_H_ |
|
20 |
|
21 #include <QObject> |
|
22 #include <QPointer> |
|
23 |
|
24 #include <nmcommon.h> |
|
25 |
|
26 class NmUiEngine; |
|
27 class NmOperation; |
|
28 class NmAttachmentFetchObserver; |
|
29 class NmMessage; |
|
30 |
|
31 class NmAttachmentManager : public QObject |
|
32 { |
|
33 Q_OBJECT |
|
34 public: |
|
35 NmAttachmentManager(NmUiEngine &uiEngine); |
|
36 virtual ~NmAttachmentManager(); |
|
37 void fetchAttachment( |
|
38 const NmId &mailboxId, |
|
39 const NmId &folderId, |
|
40 const NmId &messageId, |
|
41 const NmId &messagePartId); |
|
42 bool fetchAttachments( |
|
43 const NmId &mailboxId, |
|
44 const NmId &folderId, |
|
45 const NmId &messageId, |
|
46 QList<NmId> &messagePartIds); |
|
47 void fetchAllMessageParts( |
|
48 const NmId &mailboxId, |
|
49 const NmId &folderId, |
|
50 const NmId &messageId); |
|
51 bool isFetching() const; |
|
52 NmId partIdUnderFetch() const; |
|
53 int progressValue() const; |
|
54 void setObserver(NmAttachmentFetchObserver *observer); |
|
55 void clearObserver(); |
|
56 void cancelFetch(); |
|
57 |
|
58 private slots: |
|
59 void changeProgress(int value); |
|
60 void completeAttachmentFetch(int result); |
|
61 void completeMessageFetch(int result); |
|
62 |
|
63 private: |
|
64 NmUiEngine &mUiEngine; |
|
65 QPointer<NmOperation> mFetchOperation; // Not owned |
|
66 QPointer<NmOperation> mMsgFetchOperation; // Not owned |
|
67 NmAttachmentFetchObserver *mFetchObserver; // Not owned |
|
68 NmMessage *mFetchMsg; |
|
69 NmId mAttaId; |
|
70 int mProgressValue; |
|
71 bool mIsFetching; |
|
72 }; |
|
73 |
|
74 |
|
75 #endif /* NMATTACHMENTMANAGER_H_ */ |