email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/messagedataimpl.cpp
branchRCL_3
changeset 8 e1b6206813b4
equal deleted inserted replaced
4:e7aa27f58ae1 8:e1b6206813b4
       
     1 /*
       
     2 * Copyright (c) 2009 - 2010 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:  3rd party api testplugin message data
       
    15 *
       
    16 */
       
    17 
       
    18 #include <memaildata.h>
       
    19 #include <memailmessagedata.h>
       
    20 
       
    21 #include "messagedataimpl.h"
       
    22 
       
    23 // Hardcoded default values
       
    24 _LIT( KDefaultSender, "sender@domain.com" );
       
    25 _LIT( KDefaultSubject, "Test subject" );
       
    26 
       
    27 // ---------------------------------------------------------
       
    28 // ---------------------------------------------------------
       
    29 CMessageDataImpl* CMessageDataImpl::NewL()
       
    30     {
       
    31     CMessageDataImpl* self = new(ELeave) CMessageDataImpl();
       
    32     CleanupStack::PushL( self );
       
    33     self->ConstructL();
       
    34     CleanupStack::Pop( self );
       
    35     return self;
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------
       
    39 // ---------------------------------------------------------
       
    40 CMessageDataImpl::~CMessageDataImpl()
       
    41     {
       
    42     delete iSender;
       
    43     delete iSubject;
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // ---------------------------------------------------------
       
    48 CMessageDataImpl::CMessageDataImpl() : iSender( NULL ), iSubject( NULL ),
       
    49     iUnread( EFalse ), iPriority( EmailInterface::ENormal ), iAttachments( EFalse ), iCalendarMsg( EFalse ),
       
    50     iReplied( EFalse ), iForwarded( EFalse )
       
    51     {
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------
       
    55 // ---------------------------------------------------------
       
    56 void CMessageDataImpl::ConstructL()
       
    57     {
       
    58     iTimeStamp.HomeTime();
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------
       
    62 // ---------------------------------------------------------
       
    63 const TDesC& CMessageDataImpl::Sender() const
       
    64     {
       
    65     return KDefaultSender;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------
       
    69 // ---------------------------------------------------------
       
    70 const TDesC& CMessageDataImpl::Subject() const
       
    71     {
       
    72     return KDefaultSubject;
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------
       
    76 // ---------------------------------------------------------
       
    77 TTime CMessageDataImpl::TimeStamp() const
       
    78     {
       
    79     return iTimeStamp;
       
    80     }
       
    81 
       
    82 // ---------------------------------------------------------
       
    83 // ---------------------------------------------------------
       
    84 TBool CMessageDataImpl::Unread() const
       
    85     {
       
    86     return iUnread;
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // ---------------------------------------------------------
       
    91 EmailInterface::TEmailPriority CMessageDataImpl::Priority() const
       
    92     {
       
    93     return iPriority;
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------
       
    97 // ---------------------------------------------------------
       
    98 TBool CMessageDataImpl::Attachments() const
       
    99     {
       
   100     return iAttachments;
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------
       
   104 // ---------------------------------------------------------
       
   105 TBool CMessageDataImpl::CalendarMsg() const
       
   106     {
       
   107     return iCalendarMsg;
       
   108     }
       
   109 
       
   110 // ---------------------------------------------------------
       
   111 // ---------------------------------------------------------
       
   112 TBool CMessageDataImpl::Replied() const
       
   113     {
       
   114     return iReplied;
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------
       
   118 // ---------------------------------------------------------
       
   119 TBool CMessageDataImpl::Forwarded() const
       
   120     {
       
   121     return iForwarded;
       
   122     }