|
1 /* |
|
2 * Copyright (c) 2008-2009 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: It is parser for voip numbers. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHONEVOIPNUMBERPARSER_H |
|
20 #define CPHONEVOIPNUMBERPARSER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "CPhoneGsmParserBase.h" |
|
24 #include <PhCltTypes.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CPhoneGsmOptionContainer; |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 /* |
|
32 * EMERGENCY NUMBER UIDS |
|
33 */ |
|
34 const TUint32 KPhoneUidVoipNumber = |
|
35 PHONE_MAKE_UID( KPhoneUidDialVoipyNumber, 0 ); |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * It is parser for voip numbers. |
|
41 * |
|
42 * @since S60 5.0 |
|
43 * @lib phoneparser.lib |
|
44 */ |
|
45 NONSHARABLE_CLASS( CPhoneVoipNumberParser ) |
|
46 : public CPhoneGsmParserBase |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 static CPhoneVoipNumberParser* NewLC(); |
|
54 |
|
55 public: // Functions from base classes |
|
56 |
|
57 /** |
|
58 * From CPhoneGsmParserBase. |
|
59 * Parse string. |
|
60 * |
|
61 * @param aString It is string to be parsed. |
|
62 * @param aResult It will contain result. |
|
63 * @param aOptions It indicates operation options. |
|
64 * @return It returns boolean value indicating success of parsing. |
|
65 */ |
|
66 TBool ParseL( |
|
67 const TDesC& aString, |
|
68 CPhoneGsmParserResult& aResult, |
|
69 CPhoneGsmOptionContainerBase& aOptions ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 CPhoneVoipNumberParser(); |
|
77 |
|
78 /** |
|
79 * Parse. |
|
80 * |
|
81 * @param aString It is string to be parsed. |
|
82 * @param aResult It will contain result. |
|
83 * @param aOptionUid It is the uid of the option. |
|
84 * @return It returns boolean value indicating success of parsing. |
|
85 */ |
|
86 TBool DoParseL( |
|
87 const TDesC& aString, |
|
88 CPhoneGsmParserResult& aResult, |
|
89 CPhoneGsmOptionContainer& aOptions ); |
|
90 /** |
|
91 * Takes a main part of the phone number( before 'p','w' or |
|
92 * second '+' marks ). |
|
93 * And add it to parameter of the aResult with or without optional |
|
94 * international prefix. |
|
95 * @param aLex Contains string to be handled. |
|
96 * @param aResult It will contain result. |
|
97 */ |
|
98 void TakeNumberPartL( |
|
99 TLex& aLex, |
|
100 CPhoneGsmParserResult& aResult ); |
|
101 |
|
102 /** |
|
103 * Takes Dtmf postfix and add it to parameter of the aResult. |
|
104 * @param aLex Contains string to be handled. |
|
105 * @param aResult It will contain result. |
|
106 */ |
|
107 void TakeDtmfPostfixL( |
|
108 TLex& aLex, |
|
109 CPhoneGsmParserResult& aResult ); |
|
110 |
|
111 /** |
|
112 * Checks that string contains only valid dtmf characters |
|
113 * @param aString string to be checked |
|
114 * @return ETrue if valid dtmf string |
|
115 */ |
|
116 TBool IsValidDtmfString( TPtrC& aString ); |
|
117 |
|
118 }; |
|
119 |
|
120 #endif // CPHONEVOIPNUMBERPARSER_H |
|
121 |
|
122 // End of File |