homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsdigitalclockwidget.h
branchRCL_3
changeset 82 5f0182e07bfb
equal deleted inserted replaced
79:f00a6757af32 82:5f0182e07bfb
       
     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:  Homescreen themable clock label.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HSDIGITALCLOCKWIDGET_H
       
    19 #define HSDIGITALCLOCKWIDGET_H
       
    20 
       
    21 #include <HbWidget>
       
    22 
       
    23 #include <hstest_global.h>
       
    24 
       
    25 HOMESCREEN_TEST_CLASS(TestClockWidget)
       
    26 
       
    27 class HbFrameItem;
       
    28 class HbIconItem;
       
    29 class QGestureEvent;
       
    30 
       
    31 class HsDigitalClockWidget : public HbWidget
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:
       
    36     explicit HsDigitalClockWidget(bool useAmPm = true, QGraphicsItem *parent = 0);
       
    37     ~HsDigitalClockWidget();
       
    38 
       
    39     QPainterPath shape() const;
       
    40 signals:
       
    41     void clockTapped();
       
    42 
       
    43 public slots:
       
    44     void tick();
       
    45     void setAmPm(bool useAmPm);
       
    46 
       
    47 protected:
       
    48     void resizeEvent(QGraphicsSceneResizeEvent *event);
       
    49     void gestureEvent(QGestureEvent *event);
       
    50 
       
    51 private:
       
    52     Q_DISABLE_COPY(HsDigitalClockWidget)
       
    53     void createPrimitives();
       
    54     void updatePrimitives();
       
    55 
       
    56 private:
       
    57     HbFrameItem *mBackground;
       
    58     HbIconItem *mDigit1;
       
    59     HbIconItem *mDigit2;
       
    60     HbIconItem *mDigit3;
       
    61     HbIconItem *mDigit4;
       
    62     HbIconItem *mDigit5;
       
    63     HbIconItem *mDigit6;
       
    64     HbIconItem *mAmPm;
       
    65     bool mUseAmPm;
       
    66     QMap<QChar, QString> mDigitMap;
       
    67     
       
    68     HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget)
       
    69 };
       
    70 
       
    71 #endif // HSDIGITALCLOCKWIDGET_H