author | andrews@symbian.org |
Thu, 25 Jun 2009 01:40:38 +0100 | |
changeset 18 | 79513c90e348 |
parent 0 | 14df0fbfcc4e |
permissions | -rw-r--r-- |
0
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: CSysInfoObserver class for handling async requests |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
17 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
18 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
19 |
#ifndef __SYSINFOOBSERVER_H__ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
20 |
#define __SYSINFOOBSERVER_H__ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
21 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
22 |
#include <e32base.h> |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
23 |
#include "sysinfoservice.h" |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
24 |
#include "sysrequest.h" |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
25 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
26 |
//FORWARD DECLARATION |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
27 |
class CLiwGenericParamList; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
28 |
class CSysInfoInterface; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
29 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
30 |
/** |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
31 |
* CSysInfoObserver |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
32 |
* This class acts as an observer for all asynchronous requests. After the request |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
33 |
* is completed, it checks for error and packs it in output param list. If there |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
34 |
* is no error, then the iterator is also packed into the output param list. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
35 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
36 |
// CLASS DECLARATION |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
37 |
NONSHARABLE_CLASS(CSysInfoObserver): public CBase, public ISystemObserver |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
38 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
39 |
public: // New methods |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
40 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
41 |
/** |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
42 |
* NewL. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
43 |
* Two-phased constructor. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
44 |
* Create a CSysInfoObserver object. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
45 |
* @param aLmIface The CSysInfoInterface instance. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
46 |
* @return A pointer to the newly created instance of CSysInfoObserver. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
47 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
48 |
static CSysInfoObserver* NewL( CSysInfoInterface* aSysInfoIf ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
49 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
50 |
/** |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
51 |
* ~CSysInfoObserver |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
52 |
* Destructor. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
53 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
54 |
~CSysInfoObserver() {} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
55 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
56 |
public:// from ISystemObserver |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
57 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
58 |
/** |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
59 |
* HandleResponseL () |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
60 |
* Delegates asycn response to client by calling |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
61 |
* MLiwNotifyCallback::HandleNotifyL(). |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
62 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
63 |
void HandleResponseL(const TDesC& aEntity,const TDesC& aKey, |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
64 |
CSysData* aOutput, TInt32 aTransID, |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
65 |
TSysRequest::TRequestType aType, TInt aError); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
66 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
67 |
private: // Constructors |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
68 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
69 |
/** |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
70 |
* CSysInfoObserver. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
71 |
* C++ default constructor. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
72 |
* @param aSysInfoIf The CSysInfoInterface instance. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
73 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
74 |
CSysInfoObserver( CSysInfoInterface* aSysInfoIf ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
75 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
76 |
private: //Data |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
77 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
78 |
/** |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
79 |
* iSysInfoIf |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
80 |
* Handle to CSysInfoInterface instance. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
81 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
82 |
CSysInfoInterface* iSysInfoIf; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
83 |
}; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
84 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
85 |
#endif // __SYSINFOOBSERVER_H__ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
86 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
87 |
// End of File |