clock/clockui/clockwidget/clockwidgetimpl/inc/clockwidget.h
changeset 50 579cc610882e
parent 26 a949c2543c15
equal deleted inserted replaced
49:5de72ea7a065 50:579cc610882e
    18 #ifndef CLOCKWIDGET_H
    18 #ifndef CLOCKWIDGET_H
    19 #define CLOCKWIDGET_H
    19 #define CLOCKWIDGET_H
    20 
    20 
    21 // System includes
    21 // System includes
    22 #include <hbwidget.h>
    22 #include <hbwidget.h>
    23 
    23 #include <QPointer>
    24 // User includes
    24 // User includes
    25 #include "clockwidgetdefines.h"
    25 #include "clockwidgetdefines.h"
    26 
    26 
    27 //Forward declarations
    27 //Forward declarations
    28 
    28 
    29 class QGraphicsLinearLayout;
    29 class QGraphicsLinearLayout;
    30 class AnalogClockWidget;
    30 class AnalogClockWidget;
       
    31 class DigitalClockWidget;
    31 
    32 
    32 class CLOCKWIDGET_EXPORT  ClockWidget : public HbWidget
    33 class CLOCKWIDGET_EXPORT  ClockWidget : public HbWidget
    33 {
    34 {
    34     Q_OBJECT
    35     Q_OBJECT
    35     Q_PROPERTY(ClockType clockType READ clockType WRITE setClockType)
    36     Q_PROPERTY(ClockType clockType READ clockType WRITE setClockType)
       
    37 	Q_PROPERTY(TimeFormat timeFormat READ timeFormat WRITE setTimeFormat)
    36 
    38 
    37 public:
    39 public:
    38     enum ClockType
    40     enum ClockType
    39     {
    41     {
    40         ClockTypeAnalog,
    42         ClockTypeAnalog,
    41         ClockTypeDigital
    43         ClockTypeDigital
    42     };
    44     };
       
    45 	enum TimeFormat
       
    46 	{
       
    47 		TimeFormat12Hrs,
       
    48 		TimeFormat24Hrs
       
    49 	};
    43 
    50 
    44     ClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
    51     ClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
    45     ~ClockWidget();
    52     ~ClockWidget();
    46     ClockType clockType() const;
    53     ClockType clockType() const;
    47     void setClockType(const ClockType &type);
    54     void setClockType(const ClockType &type);
    48     void loadClockWidget();
    55     void loadClockWidget();
       
    56     TimeFormat timeFormat() const;
       
    57 	void setTimeFormat(const TimeFormat &timeFormat);
    49 
    58 
    50 public slots:
    59 public slots:
    51     void updateTime();
    60     void updateTime();
    52     
    61     
    53 private:
    62 private:
    54     ClockType mClockType;
    63     void updateClockWidget();
    55     AnalogClockWidget *mAnalogClock;
    64 private:
    56     QGraphicsLinearLayout *mLayout;
    65     ClockType                       mClockType;
       
    66     TimeFormat                      mTimeFormat;
       
    67     QPointer<AnalogClockWidget>     mAnalogClock;
       
    68     QPointer<DigitalClockWidget>    mDigitalClock;
       
    69     QGraphicsLinearLayout           *mLayout;
    57 };
    70 };
    58 
    71 
    59 #endif // CLOCKWIDGET_H
    72 #endif // CLOCKWIDGET_H
    60 
    73 
    61 // End of file  --Don't remove this.
    74 // End of file  --Don't remove this.