|
1 /* |
|
2 * Copyright (c) 2008 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: This file defines class CIpsSetUtilsDisconnectLogic. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IPSSETUTILSDISCONNECTLOGIC_H_ |
|
20 #define IPSSETUTILSDISCONNECTLOGIC_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <AknWaitNoteWrapper.h> |
|
24 #include <msvapi.h> |
|
25 |
|
26 class CBaseMtm; |
|
27 class CClientMtmRegistry; |
|
28 |
|
29 /** |
|
30 * Contains logic to disconnect mailbox when editing settings |
|
31 * |
|
32 * @lib IpsSosSettings.lib |
|
33 * @since FS v2.0 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CIpsSetUtilsDisconnectLogic ) : public CActive, |
|
36 public MAknBackgroundProcess |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Destructor |
|
42 */ |
|
43 ~CIpsSetUtilsDisconnectLogic(); |
|
44 |
|
45 /** |
|
46 * 2-phase contructor |
|
47 * |
|
48 * @return Approver object with client ownership. |
|
49 */ |
|
50 static CIpsSetUtilsDisconnectLogic* NewL( |
|
51 CMsvSession& aSession, |
|
52 TMsvId aMailboxId ); |
|
53 |
|
54 public: // from MAknBackgroundProcess |
|
55 |
|
56 /** |
|
57 * |
|
58 */ |
|
59 virtual void StepL(); |
|
60 |
|
61 /** |
|
62 * |
|
63 */ |
|
64 virtual TBool IsProcessDone() const; |
|
65 |
|
66 /** |
|
67 * |
|
68 */ |
|
69 virtual void ProcessFinished(); |
|
70 |
|
71 /** |
|
72 * |
|
73 */ |
|
74 virtual void DialogDismissedL( TInt aButtonId ); |
|
75 |
|
76 /** |
|
77 * |
|
78 */ |
|
79 virtual TInt CycleError( TInt aError ); |
|
80 |
|
81 public: // from CActive |
|
82 |
|
83 /** |
|
84 * |
|
85 */ |
|
86 virtual void DoCancel(); |
|
87 |
|
88 /** |
|
89 * |
|
90 */ |
|
91 virtual void RunL(); |
|
92 |
|
93 /** |
|
94 * |
|
95 */ |
|
96 virtual TInt RunError( TInt aError ); |
|
97 |
|
98 public: |
|
99 |
|
100 /* |
|
101 * Checks mailbox connection state and disconnects |
|
102 * @return KErrNone if mailbox is disconnected, |
|
103 * KErrCancel if user not want to disconnect |
|
104 */ |
|
105 TInt RunDisconnectLogicL( TBool aDoShowQuery ); |
|
106 |
|
107 private: |
|
108 |
|
109 /** |
|
110 * Constructor. |
|
111 */ |
|
112 CIpsSetUtilsDisconnectLogic( |
|
113 CMsvSession& aSession, |
|
114 TMsvId aMailboxId ); |
|
115 |
|
116 /** |
|
117 * 2nd phase of construction. |
|
118 */ |
|
119 void ConstructL(); |
|
120 |
|
121 /** |
|
122 * |
|
123 */ |
|
124 TInt CheckConnectionAndQueryDisconnectL( |
|
125 TMsvEntry& aEntry, |
|
126 TBool aDoShowQuery ); |
|
127 |
|
128 /** |
|
129 * |
|
130 */ |
|
131 void CreateDisconnectOperationL(const TMsvEntry& aEntry ); |
|
132 |
|
133 private: |
|
134 |
|
135 CMsvSession& iSession; |
|
136 TInt iMailboxId; |
|
137 TBool iIsDisconnectComplete; |
|
138 |
|
139 CMsvOperation* iOperation; |
|
140 CBaseMtm* iBaseMtm; |
|
141 CClientMtmRegistry* iMtmReg; |
|
142 CAknWaitNoteWrapper* iAsyncWaitNote; |
|
143 |
|
144 }; |
|
145 |
|
146 |
|
147 |
|
148 #endif /*IPSSETUTILSDISCONNECTLOGIC_H_*/ |