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 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: Implementation of RTP file recognizer class.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CRTPCLIPRECOGNIZER_H |
|
21 #define CRTPCLIPRECOGNIZER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <apmrec.h> |
|
25 #include <etelmm.h> |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KUserIdLength( RMobilePhone::KIMSISize ); |
|
29 const TInt KDeviceIdLength( RMobilePhone::KPhoneSerialNumberSize ); |
|
30 |
|
31 // MACROS |
|
32 // None |
|
33 |
|
34 // DATA TYPES |
|
35 // None |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 // None |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * Class to make recognisation for RTP propriatary clip. |
|
44 * |
|
45 * @lib RtpClipRecognizer.lib |
|
46 * @since Series 60 3.0 |
|
47 */ |
|
48 class CRtpClipRecognizer : public CApaDataRecognizerType |
|
49 { |
|
50 |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Static method to create instance of this recognizer. This method is called |
|
55 * by the framework. Method pointer is delivered to the framework by |
|
56 * ImplementationTable table returned by ImplementationGroupProxy. |
|
57 * @since Series 60 3.0 |
|
58 * @param none. |
|
59 * @return Pointer to newly created instance of the recognizer. |
|
60 */ |
|
61 static CApaDataRecognizerType* CreateRecognizerL(); |
|
62 |
|
63 /** |
|
64 * C++ default constructor. Calls CApaDataRecognizerType in it's initializer |
|
65 * list to complete construction. |
|
66 */ |
|
67 CRtpClipRecognizer(); |
|
68 |
|
69 private: // Functions from base classes |
|
70 |
|
71 /** |
|
72 * From CApaDataRecognizerType. |
|
73 * Method called by the framework. This method returns the amount of data |
|
74 * to be wanted for recognisation. |
|
75 * @since Series 60 3.0 |
|
76 * @param none. |
|
77 * @return Preferred buffer size for recognisation. |
|
78 */ |
|
79 virtual TUint PreferredBufSize(); |
|
80 |
|
81 /** |
|
82 * From CApaDataRecognizerType. |
|
83 * Method to deliver supported data types by this recognizer. |
|
84 * @since Series 60 3.0 |
|
85 * @param aIndex a index pointing out which data type |
|
86 * of the supported ones is returned. |
|
87 * @return Corresponding data type of the requested index. |
|
88 */ |
|
89 virtual TDataType SupportedDataTypeL( TInt aIndex ) const; |
|
90 |
|
91 /** |
|
92 * From CApaDataRecognizerType. |
|
93 * Overwritten method to handle recognisation. |
|
94 * @param aName the name of the data. Typically this is a file name |
|
95 * containing the data to be recognized. |
|
96 * @param aBuffer a buffer containing PreferredBufSize() from the |
|
97 * beginning of the file to be recognized. |
|
98 * @return none. |
|
99 */ |
|
100 virtual void DoRecognizeL( const TDesC& aName, |
|
101 const TDesC8& aBuffer ); |
|
102 |
|
103 private: // New methods |
|
104 |
|
105 /** |
|
106 * Converts bytes to integer. |
|
107 * @since Series 60 3.0 |
|
108 * @param aBytes a buffer to convert. |
|
109 * @return an integer converted from bytes. |
|
110 */ |
|
111 TInt GetValueL( const TDesC8& aBytes ); |
|
112 |
|
113 /** |
|
114 * Converts bytes to integer. |
|
115 * @since Series 60 3.0 |
|
116 * @param aBytes a buffer to convert. |
|
117 * @param aValue a integer converted from bytes. |
|
118 * @return none. |
|
119 */ |
|
120 void GetValueL( const TDesC8& aBytes, TInt& aValue ); |
|
121 |
|
122 /** |
|
123 * Converts bytes to integer. |
|
124 * @since Series 60 3.0 |
|
125 * @param aBytes a buffer to convert. |
|
126 * @param aValue a integer converted from bytes. |
|
127 * @return a system wide error code. |
|
128 */ |
|
129 TInt GetValue( const TDesC8& aBytes, TInt& aValue ); |
|
130 |
|
131 /** |
|
132 * Converts bytes to integer. |
|
133 * @since Series 60 3.0 |
|
134 * @param aBytes a buffer to convert. |
|
135 * @param aValue a integer converted from bytes. |
|
136 * @return a system wide error code. |
|
137 */ |
|
138 TInt GetValue( const TDesC8& aBytes, TUint& aValue ); |
|
139 |
|
140 /** |
|
141 * Converts bytes to 64 bit integer (TInt64). |
|
142 * @since Series 60 3.0 |
|
143 * @param aBytes a buffer to convert. |
|
144 * @return a integer value converted from bytes. |
|
145 */ |
|
146 TInt64 GetTInt64L( const TDesC8& aBytes ); |
|
147 |
|
148 /** |
|
149 * Getter for RTP clip mime type info. |
|
150 * @since Series 60 3.0 |
|
151 * @param aBuf on return contains the mime type. |
|
152 * @return None. |
|
153 */ |
|
154 void GetMimeInfo( TDes8& aMime ); |
|
155 |
|
156 /** |
|
157 * Reads IMEI of the phone HW. |
|
158 * @since Series 60 3.0 |
|
159 * @param aBuf on return contains the IMEI. |
|
160 * @return none. |
|
161 */ |
|
162 void GetImeiL( TDes& aImsi ); |
|
163 |
|
164 /** |
|
165 * Reads mobile info of the phone. |
|
166 * @since Series 60 3.0 |
|
167 * @param none. |
|
168 * @return none. |
|
169 */ |
|
170 void GetMobilePhoneInfoL( RTelServer& aServer, |
|
171 RMobilePhone& aPhone ); |
|
172 |
|
173 private: // Data |
|
174 |
|
175 TBuf8<KDeviceIdLength> iImei; |
|
176 |
|
177 }; |
|
178 |
|
179 #endif // CRTPCLIPRECOGNIZER_H |
|
180 |
|
181 // End of File |
|