|
1 /* |
|
2 * Copyright (c) 2004-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: Watcher for the PC-Suite data sync state |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NSSCHBACKUPOBSERVER_H |
|
20 #define NSSCHBACKUPOBSERVER_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include "nssvasccontacthandlerimpl.h" |
|
26 |
|
27 // Publish & Subscribe of the contact handler activity |
|
28 #include <e32property.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 @todo generalize the common parts of this class and CNssVasBackupObserver from VAS API |
|
41 At the moment the code is copy-pasted and duplicated |
|
42 */ |
|
43 |
|
44 |
|
45 |
|
46 /** |
|
47 * RProperty based data sync watcher implementation |
|
48 */ |
|
49 NONSHARABLE_CLASS( CNssChBackupObserver ) : public CActive |
|
50 { |
|
51 public: |
|
52 /** |
|
53 * Factory construction |
|
54 * @param aDb Database |
|
55 * @return Constructed and already started observer |
|
56 */ |
|
57 static CNssChBackupObserver* NewL( CNssContactHandlerImplementation& aHost ); |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 */ |
|
62 ~CNssChBackupObserver(); |
|
63 |
|
64 /** |
|
65 * @return ETrue if some backup/restore action is in progress |
|
66 * EFalse otherwise |
|
67 */ |
|
68 TBool InProgress(); |
|
69 |
|
70 private: |
|
71 /** |
|
72 * C++ constructor |
|
73 */ |
|
74 CNssChBackupObserver( CNssContactHandlerImplementation& aHost ); |
|
75 |
|
76 /** |
|
77 * Symbian second phase constructor |
|
78 */ |
|
79 void ConstructL(); |
|
80 |
|
81 /** |
|
82 * is called when data sync property changed |
|
83 */ |
|
84 void RunL(); |
|
85 |
|
86 /** |
|
87 * Is called when system wants immediate cancelling of the watching |
|
88 */ |
|
89 void DoCancel(); |
|
90 |
|
91 private: |
|
92 // Publish & Subscribe property about backup/restore |
|
93 RProperty iProperty; |
|
94 |
|
95 // Object to be notified about the backup/restore |
|
96 CNssContactHandlerImplementation& iHost; |
|
97 |
|
98 // ETrue if some backup/restore action is in progress |
|
99 TBool iInProgress; |
|
100 }; |
|
101 |
|
102 #endif // NSSCHBACKUPOBSERVER_H |
|
103 |
|
104 // End of File |