|
1 /* |
|
2 * Copyright (c) 2008 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 * |
|
16 */ |
|
17 |
|
18 #ifndef HSCCAPICLIENT_H |
|
19 #define HSCCAPICLIENT_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 #include <hscontentcontroller.h> |
|
24 |
|
25 // Forward declarations |
|
26 #include "ccclientsession.h" |
|
27 class MHsContentControl; |
|
28 |
|
29 /** |
|
30 * Home screen content control server content control api client |
|
31 * |
|
32 * |
|
33 * @code |
|
34 * |
|
35 * @endcode |
|
36 * |
|
37 * @lib hsccapiclient.lib |
|
38 * @since S60 v5.0 |
|
39 */ |
|
40 class CHsCcApiClient : public CActive, public MHsContentController |
|
41 { |
|
42 public: // Constructor and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aControlIf Content control observer interface |
|
47 */ |
|
48 IMPORT_C static CHsCcApiClient* NewL( |
|
49 MHsContentControl* aControlIf ); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 ~CHsCcApiClient(); |
|
55 |
|
56 private: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Constructor |
|
60 * @param aControlIf Content control observer interface |
|
61 */ |
|
62 CHsCcApiClient( |
|
63 MHsContentControl* aControlIf ); |
|
64 |
|
65 /** |
|
66 * Second phase constructor |
|
67 */ |
|
68 void ConstructL(); |
|
69 |
|
70 private: // From CActive |
|
71 /** |
|
72 * |
|
73 */ |
|
74 void RunL(); |
|
75 |
|
76 /** |
|
77 * |
|
78 */ |
|
79 void DoCancel(); |
|
80 |
|
81 public: // From MHsContentController |
|
82 /** |
|
83 * See from API documentation |
|
84 */ |
|
85 TInt WidgetListL( CHsContentInfoArray& aArray ); |
|
86 |
|
87 /** |
|
88 * See from API documentation |
|
89 */ |
|
90 TInt WidgetListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); |
|
91 |
|
92 /** |
|
93 * See from API documentation |
|
94 */ |
|
95 TInt ViewListL( CHsContentInfoArray& aArray ); |
|
96 |
|
97 /** |
|
98 * See from API documentation |
|
99 */ |
|
100 TInt ViewListL( CHsContentInfo& aInfo, CHsContentInfoArray& aArray ); |
|
101 |
|
102 /** |
|
103 * See from API documentation |
|
104 */ |
|
105 TInt AppListL( CHsContentInfoArray& aArray ); |
|
106 |
|
107 /** |
|
108 * See from API documentation |
|
109 */ |
|
110 TInt AddWidgetL( CHsContentInfo& aInfo ); |
|
111 |
|
112 /** |
|
113 * See from API documentation |
|
114 */ |
|
115 TInt RemoveWidgetL( CHsContentInfo& aInfo ); |
|
116 |
|
117 /** |
|
118 * See from API documentation |
|
119 */ |
|
120 TInt AddViewL( CHsContentInfo& aInfo ); |
|
121 |
|
122 /** |
|
123 * See from API documentation |
|
124 */ |
|
125 TInt RemoveViewL( CHsContentInfo& aInfo ); |
|
126 |
|
127 /** |
|
128 * See from API documentation |
|
129 */ |
|
130 TInt ActivateViewL( CHsContentInfo& aInfo ); |
|
131 |
|
132 /** |
|
133 * See from API documentation |
|
134 */ |
|
135 TInt ActivateAppL( CHsContentInfo& aInfo ); |
|
136 |
|
137 /** |
|
138 * See from API documentation |
|
139 */ |
|
140 TInt ActiveViewL( CHsContentInfo& aInfo ); |
|
141 |
|
142 /** |
|
143 * See from API documentation |
|
144 */ |
|
145 TInt ActiveAppL( CHsContentInfo& aInfo ); |
|
146 |
|
147 private: // Functions |
|
148 /** |
|
149 * Requests receiving of content change notification |
|
150 */ |
|
151 void WaitForApiNtfL(); |
|
152 |
|
153 /** |
|
154 * Internalize received response message |
|
155 */ |
|
156 TInt InternalizeRespL( TPtr8& aResp, TUint32& aTrId, TUint32& aDataSize ); |
|
157 |
|
158 /** |
|
159 * Internalize received CHsContentInfo type response message data |
|
160 */ |
|
161 TInt InternalizeContentInfoL( CHsContentInfo& aInfo, TUint32 aTrId, TUint32 aDataSize ); |
|
162 |
|
163 /** |
|
164 * Internalize received CHsContentInfoArray type response message data |
|
165 */ |
|
166 TInt InternalizeContentInfoArrayL( CHsContentInfoArray& aInfo, TUint32 aTrId, TUint32 aDataSize ); |
|
167 |
|
168 private: // Data |
|
169 /** |
|
170 * Session to Homescreen content control server |
|
171 */ |
|
172 RCcClientSession iSession; |
|
173 |
|
174 /** |
|
175 * Home screen content control API observer |
|
176 */ |
|
177 MHsContentControl* iObserver; |
|
178 |
|
179 /** |
|
180 * Registered address |
|
181 */ |
|
182 TUint32 iAddress; |
|
183 |
|
184 /** |
|
185 * Sender of Api request |
|
186 */ |
|
187 TPckgBuf<TUint32> iPckgSender; |
|
188 |
|
189 /** |
|
190 * receiver of Api request |
|
191 */ |
|
192 TPckgBuf<TUint32> iPckgReceiver; |
|
193 |
|
194 /** |
|
195 * Received API request header buffer |
|
196 */ |
|
197 HBufC8* iApiHeader; |
|
198 |
|
199 /** |
|
200 * Pointer to header buffer |
|
201 */ |
|
202 TPtr8 iApiHeaderPtr; |
|
203 |
|
204 /** |
|
205 * Received API request data buffer |
|
206 */ |
|
207 HBufC8* iApiData; |
|
208 |
|
209 /** |
|
210 * Pointer to data buffer |
|
211 */ |
|
212 TPtr8 iApiDataPtr; |
|
213 |
|
214 }; |
|
215 |
|
216 |
|
217 #endif // HSCCAPICLIENT_H |
|
218 |
|
219 // End of file |