calendarui/views/dayview/tsrc/unittests/unittest_calendaymodel/calenservices.h
changeset 45 b6db4fd4947b
child 81 ce92091cbd61
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
       
     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: Mocked classes for testing CalenDayModel class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef AGENDAUTIL_H
       
    19 #define AGENDAUTIL_H
       
    20 
       
    21 #include <agendaentry.h>
       
    22 
       
    23 /*!
       
    24  Mocked class AgendaUtil
       
    25  */
       
    26 class AgendaUtil
       
    27 {
       
    28 public:
       
    29     enum FilterFlags {
       
    30         IncludeAppointments = 0x01, 
       
    31         IncludeReminders = 0x02,
       
    32         IncludeEvents = 0x03
       
    33     };
       
    34 
       
    35 public:
       
    36     AgendaUtil() {
       
    37 
       
    38     }
       
    39 
       
    40     ~AgendaUtil() {
       
    41 
       
    42     }
       
    43     
       
    44     QList<AgendaEntry> createEntryIdListForDay(const QDateTime &date,AgendaUtil::FilterFlags filter)
       
    45     {
       
    46         QList<AgendaEntry> agenda;
       
    47         AgendaEntry entry;
       
    48         agenda << entry;
       
    49         return agenda;
       
    50     }
       
    51 };
       
    52 
       
    53 #endif // AGENDAUTIL_H
       
    54 
       
    55 #ifndef CALENSERVICES_H
       
    56 #define CALENSERVICES_H
       
    57 
       
    58 /*!
       
    59  Mocked class MCalenServices
       
    60  */
       
    61 class MCalenServices
       
    62 {
       
    63 public:
       
    64     MCalenServices() : mAgendaUtil(NULL) {
       
    65         mAgendaUtil = new AgendaUtil();
       
    66     }
       
    67     
       
    68     ~MCalenServices() {
       
    69         if (mAgendaUtil) {
       
    70             delete mAgendaUtil;
       
    71             mAgendaUtil = NULL;
       
    72         }
       
    73     }
       
    74     
       
    75     AgendaUtil* agendaInterface() {
       
    76         return mAgendaUtil;
       
    77     }
       
    78     
       
    79 public:
       
    80     AgendaUtil* mAgendaUtil;
       
    81 };
       
    82 
       
    83 #endif // CALENSERVICES_H
       
    84 
       
    85 // End of file
       
    86