meetingrequestengines/mrmailbox/src/cmrmailboxinfo.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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: Provides class methods for containing information for a mailbox. 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "cmrmailboxinfo.h"
       
    21 
       
    22 
       
    23 // Unnamed namespace for local definitions
       
    24 namespace
       
    25 {
       
    26 }  // namespace
       
    27 
       
    28 // ========================= MEMBER FUNCTIONS ================================
       
    29 
       
    30 
       
    31 // ----------------------------------------------------------------------------
       
    32 // CMRMailBoxInfo::CMRMailBoxInfo
       
    33 // Default constructor
       
    34 // ----------------------------------------------------------------------------
       
    35 //
       
    36 CMRMailBoxInfo::CMRMailBoxInfo(
       
    37     TUid aMtmUid,
       
    38     TMsvId aEntryId )
       
    39     : iMtmUid( aMtmUid ),
       
    40       iEntryId( aEntryId )
       
    41     {
       
    42     }
       
    43 
       
    44 // ----------------------------------------------------------------------------
       
    45 // CMRMailBoxInfo::~CMRMailBoxInfo
       
    46 // Destructor.
       
    47 // ----------------------------------------------------------------------------
       
    48 //
       
    49 EXPORT_C CMRMailBoxInfo::~CMRMailBoxInfo()
       
    50     {
       
    51     delete iMailBoxName;    
       
    52     delete iEmailAddress;
       
    53     }
       
    54 
       
    55 // ----------------------------------------------------------------------------
       
    56 // CMRMailBoxInfo::NewL
       
    57 // Symbian two-phased constructor.
       
    58 // (other items were commented in a header).
       
    59 // ----------------------------------------------------------------------------
       
    60 EXPORT_C CMRMailBoxInfo* CMRMailBoxInfo::NewL(
       
    61     const TDesC& aName,
       
    62     const TDesC& aAddress,
       
    63     TUid aMtmUid,
       
    64     TMsvId aEntryId )
       
    65 	{
       
    66 	CMRMailBoxInfo* self = new( ELeave ) CMRMailBoxInfo( aMtmUid, aEntryId );
       
    67 	CleanupStack::PushL( self );
       
    68 	self->ConstructL( aName, aAddress );
       
    69 	CleanupStack::Pop();
       
    70 	return self;
       
    71 	}
       
    72 
       
    73 // ----------------------------------------------------------------------------
       
    74 // CMRMailBoxInfo::ConstructL
       
    75 // 2nd phase constructor.
       
    76 // ----------------------------------------------------------------------------
       
    77 //
       
    78 void CMRMailBoxInfo::ConstructL(    
       
    79     const TDesC& aName,
       
    80     const TDesC& aAddress )
       
    81     {
       
    82     iMailBoxName = aName.AllocL();        
       
    83     iEmailAddress = aAddress.AllocL();
       
    84     }
       
    85 
       
    86 // ----------------------------------------------------------------------------
       
    87 // CMRMailBoxInfo::MtmUid
       
    88 // ----------------------------------------------------------------------------
       
    89 //    
       
    90 EXPORT_C TUid CMRMailBoxInfo::MtmUid() const
       
    91     {
       
    92     return iMtmUid;    
       
    93     }
       
    94 
       
    95 // ----------------------------------------------------------------------------
       
    96 // CMRMailBoxInfo::EntryId
       
    97 // ----------------------------------------------------------------------------
       
    98 //    
       
    99 EXPORT_C TMsvId CMRMailBoxInfo::EntryId() const
       
   100     {
       
   101     return iEntryId;    
       
   102     }
       
   103     
       
   104 // ----------------------------------------------------------------------------
       
   105 // CMRMailBoxInfo::Address
       
   106 // ----------------------------------------------------------------------------
       
   107 //
       
   108 EXPORT_C TPtrC CMRMailBoxInfo::Address() const
       
   109     {
       
   110     return *iEmailAddress;    
       
   111     }
       
   112     
       
   113 // ----------------------------------------------------------------------------
       
   114 // CMRMailBoxInfo::Name
       
   115 // ----------------------------------------------------------------------------
       
   116 //
       
   117 EXPORT_C TPtrC CMRMailBoxInfo::Name() const 
       
   118     {
       
   119     return *iMailBoxName;
       
   120     }
       
   121     
       
   122 // End of file