|
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 "mcastoredcontactsobserver.h" |
|
23 #include "mcacontactlists.h" |
|
24 |
|
25 #include "e32base.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 |
|
29 /** |
|
30 * Helper class for checking synch state. |
|
31 * |
|
32 * @lib caengine.dll |
|
33 * @since S60 v3.1 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CCASyncChecker ) : public CBase, |
|
36 public MCAStoredContactsObserver |
|
37 { |
|
38 |
|
39 private: // construction |
|
40 |
|
41 /** |
|
42 * Create synch checker |
|
43 * @return ETrue if success. EFalse if fail |
|
44 */ |
|
45 static CCASyncChecker* NewLC(); |
|
46 |
|
47 /** |
|
48 * Destruction |
|
49 */ |
|
50 ~CCASyncChecker(); |
|
51 |
|
52 private: // Helper methods |
|
53 |
|
54 /** |
|
55 * Wait for sync to complete. |
|
56 * @return success. |
|
57 */ |
|
58 TBool WaitForSyncCompleteL(); |
|
59 |
|
60 /** |
|
61 * Check if sync is done |
|
62 * @return ETrue if sync is done |
|
63 */ |
|
64 TBool IsSyncDoneL(); |
|
65 |
|
66 public: // New functions |
|
67 |
|
68 /** |
|
69 * Check synch |
|
70 * If this is called when client is not logged in, it will return EFalse. |
|
71 * @return ETrue if success. EFalse if fail |
|
72 */ |
|
73 static TBool CheckSyncStateL(); |
|
74 |
|
75 |
|
76 private: // From MCAStoredContactsObserver |
|
77 |
|
78 /** |
|
79 * @see MCAStoredContactsObserver |
|
80 */ |
|
81 void HandleContactDelete( const TDesC& aContactId ); |
|
82 |
|
83 /** |
|
84 * @see MCAStoredContactsObserver |
|
85 */ |
|
86 void HandleAddition( MCAContactList& aList, MCAStoredContact& aContact ); |
|
87 |
|
88 /** |
|
89 * @see MCAStoredContactsObserver |
|
90 */ |
|
91 void HandleChange( MCAContactList* aList, MCAStoredContact* aContact, |
|
92 TStorageManagerGlobals::TCAObserverEventType aEventType, |
|
93 TBool aUserIdChanged ); |
|
94 |
|
95 |
|
96 private: // Data |
|
97 |
|
98 CActiveSchedulerWait iWait; |
|
99 |
|
100 }; |
|
101 |
|
102 #endif // CCASYNCCHECKER_H |
|
103 |
|
104 |
|
105 |
|
106 |