homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsclockwidget.h
changeset 46 23b5d6a29cce
parent 39 4e8ebe173323
child 51 4785f57bf3d4
equal deleted inserted replaced
39:4e8ebe173323 46:23b5d6a29cce
    16 */
    16 */
    17 
    17 
    18 #ifndef HSCLOCKWIDGET_H
    18 #ifndef HSCLOCKWIDGET_H
    19 #define HSCLOCKWIDGET_H
    19 #define HSCLOCKWIDGET_H
    20 
    20 
    21 #include <QGraphicsSvgItem>
    21 #include <HbWidget>
    22 #include <QTime>
    22 
    23 #include <QWidget>
       
    24 #include <QGraphicsWidget>
       
    25 #include <QImage>
       
    26 #include <hbwidget.h>
       
    27 #include <hstest_global.h>
    23 #include <hstest_global.h>
    28 
    24 
    29 HOMESCREEN_TEST_CLASS(TestClockWidget)
    25 HOMESCREEN_TEST_CLASS(TestClockWidget)
    30 
    26 
    31 class HbWidget;
    27 class HbWidget;
    32 class QGraphicsLinearLayout;
    28 class QGraphicsLinearLayout;
       
    29 #ifdef Q_OS_SYMBIAN
       
    30 class HsClockSettingsNotifier;
       
    31 #endif //Q_OS_SYMBIAN
    33 
    32 
    34 class HsClockWidget : public HbWidget
    33 class HsClockWidget : public HbWidget
    35 {
    34 {
    36     Q_OBJECT
    35     Q_OBJECT
    37     Q_PROPERTY(QString clockType READ clockType WRITE setClockType)
    36     
    38 
       
    39 public:
    37 public:
    40 
       
    41     HsClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
    38     HsClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
    42     ~HsClockWidget();
    39     ~HsClockWidget();
    43 
    40 
    44     QString clockType() const;
    41 signals:
    45     void setClockType(const QString &type);
    42     void setPreferences(const QStringList &names);
    46 
    43 
    47 public slots:
    44 public slots:
    48 
       
    49     void onInitialize();
    45     void onInitialize();
    50     void onShow();
    46     void onShow();
    51     void onHide();
    47     void onHide();
    52     void onUninitialize();
    48     void onUninitialize();
    53 
    49 
    54     void updateTime();
    50     void updateTime();
    55     void onTypeChanged(QString type);
    51     void onSettingsChanged(const QString &clockFormat, const QString &timeFormat);
    56     
    52     void onClockTapped();
    57 signals:
       
    58     void setPreferences(const QStringList &names);
       
    59 
       
    60 protected:
       
    61 
       
    62     void mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) }
       
    63     void mouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent);
       
    64 
    53 
    65 private:
    54 private:
    66     void toggleClockType();
    55     Q_DISABLE_COPY(HsClockWidget)
    67     HbWidget *loadClockWidget();
    56     HbWidget *loadClockWidget();
    68 
    57 
    69 private:
    58 private:
    70 
    59     HbWidget *mWidget;
       
    60     QGraphicsLinearLayout *mLayout;
    71     QTimer *mTimer;
    61     QTimer *mTimer;
    72     QString mClockType;
    62     QString mClockType;
    73     HbWidget *mWidget;
    63     QString mTimeType;        
    74     QGraphicsLinearLayout *mLayout;
    64 #ifdef Q_OS_SYMBIAN
    75     bool mWidgetShown;
    65     HsClockSettingsNotifier *mClockSettingsNotifier;
    76 
    66 #endif //Q_OS_SYMBIAN
    77     Q_DISABLE_COPY(HsClockWidget)
    67     
    78 
       
    79     HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget)
    68     HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget)
    80 
       
    81 };
    69 };
    82 
    70 
    83 
       
    84 
       
    85 
       
    86 #endif
    71 #endif