|
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 "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: CPS Service Interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CDATASOURCEINTERFACE_H |
|
20 #define CDATASOURCEINTERFACE_H |
|
21 |
|
22 #include <liwcommon.h> |
|
23 |
|
24 class CCPClient; |
|
25 |
|
26 /** |
|
27 * CPS Service Interface |
|
28 * |
|
29 * This class implements interface to CPS Service. |
|
30 * |
|
31 * @lib cpclient.dll |
|
32 * @since S60 v 5.0 |
|
33 */ |
|
34 class CDataSourceInterface : public CBase, public MLiwInterface |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CDataSourceInterface* NewL(); |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CDataSourceInterface* NewLC(); |
|
47 |
|
48 /** |
|
49 * Desctructor. |
|
50 */ |
|
51 ~CDataSourceInterface(); |
|
52 |
|
53 // from base class MLiwInterface |
|
54 |
|
55 /** |
|
56 * The consumer application should call this method to execute a service |
|
57 * command directly on the interface. |
|
58 * |
|
59 * @param aCmdName the name of the service command to invoke |
|
60 * @param aInParamList the input parameter list, can be empty list |
|
61 * @param [in,out] aOutParamList the output parameter list, can be empty. |
|
62 * @param aCmdOptions Options for the command |
|
63 * @param aCallback callback to be registered by consumer application |
|
64 * |
|
65 */ |
|
66 void ExecuteCmdL( const TDesC8& aCmdName, |
|
67 const CLiwGenericParamList& aInParamList, |
|
68 CLiwGenericParamList& aOutParamList, TUint aCmdOptions, |
|
69 MLiwNotifyCallback* aCallback ); |
|
70 |
|
71 /** |
|
72 * The consumer application should call this method if there |
|
73 * are no more service commands to be executed on the interface. |
|
74 * |
|
75 */ |
|
76 virtual void Close(); |
|
77 |
|
78 protected: |
|
79 |
|
80 /** |
|
81 * C++ default constructor. |
|
82 */ |
|
83 CDataSourceInterface(); |
|
84 /** |
|
85 * Perform the second phase construction of a CCPClientInterface object. |
|
86 */ |
|
87 void ConstructL(); |
|
88 |
|
89 /** |
|
90 * Proccess request issued by service client. |
|
91 * |
|
92 * @param aCmdName the name of the service command to invoke |
|
93 * @param aInParamList the input parameter list, can be empty list |
|
94 * @param [in,out] aOutParamList the output parameter list, can be empty. |
|
95 * @param aCmdOptions Options for the command |
|
96 * @param aCallback callback to be registered by consumer application |
|
97 * |
|
98 */ |
|
99 virtual void ProcessCommandL( const TDesC8& aCmdName, |
|
100 const CLiwGenericParamList& aInParamList, |
|
101 CLiwGenericParamList& aOutParamList, TUint aCmdOptions, |
|
102 MLiwNotifyCallback* aCallback ); |
|
103 |
|
104 public: |
|
105 |
|
106 /** |
|
107 * Converse error code |
|
108 * @param code the error |
|
109 * @return TInt32 the error code after converse |
|
110 */ |
|
111 static TInt32 ErrCodeConversion( TInt code ); |
|
112 |
|
113 protected: |
|
114 // data |
|
115 |
|
116 /** |
|
117 * Client to CPS Server. Containing active object |
|
118 * to handle asynchornous requests. |
|
119 * Own. |
|
120 */ |
|
121 CCPClient* iCPClient; |
|
122 }; |
|
123 |
|
124 #endif // CDATASOURCEINTERFACE_H |