clock/clockui/clockwidget/clockwidgetimpl/inc/digitalclockwidget.h
changeset 45 b6db4fd4947b
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
       
     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:  DigitalClockWidget
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DIGITALCLOCKWIDGET_H
       
    19 #define DIGITALCLOCKWIDGET_H
       
    20 
       
    21 // System includes
       
    22 #include <HbWidget>
       
    23 #include <QPointer>
       
    24 
       
    25 // User includes
       
    26 #include "clockwidgetdefines.h"
       
    27 
       
    28 // Forward declarations
       
    29 class QTimer;
       
    30 class HbLabel;
       
    31 class HbTextItem;
       
    32 
       
    33 class DigitalClockWidget : public HbWidget
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37 public:
       
    38      DigitalClockWidget(bool useAmPm = true, QGraphicsItem *parent = 0);
       
    39     ~DigitalClockWidget();
       
    40 
       
    41 signals:
       
    42     void clockTapped();
       
    43 
       
    44 public slots:
       
    45     void tick();
       
    46     void setAmPm(bool useAmPm);
       
    47 
       
    48 protected:
       
    49     void resizeEvent(QGraphicsSceneResizeEvent *event);
       
    50 
       
    51 private:
       
    52     void createPrimitives();
       
    53 
       
    54 public:
       
    55     void updatePrimitives();
       
    56 
       
    57 private:
       
    58     QPointer<QTimer>        mTimer;
       
    59     QPointer<HbTextItem>    mClockLabel;
       
    60     QPointer<HbTextItem>    mAmPmLabel;
       
    61     bool                    mUseAmPm;
       
    62 };
       
    63 
       
    64 #endif // DIGITALCLOCKWIDGET_H