|
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: Uri parser class for svtmatching. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_SVTURIPARSER_H |
|
20 #define C_SVTURIPARSER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 |
|
25 /** |
|
26 * Uri parser class for svtmatching. |
|
27 * |
|
28 * @lib svtmatching |
|
29 * @since S60 v5.0 |
|
30 */ |
|
31 NONSHARABLE_CLASS( CSvtUriParser ) : public CBase |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 */ |
|
38 static CSvtUriParser* NewL(); |
|
39 |
|
40 |
|
41 /** |
|
42 * Destructor. |
|
43 */ |
|
44 ~CSvtUriParser(); |
|
45 |
|
46 /** |
|
47 * Parses address by rcse's ignore domain part setting. |
|
48 * @param aIgnoreDomain - Value of ignore domain part setting. |
|
49 * @param aOriginal - Original address to be parsed. |
|
50 * @param aParsedAddress - Parsed address. |
|
51 */ |
|
52 void ParseAddressL( TInt aIgnoreDomain, |
|
53 const TDesC& aOriginal, |
|
54 RBuf& aParsedAddress ) const; |
|
55 |
|
56 /** |
|
57 * Parses displayname part from uri. |
|
58 * @param aData - Original uri. |
|
59 * @param aDisplayname - Uris displayname part if found from |
|
60 * original uri. |
|
61 * @return KErrNone if succeed |
|
62 */ |
|
63 TInt DisplayNameFromUri( const TDesC& aData, RBuf& aDisplayname ) const; |
|
64 |
|
65 /** |
|
66 * Parses displayname part from uri. |
|
67 * @leave Leaves with system wide error. |
|
68 * @param aData - Original uri. |
|
69 * @param aDisplayname - Uris displayname part if found from |
|
70 * original uri. |
|
71 * @param aResult - Result of operation, KErrNone if success. |
|
72 */ |
|
73 void DisplayNameFromUriL( const TDesC& aData, RBuf& aDisplayname, TInt& aResult ) const; |
|
74 |
|
75 /** |
|
76 * Checks sip uri for spaces in begin and end of string. |
|
77 * @leave Leaves on failure. |
|
78 * @param aOriginal - Original sip uri. |
|
79 * @param aCheckedAddress - checked sip uri. |
|
80 */ |
|
81 void CheckForSpacesL( const TDesC& aOriginal, |
|
82 RBuf& aCheckedAddress ) const; |
|
83 |
|
84 private: |
|
85 |
|
86 /** |
|
87 * Checks is a string valid for CS call. |
|
88 * @param aOriginal - String to be checked. |
|
89 * @return ETrue if string valid for CS call. |
|
90 */ |
|
91 TBool IsValidGsmNumber( const TDesC& aOriginal ) const; |
|
92 |
|
93 /** |
|
94 * Parses username part from sip uri. |
|
95 * @param aOriginal - Original sip uri. |
|
96 * @param aUserName - Username part of the sip uri. |
|
97 * @return KErrNone if operation succeed. |
|
98 */ |
|
99 TInt GetUserNamePart( const TDesC& aOriginal, |
|
100 TDes& aUserName ) const; |
|
101 |
|
102 /** |
|
103 * Handles username parts for ignore domain part setting |
|
104 * values 1 and 2. |
|
105 * @leave Leaves on failure. |
|
106 * @param aIgnoreDomain - Value of ignore domain part setting. |
|
107 * @param aOriginal - Original sip uri. |
|
108 * @param aParsedAddress - Parsed sip uri. |
|
109 */ |
|
110 void HandleUserNamePartL( TInt aIgnoreDomain, |
|
111 const TDesC& aOriginal, |
|
112 RBuf& aParsedAddress ) const; |
|
113 |
|
114 private: |
|
115 |
|
116 CSvtUriParser(); |
|
117 |
|
118 private: // Data |
|
119 |
|
120 #ifdef _DEBUG |
|
121 friend class T_CSvtUriParser; |
|
122 #endif |
|
123 |
|
124 }; |
|
125 |
|
126 #endif //C_SVTURIPARSER_H |