|
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 * Checks sip uri for spaces in begin and end of string. |
|
67 * @leave Leaves on failure. |
|
68 * @param aOriginal - Original sip uri. |
|
69 * @param aCheckedAddress - checked sip uri. |
|
70 */ |
|
71 void CheckForSpacesL( const TDesC& aOriginal, |
|
72 RBuf& aCheckedAddress ) const; |
|
73 |
|
74 private: |
|
75 |
|
76 /** |
|
77 * Checks is a string valid for CS call. |
|
78 * @param aOriginal - String to be checked. |
|
79 * @return ETrue if string valid for CS call. |
|
80 */ |
|
81 TBool IsValidGsmNumber( const TDesC& aOriginal ) const; |
|
82 |
|
83 /** |
|
84 * Parses username part from sip uri. |
|
85 * @param aOriginal - Original sip uri. |
|
86 * @param aUserName - Username part of the sip uri. |
|
87 * @return KErrNone if operation succeed. |
|
88 */ |
|
89 TInt GetUserNamePart( const TDesC& aOriginal, |
|
90 TDes& aUserName ) const; |
|
91 |
|
92 /** |
|
93 * Handles username parts for ignore domain part setting |
|
94 * values 1 and 2. |
|
95 * @leave Leaves on failure. |
|
96 * @param aIgnoreDomain - Value of ignore domain part setting. |
|
97 * @param aOriginal - Original sip uri. |
|
98 * @param aParsedAddress - Parsed sip uri. |
|
99 */ |
|
100 void HandleUserNamePartL( TInt aIgnoreDomain, |
|
101 const TDesC& aOriginal, |
|
102 RBuf& aParsedAddress ) const; |
|
103 |
|
104 private: |
|
105 |
|
106 CSvtUriParser(); |
|
107 |
|
108 private: // Data |
|
109 |
|
110 #ifdef _DEBUG |
|
111 friend class T_CSvtUriParser; |
|
112 #endif |
|
113 |
|
114 }; |
|
115 |
|
116 #endif //C_SVTURIPARSER_H |