|
1 /* |
|
2 * Copyright (c) 2002 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 the License "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: |
|
15 * Declaration of Scheme handler interface implementation for mailto:// scheme |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef MAIL_TO_HANDLER_H |
|
22 #define MAIL_TO_HANDLER_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include "BaseHandler.h" |
|
27 #include "BrowserTelService.h" |
|
28 #include <e32base.h> |
|
29 #include <eikdoc.h> |
|
30 #include <apparc.h> |
|
31 |
|
32 //#include <bamdesca.h> |
|
33 |
|
34 // FORWARD DECLARATION |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 |
|
39 /** |
|
40 * Scheme Handler IF implementation class for mailto scheme |
|
41 */ |
|
42 class CMailToHandler : public CBaseHandler, public MBrowserTelServiceObserver |
|
43 { |
|
44 |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Two phased constructor. Leaves on failure. |
|
49 * @param - aUrl |
|
50 * @return The created object. |
|
51 */ |
|
52 static CMailToHandler* NewL( const TDesC& aUrl ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CMailToHandler(); |
|
58 |
|
59 private: // Constructors |
|
60 |
|
61 enum TSchemeMailToFields ///<Possible MailTo fields |
|
62 { |
|
63 ESchemeMailTo, ///< MailTo. |
|
64 ESchemeSubject, ///< Subject. |
|
65 ESchemeMsgBody, ///< Message Body. |
|
66 ESchemeCc, ///< CC. |
|
67 ESchemeTo, ///< TO. |
|
68 ESchemeBcc, ///< Bcc. |
|
69 ESchemeNoMore |
|
70 }; |
|
71 |
|
72 /** |
|
73 * Constructor. |
|
74 */ |
|
75 CMailToHandler(); |
|
76 |
|
77 /** |
|
78 * Second phase constructor. Leaves on failure. |
|
79 * @param - aUrl |
|
80 */ |
|
81 void ConstructL( const TDesC& aUrl ); |
|
82 |
|
83 private: // Functions from base classes |
|
84 |
|
85 /** |
|
86 * Url Handler with embedding |
|
87 * @param - |
|
88 */ |
|
89 void HandleUrlEmbeddedL(); |
|
90 |
|
91 /** |
|
92 * Url Handler without embedding |
|
93 * @param - |
|
94 */ |
|
95 void HandleUrlStandaloneL(); |
|
96 |
|
97 /** |
|
98 * Get the appropriate filed from the url |
|
99 * @param aHeader the name of the field |
|
100 */ |
|
101 TPtrC GetField(const TDesC& aHeader); |
|
102 |
|
103 /** |
|
104 * Check if the field is in the url |
|
105 * @param aHeader the name of the field |
|
106 * @return TBool |
|
107 */ |
|
108 TBool IsHeader(const TDesC& aHeader); |
|
109 |
|
110 /** |
|
111 * Starting position of the specific field |
|
112 * @param aHeader the name of the field |
|
113 * @return TInt Starting position of the specific field |
|
114 */ |
|
115 TInt FieldStart(const TDesC& aHeader); |
|
116 |
|
117 /** |
|
118 * Ending position of the specific field |
|
119 * @param aHeader the name of the field |
|
120 * @return TInt Ending position of the specific field |
|
121 */ |
|
122 TInt FieldEnd( const TDesC& aHeader ); |
|
123 |
|
124 /** |
|
125 * Get the enumerated position of the specific field |
|
126 * @param aHeader the name of the field |
|
127 * @return TSchemeMailToFields |
|
128 */ |
|
129 TSchemeMailToFields GetHeaderPos( const TDesC& aHeader ); |
|
130 |
|
131 /** |
|
132 * Get the next enumerated position of the specific field |
|
133 * @param aPos enumerated position of the field |
|
134 */ |
|
135 //TSchemeMailToFields CMailToHandler::GetNextField(TSchemeMailToFields aPos); |
|
136 TInt GetNextField( TInt aStart ); |
|
137 |
|
138 /** |
|
139 * Notification of the state change. |
|
140 * @param aEvent The new state. |
|
141 * @return TSchemeMailToFields |
|
142 */ |
|
143 void BrowserTelServiceEvent(TBrowserTelServiceState aEvent); |
|
144 |
|
145 /** |
|
146 * Notification of the error that occurred. |
|
147 * @param aError The error. |
|
148 */ |
|
149 void BrowserTelServiceError(TBrowserTelServiceError aError); |
|
150 |
|
151 /** |
|
152 * Notification when the phonebook dialog has been exited. |
|
153 * @param. |
|
154 */ |
|
155 void NotifyClient(); |
|
156 |
|
157 /** |
|
158 * Returns the minimum value of the arguments. |
|
159 * @param. |
|
160 * @return |
|
161 */ |
|
162 TInt Minimum( TInt aPos1, TInt aPos2, TInt aPos3, TInt aPos4, TInt aPos5 ); |
|
163 |
|
164 /** |
|
165 * Changes ?to= hedear into comma in case of multiple recipients |
|
166 * @param aRecipients - email addresses. |
|
167 * @return parsed descriptor |
|
168 */ |
|
169 HBufC* ChangeSeparationLC( const TDesC& aRecipients ); |
|
170 |
|
171 private: // Data |
|
172 CBrowserTelService* iTelService; ///< Owned. |
|
173 }; |
|
174 |
|
175 #endif /* def MAIL_TO_HANDLER_H */ |