|
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(__IPSPLGCONNECTANDREFRESHFOLDERLIST_H__) |
|
21 #define __IPSPLGCONNECTANDREFRESHFOLDERLIST_H__ |
|
22 |
|
23 #include <AknWaitNoteWrapper.h> |
|
24 // <cmail> |
|
25 #include <imapset.h> |
|
26 // </cmail> |
|
27 |
|
28 // Specific includes |
|
29 #include "ipsplgonlineoperation.h" |
|
30 |
|
31 |
|
32 /** |
|
33 * Superoperation which wraps a UI around going online, updating |
|
34 * an IMAP service's folder list and disconnecting again. |
|
35 */ |
|
36 class CIpsPlgConnectAndRefreshFolderList : public CIpsPlgOnlineOperation, |
|
37 public MAknBackgroundProcess |
|
38 { |
|
39 |
|
40 public: // from MAknBackgroundProcess |
|
41 |
|
42 /** |
|
43 * Completes one cycle of the process. |
|
44 */ |
|
45 virtual void StepL(); |
|
46 |
|
47 /** |
|
48 * Return true when the process is done. |
|
49 */ |
|
50 virtual TBool IsProcessDone() const; |
|
51 |
|
52 virtual void DialogDismissedL( TInt aButtonId ); |
|
53 |
|
54 public: |
|
55 |
|
56 /** |
|
57 * NewL() |
|
58 * @param CMsvSession& |
|
59 * @param TInt |
|
60 * @param TRequestStatus& |
|
61 * @param TMsvId |
|
62 * @return CImapConnectAndRefreshFolderList* |
|
63 */ |
|
64 IMPORT_C static CIpsPlgConnectAndRefreshFolderList* NewL( |
|
65 CMsvSession& aSession, TInt aPriority, TRequestStatus& aObserverRequestStatus, |
|
66 TMsvId aService, TFSMailMsgId& aMailboxId, CMsvEntrySelection& aMsvEntry, |
|
67 MFSMailRequestObserver& aFSObserver, CIpsPlgTimerOperation& aTimer ); |
|
68 |
|
69 /** |
|
70 * Destructor |
|
71 * ~CIpsPlgConnectAndRefreshFolderList() |
|
72 */ |
|
73 virtual ~CIpsPlgConnectAndRefreshFolderList(); |
|
74 |
|
75 /** |
|
76 * |
|
77 */ |
|
78 const TDesC8& ProgressL(); |
|
79 |
|
80 /** |
|
81 * |
|
82 */ |
|
83 const TDesC8& GetErrorProgressL(TInt aError); |
|
84 |
|
85 /** |
|
86 * |
|
87 */ |
|
88 TFSProgress GetFSProgressL() const; |
|
89 |
|
90 protected: |
|
91 |
|
92 |
|
93 /** |
|
94 * From |
|
95 * DoRunL() |
|
96 */ |
|
97 virtual void DoRunL(); |
|
98 |
|
99 virtual void DoCancel(); |
|
100 |
|
101 private: |
|
102 |
|
103 enum TIpsSetFolderRefreshStates |
|
104 { |
|
105 EIdle, |
|
106 EStartConnect, |
|
107 EConnecting, |
|
108 ERefreshing, |
|
109 EDisconnecting, |
|
110 ECompleted |
|
111 }; |
|
112 |
|
113 /** |
|
114 * C++ constructor |
|
115 * CIpsPlgConnectAndRefreshFolderList() |
|
116 */ |
|
117 CIpsPlgConnectAndRefreshFolderList( CMsvSession& aSession, TInt aPriority, |
|
118 TRequestStatus& aObserverRequestStatus, TMsvId aService, TFSMailMsgId& aMailboxId, |
|
119 MFSMailRequestObserver& aFSObserver, CIpsPlgTimerOperation& aTimer ); |
|
120 |
|
121 /** |
|
122 * ConstructL() |
|
123 */ |
|
124 void ConstructL( CMsvEntrySelection& aMsvEntry ); |
|
125 |
|
126 //data |
|
127 private: |
|
128 |
|
129 TInt iState; |
|
130 TFSMailMsgId iMailboxId; |
|
131 CMsvSession& iSession; |
|
132 TMsvId iService; |
|
133 CMsvOperation* iOperation; |
|
134 CIpsPlgTimerOperation* iTimer; |
|
135 CMsvEntrySelection* iMsvEntry; |
|
136 TPckgBuf<TImap4CompoundProgress> iProgressBuf; |
|
137 TRequestStatus iObserverRequestStatus; |
|
138 CAknWaitNoteWrapper* iAsyncWaitNote; |
|
139 }; |
|
140 |
|
141 #endif |