|
1 /* |
|
2 * Copyright (c) 2007-2009 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: Harvester client active object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CHARVESTERCLIENTAO_H__ |
|
20 #define __CHARVESTERCLIENTAO_H__ |
|
21 |
|
22 #include <e32msgqueue.h> |
|
23 #include <e32base.h> |
|
24 #include <badesca.h> |
|
25 |
|
26 #include "harvesterclient.h" |
|
27 #include "clientharvestitem.h" |
|
28 |
|
29 class RHarvesterClient; |
|
30 class MHarvestObserver; |
|
31 |
|
32 NONSHARABLE_CLASS( CHarvesterClientAO ) : public CActive |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Construction. |
|
37 */ |
|
38 static CHarvesterClientAO* NewL( RHarvesterClient &aHarvesterClient ); |
|
39 |
|
40 /** |
|
41 * Destruction. |
|
42 */ |
|
43 virtual ~CHarvesterClientAO(); |
|
44 |
|
45 /** |
|
46 * Method for adding an observer. |
|
47 * @param aObserver Pointer to observer object. |
|
48 */ |
|
49 void SetObserver( MHarvestObserver* aObserver ); |
|
50 |
|
51 /** |
|
52 * Method for removing an observer. |
|
53 * @param aObserver Pointer to observer object. |
|
54 */ |
|
55 void RemoveObserver( MHarvestObserver* aObserver ); |
|
56 |
|
57 void NotificateObserver( TInt aErr ); |
|
58 |
|
59 /** |
|
60 * Set AO to active state. RunL is launched from harvesting complete |
|
61 * request which are subscribed from server. |
|
62 */ |
|
63 void Active(); |
|
64 |
|
65 protected: |
|
66 |
|
67 /** |
|
68 * RunL. |
|
69 * From CActive. |
|
70 */ |
|
71 virtual void RunL(); |
|
72 |
|
73 /** |
|
74 * DoCancel. |
|
75 * From CActive. |
|
76 */ |
|
77 virtual void DoCancel(); |
|
78 |
|
79 /** |
|
80 * RunError for handling leaves occuring in RunL. |
|
81 * From CActive. |
|
82 */ |
|
83 virtual TInt RunError( TInt aError ); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * Private constructor |
|
89 * |
|
90 * @param aHarvesterClient Reference to session class |
|
91 */ |
|
92 CHarvesterClientAO( RHarvesterClient &aHarvesterClient ); |
|
93 |
|
94 /** |
|
95 * 2nd phase construction |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Observer of the class |
|
103 */ |
|
104 MHarvestObserver* iObserver; |
|
105 |
|
106 /** |
|
107 * Reference to Harvester client session |
|
108 */ |
|
109 RHarvesterClient& iHarvesterClient; |
|
110 |
|
111 /** |
|
112 * Harvester server assigned file name |
|
113 */ |
|
114 TFileName iURI; |
|
115 }; |
|
116 |
|
117 #endif // __CHARVESTERCLIENTAO_H__ |