emailservices/emailstore/message_store/client/api/MsgStoreAddress.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Message store address.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __MSG_STORE_ADDRESS_H__
       
    21 #define __MSG_STORE_ADDRESS_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 //<cmail>
       
    25 #include "MsgStoreTypes.h"
       
    26 //</cmail>
       
    27 
       
    28 /** Simple convinent on-stack class to encapsulate the {email address, display name} pair used
       
    29  *  as address fields (From, Sender, To, Cc, Bcc) in a message.
       
    30  */    
       
    31 class RMsgStoreAddress
       
    32     {
       
    33     public:
       
    34         /**
       
    35          * Close() must be called before this object goes out of scope
       
    36          */
       
    37         IMPORT_C void Close();
       
    38         
       
    39         RBuf    iEmailAddress;
       
    40         RBuf    iDisplayName;
       
    41     };
       
    42 
       
    43 /** Simple convinent on-heap class to encapsulate the {email address, display name} pair used
       
    44  *  as address fields (From, Sender, To, Cc, Bcc) in a message.
       
    45  * 
       
    46  *  This class is created because on-stack class RMsgStoreAddress does not work very well
       
    47  *  when the caller is expecting an ARRAY of ADDRESS to be returned.
       
    48  */    
       
    49 class CMsgStoreAddress : public CBase
       
    50     {
       
    51     public:
       
    52         IMPORT_C static CMsgStoreAddress* NewL( const TDesC& aEmailAddress, const TDesC& aDisplayName );
       
    53         IMPORT_C virtual ~CMsgStoreAddress();
       
    54         
       
    55         IMPORT_C const TDesC& EmailAddress();
       
    56         IMPORT_C const TDesC& DisplayName();
       
    57         
       
    58     private:
       
    59         CMsgStoreAddress( );
       
    60         void ConstructL( const TDesC& aEmailAddress, const TDesC& aDisplayName );
       
    61 
       
    62     private:
       
    63         RBuf    iEmailAddress;
       
    64         RBuf    iDisplayName;
       
    65     };
       
    66 
       
    67 #endif  // __MSG_STORE_ADDRESS_H__