|
1 /* |
|
2 * Copyright (c) 2007-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 the License "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: This Class provides the interface for |
|
15 * calling the functionality to Media Management SAPI. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CMgInterface_H |
|
22 #define __CMgInterface_H |
|
23 |
|
24 |
|
25 |
|
26 class CMgService; |
|
27 class CMgServiceObserver; |
|
28 |
|
29 const TInt KMaxErrorMessageLength = 100; |
|
30 // CLASS DECLARATION |
|
31 |
|
32 |
|
33 |
|
34 /** |
|
35 * Interface class for Media Management SAPI. |
|
36 * |
|
37 * @code |
|
38 * MLiwInterface* Interface = CMgInterface::NewL(); |
|
39 * Interface->ExecuteCmdL(KGetList,input,output,KLiwOptASyncronous,CallBack); |
|
40 * @endcode |
|
41 * |
|
42 * |
|
43 * @since Series60 v3.2 |
|
44 */ |
|
45 |
|
46 class CMgInterface : public CBase, public MLiwInterface |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Two-phased constructor |
|
51 * @since Series60 v3.2 |
|
52 * @param void |
|
53 * @return CMgInterface* Returns the instance of |
|
54 * CMgInterface. |
|
55 */ |
|
56 static CMgInterface* NewL(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CMgInterface(); |
|
62 |
|
63 /** |
|
64 * This function handles the request of consumer |
|
65 * @since Series60 v3.2 |
|
66 * @param aCmdName Command name of SAPI |
|
67 * @param aInParamList Contains argument on which operation has to |
|
68 be performed |
|
69 * @param aOutParamList Result of given command will be |
|
70 * stored in the output paramater list |
|
71 * @param aCmdOptions Set option for asyncronous request or |
|
72 * for canceling the asyncronous request |
|
73 * @param aCallback Contains the callback for Asynchronous request |
|
74 */ |
|
75 |
|
76 virtual void ExecuteCmdL(const TDesC8& aCmdName, |
|
77 const CLiwGenericParamList& aInParamList, |
|
78 CLiwGenericParamList& aOutParamList, |
|
79 TUint aCmdOptions = 0, |
|
80 MLiwNotifyCallback* aCallback = 0); |
|
81 |
|
82 |
|
83 /** |
|
84 * This function will release all the internal resources |
|
85 * @since Series60 v3.2 |
|
86 * @param void |
|
87 * @return void |
|
88 */ |
|
89 virtual void Close() {delete this;} |
|
90 |
|
91 /** |
|
92 * This function will convert Symbian error codes to |
|
93 * SAPI specific error codes |
|
94 * @since Series60 v3.2 |
|
95 * @param aSymbianErr Symbian error code to be converted to SAPI specific |
|
96 * error code |
|
97 * @return An integer error code |
|
98 */ |
|
99 static TInt SapiError( TInt aSymbianErr ); |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * constructor |
|
105 * @since Series60 v3.2 |
|
106 * @param void |
|
107 * @return void |
|
108 */ |
|
109 CMgInterface(); |
|
110 |
|
111 /** |
|
112 * Two-phased constructor |
|
113 * @since Series60 v3.2 |
|
114 * @param void |
|
115 * @return void |
|
116 */ |
|
117 void ConstructL(); |
|
118 /** |
|
119 * This function will send the request to SAPI core class |
|
120 * @since Series60 v3.2 |
|
121 * @param void |
|
122 * @return void |
|
123 */ |
|
124 void SendRequestL(const CLiwGenericParamList& aInParamList, TUint aTransactionID ,TBool aPostionBasedSearching ); |
|
125 |
|
126 /** |
|
127 * Appends error message |
|
128 * @param aCmdName Command Name |
|
129 * @param aParameter Parameter Name |
|
130 * @param aMessage Error message |
|
131 * |
|
132 * @return void |
|
133 */ |
|
134 void AppendErrorMessageL( const TDesC8& aCmdName, |
|
135 const TDesC8& aParameter, |
|
136 const TDesC& aMessage ); |
|
137 |
|
138 private: |
|
139 /** |
|
140 * Stores the instance of SAPI Core Class |
|
141 */ |
|
142 CMgService *iCoreClass; |
|
143 |
|
144 /** |
|
145 * Stores the instance of Service observer Class |
|
146 */ |
|
147 CMgServiceObserver *iServiceObserver; |
|
148 |
|
149 /** |
|
150 * Error Message object |
|
151 * @internal |
|
152 */ |
|
153 HBufC* iErrorMessage; |
|
154 |
|
155 |
|
156 }; |
|
157 |
|
158 #endif __CMgInterface_H |