|
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: Helper class for waiting fetch process. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCAFETCHWAITER_H |
|
20 #define CCAFETCHWAITER_H |
|
21 |
|
22 #include "ccawaitnote.h" |
|
23 #include "mcacontactfetchobserver.h" |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CCAUISessionManager; |
|
29 |
|
30 /** |
|
31 * Helper class for checking synch state. |
|
32 * |
|
33 * @lib chat.exe |
|
34 * @since S60 v3.1 |
|
35 */ |
|
36 class CCAFetchWaiter : public CBase, |
|
37 public MCAWaitNoteObserver, |
|
38 public MCAContactFetchObserver |
|
39 { |
|
40 |
|
41 private: // construction |
|
42 |
|
43 /** |
|
44 * Create synch checker |
|
45 * @return ETrue if success. EFalse if fail |
|
46 */ |
|
47 static CCAFetchWaiter* NewLC(); |
|
48 |
|
49 /** |
|
50 * Destruction |
|
51 */ |
|
52 ~CCAFetchWaiter(); |
|
53 |
|
54 private: // Helper methods |
|
55 |
|
56 /** |
|
57 * Wait for fetch to complete. |
|
58 * @return success. |
|
59 */ |
|
60 TBool WaitForFetchCompleteL(); |
|
61 |
|
62 /** |
|
63 * Check if Fetch is already done |
|
64 * @return ETrue if sync is done |
|
65 */ |
|
66 TBool IsFetchDone(); |
|
67 |
|
68 /** |
|
69 * Check online state |
|
70 * @return ETrue if online |
|
71 */ |
|
72 TBool LoggedIn(); |
|
73 |
|
74 /** |
|
75 * Access to ui session manager |
|
76 * @return Ref to ui session manager |
|
77 */ |
|
78 CCAUISessionManager& UISessionManager(); |
|
79 |
|
80 public: // New functions |
|
81 |
|
82 /** |
|
83 * Check fetch state. If the fetch process is not done this method will |
|
84 * wait until it is. |
|
85 * If this is called when client is not logged in, it will return EFalse. |
|
86 * @return ETrue if success. EFalse if not logged in or canceled |
|
87 */ |
|
88 static TBool CheckFetchStateL(); |
|
89 |
|
90 public: // From MCAContactFetchObserver |
|
91 |
|
92 /** |
|
93 * @see MCAContactFetchObserver |
|
94 */ |
|
95 void HandleFetchCompleteL( TInt aError ); |
|
96 |
|
97 private: // from MCAWaitNoteObserver |
|
98 |
|
99 /** |
|
100 * @see MCAWaitNoteObserver |
|
101 */ |
|
102 void NoteCanceled( TInt aButtonId ); |
|
103 |
|
104 private: // Data |
|
105 |
|
106 // Is wait note canceled by user. |
|
107 TBool iWaitNoteCanceled; |
|
108 |
|
109 // Owned. Wait note. |
|
110 CCAWaitNote* iWaitNote; |
|
111 |
|
112 // Scheduler wait |
|
113 CActiveSchedulerWait iWait; |
|
114 }; |
|
115 |
|
116 #endif // CCAFETCHWAITER_H |
|
117 |
|
118 |
|
119 |
|
120 |