|
1 /* |
|
2 * Copyright (c) 2003-2005 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: SmilPlayerLinkParser declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SMILPLAYERLINKPARSER_H |
|
20 #define SMILPLAYERLINKPARSER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 _LIT( KMailToString, "mailto:"); |
|
27 _LIT( KPhoneToString, "phoneto:"); |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Parser the link |
|
33 * |
|
34 * @lib smilplayer.lib |
|
35 * @since 3.0 |
|
36 */ |
|
37 NONSHARABLE_CLASS(SmilPlayerLinkParser) |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Enumeration to define the type of the parsed link |
|
44 */ |
|
45 enum TSmilPlayerLinkType |
|
46 { |
|
47 ESmilPlayerNotSupported, |
|
48 ESmilPlayerPhoneNumber, |
|
49 ESmilPlayerMailAddress, |
|
50 ESmilPlayerUrlAddress |
|
51 }; |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * Returns link type for a given link |
|
57 * |
|
58 * @since 3.0 |
|
59 * |
|
60 * @param aText Text that will be parsed |
|
61 * @return link type |
|
62 */ |
|
63 static TSmilPlayerLinkType LinkType( const TDesC& aText ); |
|
64 |
|
65 private: |
|
66 |
|
67 /** |
|
68 * Search algorithm for phone number |
|
69 */ |
|
70 static TBool SearchPhoneNumber( const TDesC& aText); |
|
71 |
|
72 /** |
|
73 * Search algorithm for email address |
|
74 */ |
|
75 static TBool SearchMailAddress( const TDesC& aText); |
|
76 |
|
77 /** |
|
78 * Search algorithm for URL address |
|
79 */ |
|
80 static TBool SearchUrl( const TDesC& aText); |
|
81 |
|
82 /** |
|
83 * Parses URL. Is used by SearchUrlL method and if a url |
|
84 * was found it returns ETrue, otherwise EFalse. |
|
85 */ |
|
86 static TBool ParseUrl( const TDesC& aType, const TDesC& aText ); |
|
87 |
|
88 }; |
|
89 |
|
90 #endif // SMILPLAYERLINKPARSER_H |
|
91 |
|
92 // End of File |