calendarui/views/dayview/tsrc/unittests/unittest_calendayhourscrollarea/calendayhourelement.h
changeset 81 ce92091cbd61
equal deleted inserted replaced
75:7ac58b2aae6f 81:ce92091cbd61
       
     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 class CalenDayHourElement
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CALENDAYHOURELEMENT_H
       
    19 #define CALENDAYHOURELEMENT_H
       
    20 
       
    21 // System includes
       
    22 #include <QTime>
       
    23 #include <HbWidget>
       
    24 
       
    25 // Test variables
       
    26 extern bool gTestLocaleChanged;
       
    27 extern bool gTestUpdatePerformed;
       
    28 
       
    29 // Mocked class
       
    30 class CalenDayHourElement : public HbWidget
       
    31 {
       
    32 Q_OBJECT
       
    33 
       
    34 public:
       
    35 
       
    36     CalenDayHourElement(const QTime &time, QGraphicsItem *parent = 0) : HbWidget(parent) {
       
    37         mHour = time;
       
    38     }
       
    39     virtual ~CalenDayHourElement() {
       
    40         
       
    41     }
       
    42 
       
    43     void paint(
       
    44         QPainter * painter,
       
    45         const QStyleOptionGraphicsItem * option,
       
    46         QWidget * widget) {
       
    47         Q_UNUSED(painter)
       
    48         Q_UNUSED(option)
       
    49         Q_UNUSED(widget)
       
    50     }
       
    51 
       
    52     void setTime(const QTime &time) {
       
    53         mHour = time;
       
    54     }
       
    55     
       
    56     QTime time() const {
       
    57         return mHour;
       
    58     }
       
    59     
       
    60     void update(const QRectF &rect = QRectF()) {
       
    61         Q_UNUSED(rect)
       
    62         gTestUpdatePerformed = true;
       
    63     }
       
    64     
       
    65 public slots:
       
    66     void localeChanged() {
       
    67         gTestLocaleChanged = true;
       
    68     }
       
    69 
       
    70 private:
       
    71     QTime mHour;
       
    72 };
       
    73 
       
    74 #endif // CALENDAYHOURELEMENT_H