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