|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WRTHARVESTERPUBLISHEROBSERVER_H |
|
20 #define WRTHARVESTERPUBLISHEROBSERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <LiwCommon.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CWrtHarvester; |
|
27 class CLiwServiceHandler; |
|
28 // CONSTANTS |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * CWrtHarvesterPublisherObserver |
|
33 * |
|
34 * @lib wrtharvester.dll |
|
35 * @since S60 S60 v5.0 |
|
36 */ |
|
37 |
|
38 class CWrtHarvesterPublisherObserver : public CBase, public MLiwNotifyCallback |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 /** |
|
42 * Two-phased constructor. |
|
43 */ |
|
44 static CWrtHarvesterPublisherObserver* NewLC( const TDesC& aName, CWrtHarvester* aHarvester ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CWrtHarvesterPublisherObserver(); |
|
50 |
|
51 public: //from MLiwNotifyCallback |
|
52 |
|
53 /** |
|
54 * Handles notifications caused by an asynchronous Execute*CmdL call |
|
55 * or an event. |
|
56 * |
|
57 * @param aCmdId The service command associated to the event. |
|
58 * @param aEventId Occured event, see LiwCommon.hrh. |
|
59 * @param aEventParamList Event parameters, if any, as defined per |
|
60 * each event. |
|
61 * @param aInParamList Input parameters, if any, given in the |
|
62 * related HandleCommmandL. |
|
63 * @return Error code for the callback. |
|
64 */ |
|
65 virtual TInt HandleNotifyL( |
|
66 TInt aCmdId, |
|
67 TInt aEventId, |
|
68 CLiwGenericParamList& aEventParamList, |
|
69 const CLiwGenericParamList& aInParamList); |
|
70 |
|
71 public: |
|
72 |
|
73 /** |
|
74 * Registers to CPS for add, delete , update and execute notifications |
|
75 * @aFilter - filter for input parameter list |
|
76 * @return void. |
|
77 */ |
|
78 void RegisterL( CLiwDefaultMap* aFilter ); |
|
79 |
|
80 /** |
|
81 * |
|
82 */ |
|
83 const TDesC& Name(); |
|
84 |
|
85 |
|
86 private: |
|
87 /** |
|
88 * Perform the second phase construction |
|
89 */ |
|
90 void ConstructL( const TDesC& aName ); |
|
91 |
|
92 /** |
|
93 * Default constructor. |
|
94 */ |
|
95 CWrtHarvesterPublisherObserver( CWrtHarvester* aHarvester ); |
|
96 |
|
97 // Prhohibited |
|
98 CWrtHarvesterPublisherObserver(); |
|
99 |
|
100 /** |
|
101 * Cancel all the registered notifications. |
|
102 * @return void. |
|
103 */ |
|
104 void ReleaseL(); |
|
105 |
|
106 /** |
|
107 * Initialise Liw connection to Content publishing service. |
|
108 */ |
|
109 void InitLiwL(); |
|
110 |
|
111 /** |
|
112 * Closes Liw connection to Content publishing service. |
|
113 */ |
|
114 void ReleaseLiw(); |
|
115 |
|
116 private: // data |
|
117 |
|
118 // Reference of |
|
119 // Owned |
|
120 MLiwInterface* iInterface; |
|
121 |
|
122 // Reference of |
|
123 // Owned |
|
124 CLiwServiceHandler* iLiwHandler; |
|
125 |
|
126 // Reference of the sapi data |
|
127 // Not owned |
|
128 CWrtHarvester* iHarvester; |
|
129 |
|
130 // Name of the observed publisher |
|
131 // Owned |
|
132 HBufC* iName; |
|
133 |
|
134 // Call back error code |
|
135 TInt iError; |
|
136 }; |
|
137 |
|
138 #endif // WRTHARVESTERPUBLISHEROBSERVER_H |