calendarui/views/dayview/tsrc/unittests/unittest_calendayitem/caleninstanceid.h
changeset 57 bb2d3e476f29
equal deleted inserted replaced
55:2c54b51f39c4 57:bb2d3e476f29
       
     1 /*
       
     2 * Copyright (c) 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:  Mocked classes for testing CalenDayItem class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CALENINSTANCEID_H
       
    19 #define CALENINSTANCEID_H
       
    20 
       
    21 #include <agendaentry.h>
       
    22 
       
    23 /*!
       
    24  Mocked class TCalenInstanceId
       
    25  */
       
    26 class TCalenInstanceId
       
    27 {
       
    28 public:
       
    29     TCalenInstanceId() {
       
    30         
       
    31     }
       
    32     
       
    33     static TCalenInstanceId nullInstanceId() {
       
    34         return TCalenInstanceId();
       
    35     }
       
    36     
       
    37     static TCalenInstanceId create( const AgendaEntry& entry )
       
    38     {
       
    39         TCalenInstanceId id;
       
    40         id.mEntryLocalUid = entry.id();
       
    41         id.mInstanceTime = entry.startTime();
       
    42         id.mType = entry.type();
       
    43         return id;
       
    44     }
       
    45     
       
    46 public: // data members
       
    47     ulong mEntryLocalUid;
       
    48     QDateTime mInstanceTime;
       
    49     AgendaEntry::Type mType;
       
    50     bool mInstanceViewed;
       
    51 };
       
    52 
       
    53 #endif // CALENINSTANCEID_H
       
    54 
       
    55