epoc32/include/mw/csendasaccounts.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 "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 //
    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__