|
1 /* |
|
2 * Copyright (c) 2009-2010 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: CVoIPProvisioningRecognizer definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VOIPPROVISIONINGRECOGNIZER_H |
|
20 #define VOIPPROVISIONINGRECOGNIZER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <apmrec.h> |
|
24 |
|
25 // DEFINITIONS |
|
26 |
|
27 // Uid of this dll (defined in .mmp file) |
|
28 const TUid KUidMimeVoIPProvisioningRecognizer = { 0x20026FE1 }; |
|
29 |
|
30 // Implementation uid for this recognizer |
|
31 const TInt KVoIPProvRecImplUIDValue = 0x20026FE2; |
|
32 const TUid KUidVoIPProvRecImpl = { KVoIPProvRecImplUIDValue }; |
|
33 |
|
34 // Amount of mime types this recognizer can handle |
|
35 const TInt KVoIPSupportedMimeTypes( 2 ); |
|
36 |
|
37 // Exported mime types |
|
38 _LIT8( KVoIPConfMimetypeSimple, "vnd.nokia.voip.config+xml" ); |
|
39 _LIT8( KVoIPConfMimetypeApplication, "application/vnd.nokia.voip.config+xml" ); |
|
40 |
|
41 // Strings to be searched to recognize content |
|
42 _LIT8( KVoIPXMLTag, "nokia-confdoc" ); |
|
43 |
|
44 #ifdef _DEBUG |
|
45 #define EUNIT_TEST_FRIEND( x ) friend class x; |
|
46 #else |
|
47 #define EUNIT_TEST_FRIEND( x ) |
|
48 #endif |
|
49 |
|
50 /** |
|
51 * Class to make recognisation for VoIP configuration XML file. |
|
52 * |
|
53 * @since S60 v5.0 |
|
54 * @lib voipprovrec.lib |
|
55 */ |
|
56 class CVoIPProvisioningRecognizer : public CApaDataRecognizerType |
|
57 { |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Default constructor. Calls CApaDataRecognizerType in it's |
|
62 * initializer list to complete construction. |
|
63 */ |
|
64 CVoIPProvisioningRecognizer(); |
|
65 |
|
66 /** |
|
67 * Static method to create instance of this recognizer. |
|
68 * This method is called by the framework. |
|
69 * Method pointer is delivered to the framework by ImplementationTable |
|
70 * table returned by ImplementationGroupProxy. |
|
71 * |
|
72 * @since S60 v5.0 |
|
73 * @return Pointer to newly created instance of the recognizer. |
|
74 */ |
|
75 static CApaDataRecognizerType* CreateRecognizerL(); |
|
76 |
|
77 /** |
|
78 * Method called by the framework. |
|
79 * This method returns the desired amount of data for recognition. |
|
80 * |
|
81 * @since S60 v5.0 |
|
82 * @return Preferred buffer size for recognition. |
|
83 */ |
|
84 virtual TUint PreferredBufSize(); |
|
85 |
|
86 /** |
|
87 * Method to deliver supported data types by this recognizer. |
|
88 * |
|
89 * @since S60 v5.0 |
|
90 * @param aIndex Index pointing out which data type of the supported |
|
91 * ones is returned. |
|
92 * @return Corresponding data type of the requested index. |
|
93 */ |
|
94 virtual TDataType SupportedDataTypeL( TInt aIndex ) const; |
|
95 |
|
96 private: // From CApaDataRecognizerType |
|
97 |
|
98 /** |
|
99 * Overwritten method to handle recognisation. |
|
100 * |
|
101 * @since S60 v5.0 |
|
102 * @param aName The name of the data; typically this is a file name |
|
103 * containing the data to be recognized. |
|
104 * @param aBuffer Buffer containing PreferredBufSize() from |
|
105 * the beginning of the file to be recognized. |
|
106 */ |
|
107 virtual void DoRecognizeL( const TDesC& /*aName*/, const TDesC8& aBuffer ); |
|
108 |
|
109 EUNIT_TEST_FRIEND( UT_CVoIPProvisioningRecognizer ) |
|
110 }; |
|
111 |
|
112 #endif // VOIPPROVISIONINGRECOGNIZER_H |