|
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 class CMsgSchemeHandlerBase. |
|
15 // This is an abstract base class which parses a descriptor url into the |
|
16 // scheme specific components and launches the correct mail editor. |
|
17 // |
|
18 // |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 #ifndef __MSGBASE_H__ |
|
25 #define __MSGBASE_H__ |
|
26 |
|
27 // System includes |
|
28 // |
|
29 #include <e32base.h> |
|
30 #include <msvstd.h> |
|
31 |
|
32 |
|
33 // Forward declaration |
|
34 // |
|
35 class CRichText; |
|
36 class CParaFormatLayer; |
|
37 class CCharFormatLayer; |
|
38 |
|
39 |
|
40 /** |
|
41 @class |
|
42 Dependencies : CBase, MSendAsObserver, CParaFormatLayer, CCharFormatLayer, CRichText, |
|
43 MturUtils |
|
44 Comments : This is an abstract base class which parses a descriptor url into the |
|
45 scheme specific components and launches the correct mail editor. |
|
46 There are 2 messaging schemes; mailto and sms. |
|
47 |
|
48 Format of a url is: |
|
49 <scheme:<scheme specific part>> |
|
50 |
|
51 @since 7.0 |
|
52 */ |
|
53 |
|
54 class CMsgSchemeHandlerBase : public CBase |
|
55 |
|
56 /** |
|
57 @internalComponent |
|
58 @released |
|
59 */ |
|
60 { |
|
61 |
|
62 public: // Methods |
|
63 |
|
64 /** |
|
65 @fn ~CMsgSchemeHandlerBase() |
|
66 Intended Usage : Destructor. |
|
67 @since 7.0 |
|
68 */ |
|
69 virtual ~CMsgSchemeHandlerBase(); |
|
70 |
|
71 /** |
|
72 @fn ParseUrlAndSendL(const TDesC& aUrl) |
|
73 Intended Usage : Parses a descriptor url into the scheme specific components |
|
74 and launches the correct mail editor. |
|
75 @since 7.0 |
|
76 @param aUrl A descriptor with the messaging url. |
|
77 @pre None |
|
78 @post The messaging url descriptor has been parsed, field values are set |
|
79 and the correct mail editor has been launched. |
|
80 */ |
|
81 void ParseUrlAndSendL(const TDesC& aUrl); |
|
82 |
|
83 private: // Methods |
|
84 |
|
85 |
|
86 /** |
|
87 @fn ParseUrlL(const TDesC& aUrl) = 0 |
|
88 Intended Usage : Pure virtual function that parses a descriptor url into |
|
89 the scheme specific components. |
|
90 @since 7.0 |
|
91 @param aUrl A descriptor with the messaging url. |
|
92 @pre None |
|
93 @post The messaging url descriptor has been parsed and field values are set. |
|
94 */ |
|
95 virtual void ParseUrlL(const TDesC& aUrl) = 0; |
|
96 |
|
97 /** |
|
98 @fn SendL() = 0 |
|
99 Intended Usage : Pure virtual function that creates the message |
|
100 and launches the mail editor. |
|
101 @since 7.0 |
|
102 @pre None |
|
103 @post Message has been created and the editor has been launched. |
|
104 */ |
|
105 virtual void SendL() = 0; |
|
106 |
|
107 protected: // Methods |
|
108 |
|
109 /** |
|
110 @fn ConstructL() |
|
111 Intended Usage : Second phase of two-phase construction method. Does any |
|
112 allocations required to fully construct the object. |
|
113 @since 7.0 |
|
114 @leave KErrNoMemory. |
|
115 @pre First phase of construction is complete |
|
116 @post The object is fully constructed and initialised. |
|
117 */ |
|
118 void ConstructL(); |
|
119 |
|
120 /** |
|
121 @fn CMsgSchemeHandlerBase() |
|
122 Intended Usage : Constructor. First phase of two-phase construction method. Does |
|
123 non-allocating construction. |
|
124 @since 7.0 |
|
125 */ |
|
126 CMsgSchemeHandlerBase(); |
|
127 |
|
128 /** |
|
129 @fn LaunchEditorL(const TMsvId& aId) |
|
130 Intended Usage : Launches the editor. |
|
131 @since 7.0 |
|
132 @param aId Id of the message to be launched. |
|
133 @pre None |
|
134 @post Editor has been launched |
|
135 */ |
|
136 void LaunchEditorL(const TMsvId& aId); |
|
137 |
|
138 /** |
|
139 @fn GetSchemeSpecificPartL(const TDesC& aUrl, TPtrC& aSchemePart) |
|
140 Intended Usage : Sets the scheme specific part of a url. |
|
141 Error Condition : The function leaves with KErrNotFound if the scheme is not |
|
142 found. |
|
143 @since 7.0 |
|
144 @param aUrl A url descriptor |
|
145 @param aSchemePart This is an output argument that is set to the |
|
146 scheme specific part. |
|
147 @pre None |
|
148 @post The scheme specific part of the url is returned. |
|
149 */ |
|
150 void GetSchemeSpecificPartL(const TDesC& aUrl, TPtrC& aSchemePart); |
|
151 |
|
152 protected: // Attributes |
|
153 |
|
154 /** The rich text that contains the body of the message */ |
|
155 CRichText* iRtBody; |
|
156 |
|
157 private: // Attributes |
|
158 |
|
159 /** Used to create the rich text */ |
|
160 CParaFormatLayer* iPfl; |
|
161 /** Used to create the rich text */ |
|
162 CCharFormatLayer* iCfl; |
|
163 }; |
|
164 |
|
165 #endif |