|
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 checking synch state. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CCASYNCCHECKER_H |
|
20 #define CCASYNCCHECKER_H |
|
21 |
|
22 #include "ccawaitnote.h" |
|
23 #include "MCAUiGlobalNotificationObserverPC.h" |
|
24 #include "TEnumsPC.h" |
|
25 #include "e32base.h" |
|
26 |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CCAAppUi; |
|
31 class MCAGlobalNotificationObserverPC; |
|
32 |
|
33 //CLASS DECLARATION |
|
34 /** |
|
35 * Helper class for checking synch state. |
|
36 * |
|
37 * @lib chatng.exe |
|
38 * @since S60 v3.1 |
|
39 */ |
|
40 class CCASyncChecker : public CBase, |
|
41 MCAWaitNoteObserver, |
|
42 MCAUiGlobalNotificationObserverPC |
|
43 { |
|
44 |
|
45 private: // construction |
|
46 |
|
47 /** |
|
48 * Create synch checker |
|
49 * @return ETrue if success. EFalse if fail |
|
50 */ |
|
51 static CCASyncChecker* NewLC(); |
|
52 |
|
53 /** |
|
54 * Destruction |
|
55 */ |
|
56 ~CCASyncChecker(); |
|
57 |
|
58 private: // Helper methods |
|
59 |
|
60 /** |
|
61 * Wait for sync to complete. |
|
62 * @return success. |
|
63 */ |
|
64 TBool WaitForSyncCompleteL(); |
|
65 |
|
66 /** |
|
67 * Check online state |
|
68 * @return ETrue if online |
|
69 */ |
|
70 TBool LoggedIn(); |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 /** |
|
75 * Check synch |
|
76 * If this is called when client is not logged in, it will return EFalse. |
|
77 * @return ETrue if success. EFalse if fail |
|
78 */ |
|
79 static TBool CheckSyncStateL(); |
|
80 |
|
81 public: //From MCAUiGlobalNotificationObserverPC |
|
82 |
|
83 /** |
|
84 * @see MCAUiGlobalNotificationObserverPC |
|
85 */ |
|
86 virtual void HandleDelete( const TDesC& aContactId , TEnumsPC::TItem type ); |
|
87 |
|
88 /** |
|
89 * @see MCAUiGlobalNotificationObserverPC |
|
90 */ |
|
91 virtual void HandleAddition( TEnumsPC::TItem type ); |
|
92 |
|
93 /** |
|
94 * @see MCAUiGlobalNotificationObserverPC |
|
95 */ |
|
96 virtual void HandleChange( TEnumsPC::TItem aType, TEnumsPC::TChange aChangeType ); |
|
97 |
|
98 |
|
99 /** |
|
100 * @see MCAUiGlobalNotificationObserverPC |
|
101 */ |
|
102 virtual void HandleInvitationEventL( TEnumsPC::TInviteType /*aInviteType*/, |
|
103 const TDesC& /*aUserId*/, const TDesC& /*aMessage*/ ) |
|
104 { |
|
105 //dummy implementation |
|
106 }; |
|
107 |
|
108 /** |
|
109 * @see MCAUiGlobalNotificationObserverPC |
|
110 */ |
|
111 virtual void HandleInvitationResponse( TBool /*aAcceptance*/, const TDesC& /*aUserId*/, |
|
112 const TDesC& /*aGroupName*/, const TDesC& /*aResponse*/ ) |
|
113 { |
|
114 //dummy implementation |
|
115 }; |
|
116 |
|
117 /** |
|
118 * @see MCAUiGlobalNotificationObserverPC |
|
119 */ |
|
120 virtual void HandleSettingsChangeL( TInt /*aChangedSettingEnum*/ ) |
|
121 { |
|
122 //dummy implementation |
|
123 }; |
|
124 |
|
125 /** |
|
126 * @see MCAUiGlobalNotificationObserverPC |
|
127 */ |
|
128 virtual void HandleChatEvent( const TEnumsPC::TChatEventType /*aEvent*/, |
|
129 const TDesC& /*aWvid*/, const TDesC& /*aContactId*/, |
|
130 const TDesC& /*aMessage*/, |
|
131 const TEnumsPC::TMessagerType /*aMsgrType*/, |
|
132 const TEnumsPC::TMessageType /*aMsgType*/ ) |
|
133 { |
|
134 //dummy implementation |
|
135 }; |
|
136 |
|
137 /** |
|
138 * To handle error condition in message related event |
|
139 * aError: error id |
|
140 * aInfo: error detail |
|
141 */ |
|
142 virtual void HandleMessageError( TInt /*aError*/, const TDesC& /*aInfo*/ ) |
|
143 { |
|
144 //dummy implementation |
|
145 }; |
|
146 |
|
147 private: // from MCAWaitNoteObserver |
|
148 |
|
149 /** |
|
150 * @see MCAWaitNoteObserver |
|
151 */ |
|
152 void NoteCanceled( TInt aButtonId ); |
|
153 |
|
154 private: |
|
155 /* |
|
156 * Default constructor |
|
157 */ |
|
158 CCASyncChecker(); |
|
159 |
|
160 private: // Data |
|
161 |
|
162 // Is wait note canceled by user. |
|
163 TBool iWaitNoteCanceled; |
|
164 |
|
165 // Owned. Wait note. |
|
166 CCAWaitNote* iWaitNote; |
|
167 |
|
168 //active scheduler wait |
|
169 CActiveSchedulerWait iWait; |
|
170 |
|
171 //Pointer to app ui. Doesnt own. |
|
172 CCAAppUi* iAppUi; |
|
173 |
|
174 //Pointer to the global notification observer |
|
175 MCAGlobalNotificationObserverPC* iGlobalNotificationPC; |
|
176 |
|
177 }; |
|
178 |
|
179 #endif // CCASYNCCHECKER_H |
|
180 |
|
181 |
|
182 |
|
183 |