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 implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "VoIPProvisioningRecognizer.h" |
|
20 #include "ecom/implementationproxy.h" |
|
21 |
|
22 // ============================ MEMBER FUNCTIONS =============================== |
|
23 |
|
24 // --------------------------------------------------------- |
|
25 // CVoIPProvisioningRecognizer::CVoIPProvisioningRecognizer |
|
26 // Default constructor |
|
27 // --------------------------------------------------------- |
|
28 // |
|
29 CVoIPProvisioningRecognizer::CVoIPProvisioningRecognizer() : |
|
30 CApaDataRecognizerType( KUidMimeVoIPProvisioningRecognizer, |
|
31 CApaDataRecognizerType::EHigh ) |
|
32 { |
|
33 iCountDataTypes = KVoIPSupportedMimeTypes; |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------- |
|
37 // CVoIPProvisioningRecognizer::PreferredBufSize |
|
38 // Overwritten method from CApaDataRecognizerType |
|
39 // --------------------------------------------------------- |
|
40 // |
|
41 TUint CVoIPProvisioningRecognizer::PreferredBufSize() |
|
42 { |
|
43 return 0x200; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------- |
|
47 // CVoIPProvisioningRecognizer::SupportedDataTypeL |
|
48 // Overwritten method from CApaDataRecognizerType |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 TDataType CVoIPProvisioningRecognizer::SupportedDataTypeL( TInt aIndex ) const |
|
52 { |
|
53 __ASSERT_DEBUG( aIndex >= 0 && |
|
54 aIndex < KVoIPSupportedMimeTypes, User::Leave( KErrArgument ) ); |
|
55 |
|
56 switch( aIndex ) |
|
57 { |
|
58 case 0: |
|
59 { |
|
60 TDataType type( KVoIPConfMimetypeSimple ); |
|
61 return type; |
|
62 } |
|
63 case 1: |
|
64 { |
|
65 TDataType type( KVoIPConfMimetypeApplication ); |
|
66 return type; |
|
67 } |
|
68 default: |
|
69 break; |
|
70 } |
|
71 |
|
72 return TDataType(); |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------------------------- |
|
76 // CVoIPProvisioningRecognizer::DoRecognizeL |
|
77 // Overwritten method from CApaDataRecognizerType |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 void CVoIPProvisioningRecognizer::DoRecognizeL( const TDesC& /*aName*/, |
|
81 const TDesC8& aBuffer ) |
|
82 { |
|
83 iConfidence = ENotRecognized; |
|
84 iDataType = TDataType(); |
|
85 if ( aBuffer.FindF( KVoIPXMLTag ) != KErrNotFound ) |
|
86 { |
|
87 iConfidence = ECertain; |
|
88 iDataType = TDataType( KVoIPConfMimetypeApplication ); |
|
89 } |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------- |
|
93 // CVoIPProvisioningRecognizer::CreateRecognizerL |
|
94 // Static method to create instance of CVoIPProvisioningRecognizer |
|
95 // --------------------------------------------------------- |
|
96 // |
|
97 CApaDataRecognizerType* CVoIPProvisioningRecognizer::CreateRecognizerL() |
|
98 { |
|
99 return new (ELeave) CVoIPProvisioningRecognizer(); |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------- |
|
103 // ImplementationTable |
|
104 // Table containing the data concerning CVoIPProvisioningRecognizer |
|
105 // --------------------------------------------------------- |
|
106 // |
|
107 const TImplementationProxy ImplementationTable[] = |
|
108 { |
|
109 IMPLEMENTATION_PROXY_ENTRY( KVoIPProvRecImplUIDValue, |
|
110 CVoIPProvisioningRecognizer::CreateRecognizerL ) |
|
111 }; |
|
112 |
|
113 // --------------------------------------------------------- |
|
114 // ImplementationGroupProxy |
|
115 // Function called by framework to return data about this recognizer |
|
116 // --------------------------------------------------------- |
|
117 // |
|
118 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( |
|
119 TInt& aTableCount ) |
|
120 { |
|
121 aTableCount = |
|
122 sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); |
|
123 return ImplementationTable; |
|
124 } |
|
125 |
|
126 // End of file. |
|