clock/clockui/clockwidget/inc/skinnableclock.h
changeset 45 b6db4fd4947b
parent 23 fd30d51f876b
child 46 ecd7b9840282
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:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef SKINNABLECLOCK_H
       
    19 #define SKINNABLECLOCK_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <hbwidget.h>
       
    23 #include <hbeffect.h>
       
    24 
       
    25 #include "clockwidgetdefines.h"
       
    26 
       
    27 class QTimer;
       
    28 class QEvent;
       
    29 class QGraphicsLinearLayout;
       
    30 class AnalogClock;
       
    31 class DigitalClock;
       
    32 class TimezoneClient;
       
    33 class SettingsUtility;
       
    34 
       
    35 class CLOCKWIDGET_EXPORT SkinnableClock : public HbWidget
       
    36 {
       
    37     Q_OBJECT
       
    38 
       
    39 public:
       
    40     SkinnableClock(QGraphicsItem *parent = 0);
       
    41     ~SkinnableClock();
       
    42 
       
    43 public:
       
    44     bool clockTypeAnalog();
       
    45     bool clockFormat24();
       
    46 
       
    47 public slots:
       
    48     void updateDisplay(bool newTimer = true);
       
    49     void updateClockType();
       
    50     void finishChangeType(const HbEffect::EffectStatus &status);
       
    51 
       
    52 protected:
       
    53 //	bool sceneEvent(QEvent *event);
       
    54 	void paint(QPainter *painter,
       
    55 			   const QStyleOptionGraphicsItem *option,
       
    56 			   QWidget *widget = 0);
       
    57 
       
    58 private:
       
    59     void setClockTypeAnalog(bool analog);
       
    60     void startChangeType();
       
    61 
       
    62 private:
       
    63     QTimer *mTickTimer;
       
    64     QGraphicsLinearLayout *mLayout;
       
    65 
       
    66     AnalogClock *mAnalogClock;
       
    67     DigitalClock *mDigitalClock;
       
    68     TimezoneClient *mClient;
       
    69     SettingsUtility *mSettingsUtility;
       
    70 
       
    71     bool mAnalog;
       
    72     bool mClockFormat24;
       
    73     bool mUpdateNeeded;
       
    74 };
       
    75 
       
    76 #endif // SKINNABLECLOCK_H
       
    77 
       
    78 // End of file