author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:22:02 +0100 | |
branch | RCL_3 |
changeset 26 | 8b7f4e561641 |
parent 25 | 7333d7932ef7 |
permissions | -rw-r--r-- |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
18
f9033e605ee2
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
2 |
* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: This file contains the header file of the RIAUpdateClient class |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#ifndef IA_UPDATE_CLIENT_H |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#define IA_UPDATE_CLIENT_H |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
|
26 | 23 |
#include <AknServerApp.h> |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <e32std.h> |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include <e32cmn.h> |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
class CIAUpdateParameters; |
26 | 28 |
|
29 |
/** |
|
30 |
* RIAUpdateClient object provides methods to delegate update actions |
|
31 |
* to the server side. Updating will be targeted to the update items that |
|
32 |
* qualify the requirements of CIAUpdateParameters objects. In asynchronous |
|
33 |
* actions, observers will be informed about the completion of update action. |
|
34 |
* |
|
35 |
* Because this object is R-class, it does not provide constructor or destructor. |
|
36 |
* Usage: |
|
37 |
* - First, call Open-function. |
|
38 |
* - Second, use update functions to start update. |
|
39 |
* - Finally, user has to call Close-function to terminate object. |
|
40 |
* Otherwise, memory leaks may occur. |
|
41 |
* |
|
42 |
* @see CIAUpdateParameters |
|
43 |
* @see CIAUpdate |
|
44 |
* |
|
45 |
* @since S60 v3.2 |
|
46 |
*/ |
|
47 |
NONSHARABLE_CLASS( RIAUpdateClient ) : public RAknAppServiceBase |
|
48 |
{ |
|
49 |
||
50 |
public: |
|
51 |
||
52 |
/** |
|
53 |
* Constructor. |
|
54 |
*/ |
|
55 |
||
56 |
RIAUpdateClient(); |
|
57 |
||
58 |
/** |
|
59 |
* This function will open the update action. |
|
60 |
* |
|
61 |
* @note This has to be called before calling operation functions. |
|
62 |
* |
|
63 |
* @return System wide error code. |
|
64 |
* |
|
65 |
* @since S60 v3.2 |
|
66 |
*/ |
|
67 |
TInt Open(); |
|
68 |
||
69 |
/** |
|
70 |
* Close releases the resources allocated by this class object. |
|
71 |
* After Close is called, this R-class object may go out of scope. |
|
72 |
* |
|
73 |
* @note If Close is called before asynchronous operation has finished, |
|
74 |
* the operation will continue but callback functions of the observer |
|
75 |
* will not be called when operation progresses. |
|
76 |
* |
|
77 |
* @since S60 v3.2 |
|
78 |
*/ |
|
79 |
TInt OpenToBackroundAsync( TRequestStatus& aStatus ); |
|
80 |
||
81 |
TInt ConnectToApp(); |
|
82 |
||
83 |
void Close(); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
|
26 | 86 |
/** |
87 |
* @see CIAUpdate::CheckUpdates |
|
88 |
* |
|
89 |
* @note The client server connection has to be opened by calling |
|
90 |
* Open function before this function can be called. |
|
91 |
* |
|
92 |
* @param aAvailableUpdates Number of the updates that were found available. |
|
93 |
* @param aStatus The status will be updated when the operation |
|
94 |
* has been completed. |
|
95 |
* @return Informs if the initialization of server request failed. |
|
96 |
* System wide error code. |
|
97 |
* |
|
98 |
* @since S60 v3.2 |
|
99 |
*/ |
|
100 |
TInt CheckUpdates( const CIAUpdateParameters& aUpdateParameters, |
|
101 |
TInt& aAvailableUpdates, |
|
102 |
TRequestStatus& aStatus ); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
|
26 | 104 |
|
105 |
/** |
|
106 |
* @see CIAUpdate::ShowUpdates |
|
107 |
* |
|
108 |
* @note The client server connection has to be opened by calling |
|
109 |
* Open function before this function can be called. |
|
110 |
* |
|
111 |
* @param aNumberOfSuccessfullUpdates Number of the successfull updates |
|
112 |
* that were done during the update. |
|
113 |
* @param aNumberOfFailedUpdates Number of the failed updates |
|
114 |
* that were done during the update. |
|
115 |
* @param aNumberOfCancelledUpdates Number of the cancelled updates |
|
116 |
* during the update. |
|
117 |
* @param aStatus The status will be updated when the operation |
|
118 |
* has been completed. |
|
119 |
* @return Informs if the initialization of server request failed. |
|
120 |
* System wide error code. |
|
121 |
* |
|
122 |
* @since S60 v3.2 |
|
123 |
*/ |
|
124 |
TInt ShowUpdates( const CIAUpdateParameters& aUpdateParameters, |
|
125 |
TInt& aNumberOfSuccessfullUpdates, |
|
126 |
TInt& aNumberOfFailedUpdates, |
|
127 |
TInt& aNumberOfCancelledUpdates, |
|
128 |
TRequestStatus& aStatus ); |
|
129 |
||
25
7333d7932ef7
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
130 |
|
26 | 131 |
|
132 |
||
133 |
/** |
|
134 |
* @see CIAUpdate::Update |
|
135 |
* |
|
136 |
* @note The client server connection has to be opened by calling |
|
137 |
* Open function before this function can be called. |
|
138 |
* |
|
139 |
* @param aUpdateNow Value depending on a user's choice |
|
140 |
* @param aStatus The status will be updated when the operation |
|
141 |
* has been completed. |
|
142 |
* @return Informs if the initialization of server request failed. |
|
143 |
* System wide error code. |
|
144 |
* |
|
145 |
* @since S60 v3.2 |
|
146 |
*/ |
|
147 |
TInt UpdateQuery( TBool& aUpdateNow, TRequestStatus& aStatus ); |
|
148 |
||
149 |
||
150 |
void BroughtToForeground(); |
|
151 |
||
152 |
||
153 |
/** |
|
154 |
* Cancels the ongoing asynchronous operation. |
|
155 |
* The active object that has started the update operation |
|
156 |
* will be informed when the requested update operation |
|
157 |
* has been cancelled. |
|
158 |
* |
|
159 |
* @since S60 v3.2 |
|
160 |
*/ |
|
161 |
void CancelAsyncRequest(); |
|
25
7333d7932ef7
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
162 |
|
7333d7932ef7
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
163 |
|
26 | 164 |
public: // RAknAppServiceBase |
25
7333d7932ef7
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
165 |
|
26 | 166 |
/** |
167 |
* @see RAknAppServiceBase::ServiceUid |
|
168 |
* |
|
169 |
* @since S60 v3.2 |
|
170 |
*/ |
|
171 |
TUid ServiceUid() const; |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
private: |
26 | 175 |
|
176 |
// These functions send the operation requests to the server. |
|
177 |
||
178 |
TInt SendCheckUpdatesRequest( TInt aUpdateFunction, |
|
179 |
const CIAUpdateParameters& aUpdateParameters, |
|
180 |
TInt& aCount, |
|
181 |
TRequestStatus& aStatus ); |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
|
26 | 183 |
TInt SendUpdateRequest( TInt aUpdateFunction, |
184 |
const CIAUpdateParameters& aUpdateParameters, |
|
185 |
TInt& aNumberOfSuccessfullUpdates, |
|
186 |
TInt& aNumberOfFailedUdpdates, |
|
187 |
TInt& aNumberOfCancelledUpdates, |
|
188 |
TRequestStatus& aStatus ); |
|
189 |
||
190 |
void ConnectNewAppToBackgroundL( TUid aAppUid ); |
|
191 |
||
192 |
void StartNewAppToBackgroundL( TUid aAppUid, TRequestStatus& aStatus ); |
|
193 |
||
194 |
void ServerName(TName& aServerName, TUid aAppServerUid, TUint aServerDifferentiator); |
|
195 |
||
196 |
TUint GenerateServerDifferentiatorAndName(TName& aServerName, TUid aAppServerUid); |
|
197 |
||
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
private: //data |
26 | 200 |
|
201 |
HBufC8* iData; |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
|
26 | 203 |
TBool iConnected; |
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
|
26 | 205 |
TInt iOwnWgId; |
206 |
||
207 |
TUint iDifferentiator; |
|
18
f9033e605ee2
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
208 |
|
26 | 209 |
TPtr8 iPtr1; |
210 |
TPtr8 iPtr2; |
|
211 |
TPtr8 iPtr3; |
|
0
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
}; |
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
|
ba25891c3a9e
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
#endif // IA_UPDATE_CLIENT_H |