meetingrequest/mrgui/src/cesmrlocationhistoryitem.cpp
branchRCL_3
changeset 25 3533d4323edc
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Location history item class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include "cesmrlocationhistoryitem.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // CESMRLocationHistoryItem::NewL
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 CESMRLocationHistoryItem* CESMRLocationHistoryItem::NewL(
       
    29         const TUint aId,
       
    30         const TDesC& aAddress, 
       
    31         const TDesC& aUrl )
       
    32     {
       
    33     FUNC_LOG;
       
    34     CESMRLocationHistoryItem* object = CESMRLocationHistoryItem::NewLC( aId, aAddress, aUrl );
       
    35     CleanupStack::Pop( object );
       
    36     return object;
       
    37     }
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CESMRLocationHistoryItem::NewLC
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CESMRLocationHistoryItem* CESMRLocationHistoryItem::NewLC(
       
    44         const TUint aId,
       
    45         const TDesC& aAddress, 
       
    46         const TDesC& aUrl )
       
    47     {
       
    48     FUNC_LOG;
       
    49     CESMRLocationHistoryItem* object = new (ELeave) CESMRLocationHistoryItem( aId );
       
    50     CleanupStack::PushL( object );
       
    51     object->ConstructL( aAddress, aUrl );
       
    52     return object;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CESMRLocationHistoryItem::~CESMRLocationHistoryItem
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CESMRLocationHistoryItem::~CESMRLocationHistoryItem()
       
    60     {
       
    61     FUNC_LOG;
       
    62     delete iAddress;
       
    63     delete iUrl;
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CESMRLocationHistoryItem::::SetAddressL
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 void CESMRLocationHistoryItem::SetAddressL( const TDesC& aAddress )
       
    71     {
       
    72     FUNC_LOG;
       
    73     HBufC* temp = aAddress.AllocL();
       
    74     delete iAddress;
       
    75     iAddress = temp;
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CESMRLocationHistoryItem::SetUrlL
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void CESMRLocationHistoryItem::SetUrlL( const TDesC& aUrl )
       
    83     {
       
    84     FUNC_LOG;
       
    85     HBufC* temp = aUrl.AllocL();
       
    86     delete iUrl;
       
    87     iUrl = temp;
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CESMRLocationHistoryItem::Address
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 const TDesC& CESMRLocationHistoryItem::Address() const
       
    95     {
       
    96     FUNC_LOG;
       
    97     return *iAddress;
       
    98     }
       
    99     
       
   100 // -----------------------------------------------------------------------------
       
   101 // CESMRLocationHistoryItem::Url
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 const TDesC& CESMRLocationHistoryItem::Url() const
       
   105     {
       
   106     FUNC_LOG;
       
   107     return *iUrl;
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CESMRLocationHistoryItem::Id
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 TUint CESMRLocationHistoryItem::Id() const
       
   115     {
       
   116     FUNC_LOG;
       
   117     return iId;
       
   118     }
       
   119 
       
   120 // -----------------------------------------------------------------------------
       
   121 // CESMRLocationHistoryItem::CESMRLocationHistoryItem
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 CESMRLocationHistoryItem::CESMRLocationHistoryItem( const TUint aId ) :
       
   125     iId( aId )
       
   126     {
       
   127     FUNC_LOG;
       
   128     }
       
   129 
       
   130 // -----------------------------------------------------------------------------
       
   131 // CESMRLocationHistoryItem::ConstructL
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 void CESMRLocationHistoryItem::ConstructL( const TDesC& aAddress, 
       
   135                                            const TDesC& aUrl )
       
   136     {
       
   137     FUNC_LOG;
       
   138     iAddress = aAddress.AllocL();
       
   139     iUrl = aUrl.AllocL();
       
   140     }
       
   141 
       
   142 // EOF
       
   143