1 csendasaccounts.h |
1 // Copyright (c) 2004-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CSENDASACCOUNTS_H__ |
|
17 #define __CSENDASACCOUNTS_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <badesca.h> |
|
21 #include <msvstd.h> |
|
22 |
|
23 // Forward declarations |
|
24 class RReadStream; |
|
25 class RWriteStream; |
|
26 |
|
27 /** |
|
28 Identifies accounts for use by SendAs. |
|
29 |
|
30 @publishedAll |
|
31 @released |
|
32 */ |
|
33 typedef TMsvId TSendAsAccount; |
|
34 |
|
35 /** |
|
36 Provides human-readable names and IDs for the list of accounts for a given |
|
37 message type. |
|
38 |
|
39 @publishedAll |
|
40 @released |
|
41 */ |
|
42 class CSendAsAccounts : public CBase |
|
43 { |
|
44 public: |
|
45 IMPORT_C static CSendAsAccounts* NewL(); |
|
46 IMPORT_C virtual ~CSendAsAccounts(); |
|
47 |
|
48 IMPORT_C TUid MessageType() const; |
|
49 IMPORT_C void SetMessageType(TUid aMessageType); |
|
50 |
|
51 IMPORT_C const MDesCArray& AccountNames() const; |
|
52 IMPORT_C TSendAsAccount Account(TInt aIndex) const; |
|
53 IMPORT_C TPtrC NameFromAccountL(const TSendAsAccount aAccount) const; |
|
54 IMPORT_C TSendAsAccount AccountFromNameL(const TDesC& aName) const; |
|
55 IMPORT_C TInt Count() const; |
|
56 IMPORT_C void Reset(); |
|
57 |
|
58 IMPORT_C void InternalizeL(RReadStream& aReadStream); |
|
59 IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const; |
|
60 |
|
61 IMPORT_C void AppendAccountL(const TDesC& aAccountName, TSendAsAccount aAccount); |
|
62 IMPORT_C void RemoveAccount(TInt aIndex); |
|
63 IMPORT_C TInt Size() const; |
|
64 |
|
65 private: |
|
66 CSendAsAccounts(); |
|
67 void ConstructL(); |
|
68 |
|
69 private: |
|
70 TUid iMessageType; |
|
71 CDesCArrayFlat* iAccountNames; |
|
72 RArray<TSendAsAccount> iAccounts; |
|
73 }; |
|
74 |
|
75 #endif // __CSENDASACCOUNTS_H__ |