|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * Declaration file for client API's event/progress notifiers |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __NSMLCLIENTCONTACTSUITEAPIACTIVECALLBACK_H_ |
|
21 #define __NSMLCLIENTCONTACTSUITEAPIACTIVECALLBACK_H_ |
|
22 |
|
23 #include <SyncMLClient.h> |
|
24 #include <SyncMLObservers.h> |
|
25 |
|
26 class CSmlActiveEventCallback; |
|
27 class CSmlActiveProgressCallback; |
|
28 class CSmlActiveContactSuiteProgressCallback; |
|
29 |
|
30 // |
|
31 // container class from event and progress callbacks |
|
32 // |
|
33 class CSmlContactSuiteActiveCallback : public CBase |
|
34 { |
|
35 public: |
|
36 CSmlContactSuiteActiveCallback( RSyncMLSession& aSession ); |
|
37 ~CSmlContactSuiteActiveCallback(); |
|
38 |
|
39 void SetProgressObserverL( MSyncMLProgressObserver& aObserver ); |
|
40 |
|
41 void CancelProgress(); |
|
42 |
|
43 void SendReceive( TInt aCmd, const TIpcArgs& aArgs, TRequestStatus& aStatus ) const; |
|
44 void SendReceive( TInt aCmd ) const; |
|
45 |
|
46 private: |
|
47 RSyncMLSession& iContactSuiteSession; |
|
48 CSmlActiveCallback iActiveCallback; |
|
49 CSmlActiveContactSuiteProgressCallback* iProgressCallback; |
|
50 }; |
|
51 |
|
52 // |
|
53 // progress callback |
|
54 // |
|
55 class CSmlActiveContactSuiteProgressCallback : public CActive |
|
56 { |
|
57 public: |
|
58 static CSmlActiveContactSuiteProgressCallback* NewL( const CSmlContactSuiteActiveCallback* aCallback ); |
|
59 virtual ~CSmlActiveContactSuiteProgressCallback(); |
|
60 |
|
61 void SetObserver( MSyncMLProgressObserver& aObserver ); |
|
62 void CancelProgress(); |
|
63 |
|
64 // from CActive |
|
65 virtual void DoCancel(); |
|
66 virtual void RunL(); |
|
67 |
|
68 private: |
|
69 void Request(); |
|
70 void ConstructL(); |
|
71 CSmlActiveContactSuiteProgressCallback( const CSmlContactSuiteActiveCallback* aCallback ); |
|
72 |
|
73 void NotifyErrorL( RReadStream& aStream ) const; |
|
74 void NotifyProgressL( RReadStream& aStream ) const; |
|
75 void NotifyModificationsL( RReadStream& aStream ); |
|
76 |
|
77 private: |
|
78 TBool iRequesting; |
|
79 TPtr8 iBufPtr; |
|
80 HBufC8* iBuf; |
|
81 |
|
82 MSyncMLProgressObserver::TSyncMLDataSyncModifications iClientMods; |
|
83 MSyncMLProgressObserver::TSyncMLDataSyncModifications iServerMods; |
|
84 |
|
85 MSyncMLProgressObserver* iObserver; // not owned |
|
86 const CSmlContactSuiteActiveCallback* iCallback; // not owned |
|
87 }; |
|
88 |
|
89 #endif /*__NSMLCLIENTCONTACTSUITEAPIACTIVECALLBACK_H_*/ |