|
1 /* |
|
2 * Copyright (c) 2007-2008 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: common base mailbox object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CFSMAILBOXBASE_H |
|
20 #define __CFSMAILBOXBASE_H |
|
21 |
|
22 // <qmail> |
|
23 #include <QExplicitlySharedDataPointer> |
|
24 #include <e32base.h> |
|
25 #include "CFSMailCommon.h" |
|
26 |
|
27 class NmMailboxPrivate; |
|
28 class NmMailbox; |
|
29 class CFSMailAddress; |
|
30 class MMRInfoProcessor; |
|
31 // </qmail> |
|
32 |
|
33 /** |
|
34 * base class for handling mailbox data |
|
35 * |
|
36 * @lib FSFWCommonLib |
|
37 * @since S60 S60 v3.1 |
|
38 */ |
|
39 |
|
40 NONSHARABLE_CLASS ( CFSMailBoxBase ) : public CBase |
|
41 { |
|
42 public: |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * |
|
47 * @param aMailBoxId mailbox id in plugin containing mailbox |
|
48 */ |
|
49 IMPORT_C static CFSMailBoxBase* NewL( const TFSMailMsgId aMailBoxId ); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * |
|
54 * @param aMailBoxId mailbox id in plugin containing mailbox |
|
55 */ |
|
56 IMPORT_C static CFSMailBoxBase* NewLC( const TFSMailMsgId aMailBoxId ); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 IMPORT_C virtual ~CFSMailBoxBase(); |
|
62 |
|
63 /** |
|
64 * mailbox id accessor |
|
65 * |
|
66 * @return mailbox id |
|
67 */ |
|
68 IMPORT_C TFSMailMsgId GetId() const; |
|
69 |
|
70 /** |
|
71 * mailbox name accessor |
|
72 * |
|
73 * @return mailbox name |
|
74 */ |
|
75 IMPORT_C TDesC& GetName() const; |
|
76 |
|
77 /** |
|
78 * mailbox name mutator |
|
79 * |
|
80 * @param aMailBoxName mailbox name |
|
81 */ |
|
82 IMPORT_C void SetName( const TDesC& aMailBoxName ); |
|
83 |
|
84 /** |
|
85 * retuns mailbox status accessor |
|
86 * |
|
87 * @return mailbox status |
|
88 */ |
|
89 IMPORT_C TFSMailBoxStatus GetStatus() const; |
|
90 |
|
91 /** |
|
92 * mailbox status mutator |
|
93 * |
|
94 * @param aStatus mailbox status |
|
95 */ |
|
96 IMPORT_C void SetStatus( const TFSMailBoxStatus aStatus ); |
|
97 |
|
98 /* |
|
99 * Function to set context of Remote Contact Lookup service for |
|
100 * this mailbox for protocol plugins. |
|
101 * |
|
102 * @param aProtocolUid specifies Ecom implementation UID of |
|
103 * "Remote Contact Lookup Protocol Adaptation API" to use. |
|
104 * @param aMailBoxId mailbox id in plugin |
|
105 */ |
|
106 IMPORT_C void SetRCLInfo( const TUid aProtocolUid, const TUint aMailBoxId ); |
|
107 |
|
108 /* |
|
109 * Function to retrieve Remote Contact Lookup service context for |
|
110 * this mailbox. |
|
111 * |
|
112 * @param aProtocolUid specifies Ecom implementation UID of |
|
113 * "Remote Contact Lookup Protocol Adaptation API" to use. |
|
114 * @param aMailBoxId mailbox id in plugin |
|
115 */ |
|
116 IMPORT_C void GetRCLInfo( TUid& aProtocolUid, TUint& aAccountUid ); |
|
117 |
|
118 /** |
|
119 * returns settings view id for mailbox |
|
120 * |
|
121 * @return settings view id |
|
122 */ |
|
123 IMPORT_C const TUid GetSettingsUid(); |
|
124 |
|
125 /** |
|
126 * sets settings view id for mailbox |
|
127 * |
|
128 * @param aUid settings view id |
|
129 */ |
|
130 IMPORT_C void SetSettingsUid( const TUid aUid ); |
|
131 |
|
132 /** |
|
133 * Returns a meeting request info processor, which is used for replying |
|
134 * to meeting request received as MMRInfoObjet |
|
135 * |
|
136 * @return meeting info Processor, NULL if not supported by plugin |
|
137 * ownership not transferred |
|
138 */ |
|
139 IMPORT_C MMRInfoProcessor& MRInfoProcessorL(); |
|
140 |
|
141 /** |
|
142 * method to cheack if MRInfoProcessor is set |
|
143 * |
|
144 * @return |
|
145 */ |
|
146 IMPORT_C TBool IsMRInfoProcessorSet(); |
|
147 |
|
148 /** |
|
149 * Meeting request info processor mutator |
|
150 * |
|
151 * @param aMrInfoProcessor meeting info Processor, ownership transferred |
|
152 */ |
|
153 IMPORT_C void SetMRInfoProcessorL( MMRInfoProcessor* aMrInfoProcessor ); |
|
154 |
|
155 /** |
|
156 * mailbox own address accessor |
|
157 * |
|
158 * @return mailbox own address |
|
159 */ |
|
160 IMPORT_C CFSMailAddress& OwnMailAddress(); |
|
161 |
|
162 /** |
|
163 * mailbox own address mutator |
|
164 * |
|
165 * @param aOwnMailAddress mailbox own address |
|
166 */ |
|
167 IMPORT_C void SetOwnMailAddressL( CFSMailAddress* aOwnMailAddress ); |
|
168 |
|
169 /** |
|
170 * returns nmmailbox constructed with shared data, |
|
171 * ownership is transferred to caller |
|
172 */ |
|
173 // <qmail> |
|
174 IMPORT_C NmMailbox* GetNmMailbox(); |
|
175 // </qmail> |
|
176 |
|
177 protected: |
|
178 |
|
179 /** |
|
180 * C++ default constructor. |
|
181 */ |
|
182 CFSMailBoxBase(); |
|
183 |
|
184 /** |
|
185 * branding id accessor |
|
186 */ |
|
187 TDesC& BrandingId(); |
|
188 |
|
189 // <qmail> Removed SetMailBoxId </qmail> |
|
190 protected: // data |
|
191 |
|
192 protected: // <cmail> |
|
193 |
|
194 /** |
|
195 * Two-phased constructor |
|
196 */ |
|
197 void ConstructL( const TFSMailMsgId aMailBoxId ); |
|
198 |
|
199 private: // data |
|
200 |
|
201 /** |
|
202 * mailbox name |
|
203 */ |
|
204 HBufC* iMailBoxName; |
|
205 |
|
206 |
|
207 /** |
|
208 * remote contact lookup info |
|
209 */ |
|
210 TUid iProtocolUid; |
|
211 TUint iAccountUid; |
|
212 |
|
213 /** |
|
214 * settings uid |
|
215 */ |
|
216 TUid iSettingsUid; |
|
217 |
|
218 /** |
|
219 * Meeting request info |
|
220 */ |
|
221 MMRInfoProcessor* iMRInfoProcessor; |
|
222 |
|
223 /** |
|
224 * mailbox own address |
|
225 */ |
|
226 CFSMailAddress* iOwnMailAddress; |
|
227 |
|
228 /** |
|
229 * branding id |
|
230 */ |
|
231 HBufC* iBrId; |
|
232 |
|
233 /** |
|
234 * Reference to QT side of the mailbox object. |
|
235 */ |
|
236 // <qmail> |
|
237 QExplicitlySharedDataPointer<NmMailboxPrivate> iNmPrivateMailbox; |
|
238 // </qmail> |
|
239 |
|
240 /** |
|
241 * Copy to mailbox name. |
|
242 * Variable is mutable in order to maintain |
|
243 * binary compatibility in this API |
|
244 */ |
|
245 mutable TPtrC16 iTextPtr; |
|
246 |
|
247 // <qmail> Removed iMailBoxId </qmail> |
|
248 }; |
|
249 |
|
250 #endif // __CFSMAILBOXBASE_H |