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: Back Stepping Service Interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_BS_SERVICE_INTERFACE_H |
|
20 #define C_BS_SERVICE_INTERFACE_H |
|
21 |
|
22 #include <liwcommon.h> |
|
23 |
|
24 #include "bsclient.h" |
|
25 |
|
26 /** |
|
27 * Back Stepping Service Interface. |
|
28 * LIW interface for communication with BS Server. |
|
29 * |
|
30 * @since S60 v3.2 |
|
31 */ |
|
32 class CBSServiceInterface : public CBase, public MLiwInterface |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phase constructor. |
|
39 */ |
|
40 static CBSServiceInterface* NewLC(); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 ~CBSServiceInterface(); |
|
46 |
|
47 // from base class MLiwInterface |
|
48 /** |
|
49 * The consumer application should call this method to execute a service |
|
50 * command directly on the interface. |
|
51 * |
|
52 * @param aCmdName the name of the service command to invoke |
|
53 * @param aInParamList the input parameter list, can be empty list |
|
54 * @param [in,out] aOutParamList the output parameter list, can be empty. |
|
55 * @param aCmdOptions Options for the command |
|
56 * @param aCallback callback to be registered by consumer application |
|
57 * |
|
58 */ |
|
59 void ExecuteCmdL( const TDesC8& aCmdName, |
|
60 const CLiwGenericParamList& aInParamList, |
|
61 CLiwGenericParamList& aOutParamList, TUint aCmdOptions = 0, |
|
62 MLiwNotifyCallback* aCallback = 0 ); |
|
63 |
|
64 /** |
|
65 * The consumer application should call this method if there |
|
66 * are no more service commands to be executed on the interface. |
|
67 */ |
|
68 void Close(); |
|
69 |
|
70 private: |
|
71 |
|
72 // construction |
|
73 /** |
|
74 * Constructor. |
|
75 */ |
|
76 CBSServiceInterface(); |
|
77 |
|
78 /** |
|
79 * Symbian 2nd phace constructor. |
|
80 */ |
|
81 void ConstructL(); |
|
82 |
|
83 // service handling methods |
|
84 /** |
|
85 * Handles Initialize command. |
|
86 * |
|
87 * @param aInParamList input parameter list |
|
88 * @param aOutParamList output parameter list |
|
89 */ |
|
90 void InitializeL( const CLiwGenericParamList& aInParamList, |
|
91 CLiwGenericParamList& aOutParamList ); |
|
92 |
|
93 /** |
|
94 * Handles ForwardActivationEvent command. |
|
95 * |
|
96 * @param aInParamList input parameter list |
|
97 * @param aOutParamList output parameter list |
|
98 */ |
|
99 void ForwardActivationEventL( const CLiwGenericParamList& aInParamList, |
|
100 CLiwGenericParamList& aOutParamList ); |
|
101 |
|
102 /** |
|
103 * Handles HandleBackCommand command. |
|
104 * |
|
105 * @param aInParamList input parameter list |
|
106 * @param aOutParamList output parameter list |
|
107 */ |
|
108 void HandleBackCommandL( const CLiwGenericParamList& aInParamList, |
|
109 CLiwGenericParamList& aOutParamList ); |
|
110 |
|
111 // result handling |
|
112 /** |
|
113 * Appends error code to output parameter list. |
|
114 * |
|
115 * @param aOutParamList output parameter list |
|
116 * @param aError error code |
|
117 */ |
|
118 void HandleErrorL( CLiwGenericParamList& aOutParamList, |
|
119 const TInt aError ); |
|
120 |
|
121 /** |
|
122 * Appends service result to output parameter list. |
|
123 * |
|
124 * @param aOutParamList output parameter list |
|
125 * @param aError error code |
|
126 */ |
|
127 void HandleResultL( CLiwGenericParamList& aOutParamList, |
|
128 const TInt aResult ); |
|
129 |
|
130 // utility methods |
|
131 /** |
|
132 * Extracts a TPtrC8 param from input parameter list. |
|
133 * |
|
134 * @param aInParamList input parameter list |
|
135 * @param aParamName param name |
|
136 * @param aPtr returned value |
|
137 * @retutn Symbian error code |
|
138 */ |
|
139 TInt GetParam( const CLiwGenericParamList& aInParamList, |
|
140 const TDesC8& aParamName, TPtrC8& aPtr ) const; |
|
141 |
|
142 /** |
|
143 * Extracts a TInt32 param from input parameter list. |
|
144 * |
|
145 * @param aInParamList input parameter list |
|
146 * @param aParamName param name |
|
147 * @param aNumber returned value |
|
148 * @retutn Symbian error code |
|
149 */ |
|
150 TInt GetParam( const CLiwGenericParamList& aInParamList, |
|
151 const TDesC8& aParamName, TInt32& aNumber ) const; |
|
152 |
|
153 /** |
|
154 * Extracts a TBool param from input parameter list. |
|
155 * |
|
156 * @param aInParamList input parameter list |
|
157 * @param aParamName param name |
|
158 * @param aBool returned value |
|
159 * @retutn Symbian error code |
|
160 */ |
|
161 TInt GetParam( const CLiwGenericParamList& aInParamList, |
|
162 const TDesC8& aParamName, TBool& aBool ) const; |
|
163 |
|
164 private: |
|
165 // data |
|
166 |
|
167 /** |
|
168 * BS Server client. |
|
169 */ |
|
170 RBSClient iBSClient; |
|
171 |
|
172 }; |
|
173 |
|
174 #endif // C_BS_SERVICE_INTERFACE_H |
|