|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This file contains the API definition for the classes |
|
15 // TDelimitedAddressParser, TDelimitedBodyParser, TMailtoUrlParser, |
|
16 // TDelimitedSmsParser, TParseUtil, |
|
17 // These classes are used by the scheme handler classes to parse the |
|
18 // messaging urls. |
|
19 // |
|
20 // |
|
21 |
|
22 /** |
|
23 @file |
|
24 */ |
|
25 |
|
26 #ifndef __MSGURLPARSER_H__ |
|
27 #define __MSGURLPARSER_H__ |
|
28 |
|
29 |
|
30 // System Includes |
|
31 // |
|
32 #include <e32base.h> |
|
33 #include <delimitedparser16.h> |
|
34 #include <delimitedquery16.h> |
|
35 |
|
36 |
|
37 /** |
|
38 @class |
|
39 Comments : For parsing address component of mailto urls delimited by a ',' |
|
40 as defined in RFC2368 and below. |
|
41 This class is used by CMailtoSchemeHandler class. |
|
42 |
|
43 Define format of mailto url: |
|
44 mailto:<address segment>?<body segment> |
|
45 |
|
46 @since 7.0 |
|
47 */ |
|
48 class TDelimitedAddressParser : public TDelimitedParserBase16 |
|
49 /** |
|
50 @internalComponent |
|
51 @released |
|
52 */ |
|
53 { |
|
54 public: |
|
55 |
|
56 /** |
|
57 @fn TDelimitedAddressParser() |
|
58 Intended Usage : Constructor. |
|
59 @since 7.0 |
|
60 @post Delimeter is set |
|
61 */ |
|
62 TDelimitedAddressParser(); |
|
63 |
|
64 /** |
|
65 @fn Parse(const TDesC& aAddress) |
|
66 Intended Usage : This parses the descriptor into address segments from |
|
67 left to right. |
|
68 @since 7.0 |
|
69 @param aAddress A descriptor containing the address segment. |
|
70 @pre The delimiter must have been set. |
|
71 @post The current segment is the leftmost segment and the direction |
|
72 of parsing is set from left to right. |
|
73 */ |
|
74 void Parse(const TDesC& aAddress); |
|
75 }; |
|
76 |
|
77 |
|
78 /** |
|
79 @typedef TDelimitedBodyParser |
|
80 Comments : For parsing body segment of mailto urls delimited by a '&' |
|
81 as defined in RFC2368 and below. |
|
82 This class is used by CMailtoSchemeHandler class. |
|
83 |
|
84 Define format of mailto url: |
|
85 mailto:<address segment>?<body segment> |
|
86 |
|
87 @since 7.0 |
|
88 |
|
89 @internalComponent |
|
90 @released |
|
91 */ |
|
92 typedef TDelimitedQueryParser16 TDelimitedBodyParser; |
|
93 |
|
94 |
|
95 /** |
|
96 @class |
|
97 Comments : Parses the address segment and body segment as defined |
|
98 in RFC2368 and below. |
|
99 This class is used by CMailtoSchemeHandler class. |
|
100 |
|
101 Define format of mailto url: |
|
102 mailto:<address segment>?<body segment> |
|
103 |
|
104 @since 7.0 |
|
105 */ |
|
106 class TMailtoUrlParser |
|
107 /** |
|
108 @internalComponent |
|
109 @released |
|
110 */ |
|
111 { |
|
112 public: |
|
113 |
|
114 /** |
|
115 @fn TMailtoUrlParser() |
|
116 Intended Usage : Constructor. |
|
117 @since 7.0 |
|
118 */ |
|
119 TMailtoUrlParser(); |
|
120 |
|
121 /** |
|
122 @fn Parse(const TDesC& aData) |
|
123 Intended Usage : Parses the address segment and body segment of mailto url. |
|
124 @since 7.0 |
|
125 @param aData A descriptor containing the data to be parsed. |
|
126 @pre None |
|
127 @post The address segment and body segment is parsed. |
|
128 The current segment is the leftmost segment and the direction |
|
129 of parsing is set from left to right. |
|
130 */ |
|
131 void Parse(const TDesC& aData); |
|
132 |
|
133 /** |
|
134 @fn ExtractAddresses() |
|
135 Intended Usage : Returns TDelimitedAddressParser |
|
136 @since 7.0 |
|
137 @return TDelimitedAddressParser& |
|
138 @pre The address segment has been parsed. |
|
139 */ |
|
140 const TDelimitedAddressParser& ExtractAddresses() const; |
|
141 |
|
142 /** |
|
143 @fn const TDelimitedBodyParser& ExtractBody() |
|
144 Intended Usage : Returns TDelimitedBodyParser |
|
145 @since 7.0 |
|
146 @return const TDelimitedBodyParser& |
|
147 @pre The body segment has been parsed |
|
148 */ |
|
149 const TDelimitedBodyParser& ExtractBody() const; |
|
150 |
|
151 private: |
|
152 /** Contains the parsed address segment */ |
|
153 TDelimitedAddressParser iAddressParser; |
|
154 /** Contains the parsed body segment */ |
|
155 TDelimitedBodyParser iBodyParser; |
|
156 }; |
|
157 |
|
158 |
|
159 /** |
|
160 @typedef TDelimitedSmsParser |
|
161 Comments : For parsing sms urls delimited by a ','. |
|
162 This class is used by CSmsSchemeHandler class. |
|
163 |
|
164 @since 7.0 |
|
165 |
|
166 @internalComponent |
|
167 @released |
|
168 */ |
|
169 typedef TDelimitedAddressParser TDelimitedSmsParser; |
|
170 |
|
171 |
|
172 /** |
|
173 @class |
|
174 Comments : This class contains parsing utility functions used by the |
|
175 scheme handler classes. |
|
176 @since 7.0 |
|
177 */ |
|
178 class ParseUtil |
|
179 /** |
|
180 @internalComponent |
|
181 @released |
|
182 */ |
|
183 { |
|
184 public: |
|
185 |
|
186 /** |
|
187 @fn Subset(const TDesC& aDes, const TDesC& aSubset, TPtrC& aData) |
|
188 Intended Usage : Sets the leftmost part of aDes up to the first non-allowable |
|
189 character. |
|
190 @since 7.0 |
|
191 @param aDes A descriptor to be parsed. |
|
192 @param aSubset A descriptor containing the allowed characters. |
|
193 @param aData This is an output argument that is set to the |
|
194 parsed descriptor. |
|
195 */ |
|
196 static void Subset(const TDesC& aDes, const TDesC& aSubset, TPtrC& aData); |
|
197 }; |
|
198 |
|
199 #endif |