|
1 /* |
|
2 * Copyright (c) 2006 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 * folder refresh operation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #if !defined(__REFRESHIMAPFOLDERLIST_H__) |
|
21 #define __REFRESHIMAPFOLDERLIST_H__ |
|
22 |
|
23 // Messaging includes |
|
24 #include <imapset.h> |
|
25 #include <ImumInternalApi.h> // CImumInternalApi |
|
26 |
|
27 // Specific includes |
|
28 #include "ImumOnlineOperation.h" |
|
29 |
|
30 // Forward declarations |
|
31 class MMsvProgressReporter; |
|
32 |
|
33 /** |
|
34 * Superoperation which wraps a UI around going online, updating |
|
35 * an IMAP service's folder list and disconnecting again. |
|
36 */ |
|
37 class CImapConnectAndRefreshFolderList : public CImumOnlineOperation |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 * NewL() |
|
43 * @param CMsvSession& |
|
44 * @param TInt |
|
45 * @param TRequestStatus& |
|
46 * @param TMsvId |
|
47 * @param MMsvProgressReporter& |
|
48 * @return CImapConnectAndRefreshFolderList* |
|
49 */ |
|
50 static CImapConnectAndRefreshFolderList* NewL( |
|
51 CImumInternalApi& aMailboxApi, TInt aPriority, TRequestStatus& aObserverRequestStatus, |
|
52 TMsvId aService, MMsvProgressReporter& aProgressReporter); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 * ~CImapConnectAndRefreshFolderList() |
|
57 */ |
|
58 virtual ~CImapConnectAndRefreshFolderList(); |
|
59 |
|
60 /** |
|
61 * From CImumOnlineOperation |
|
62 * GetErrorProgressL() |
|
63 * @param TInt error code |
|
64 * @return TDesC8&, progress |
|
65 */ |
|
66 virtual const TDesC8& GetErrorProgressL(TInt aError); // For reporting DoRunL leaves. |
|
67 |
|
68 protected: |
|
69 |
|
70 |
|
71 /** |
|
72 * From CImumOnlineOperation |
|
73 * DoRunL() |
|
74 */ |
|
75 virtual void DoRunL(); |
|
76 |
|
77 private: |
|
78 |
|
79 enum TImumFolderRefreshStates |
|
80 { |
|
81 EConnecting, |
|
82 ERefreshing, |
|
83 EDisconnecting, |
|
84 ECompleted |
|
85 }; |
|
86 |
|
87 /** |
|
88 * C++ constructor |
|
89 * CImapConnectAndRefreshFolderList() |
|
90 * @param CMsvSession& |
|
91 * @param TInt |
|
92 * @param TRequestStatus& |
|
93 * @param TMsvId |
|
94 * @param MMsvProgressReporter& |
|
95 */ |
|
96 CImapConnectAndRefreshFolderList(CImumInternalApi& aMailboxApi, TInt aPriority, |
|
97 TRequestStatus& aObserverRequestStatus, TMsvId aService, |
|
98 MMsvProgressReporter& aProgressReporter); |
|
99 |
|
100 /** |
|
101 * ConstructL() |
|
102 * @param TUid |
|
103 */ |
|
104 void ConstructL(TUid aMtm); |
|
105 |
|
106 //data |
|
107 private: |
|
108 TPckgBuf<TImap4CompoundProgress> iProgressBuf; |
|
109 TInt iState; |
|
110 }; |
|
111 |
|
112 #endif |