homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsanalogclockwidget.h
changeset 35 f9ce957a272c
child 39 4e8ebe173323
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     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:  Clock widget
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HSANALOGCLOCKWIDGET_H
       
    19 #define HSANALOGCLOCKWIDGET_H
       
    20 
       
    21 #include <QGraphicsSvgItem>
       
    22 #include <hbwidget.h>
       
    23 #include "hsanalogclockstyleoption.h"
       
    24 #include <hstest_global.h>
       
    25 
       
    26 HOMESCREEN_TEST_CLASS(TestClockWidget)
       
    27 
       
    28 class HsAnalogClockWidget : public HbWidget
       
    29 {
       
    30     Q_OBJECT
       
    31 
       
    32 public:
       
    33 
       
    34     explicit HsAnalogClockWidget(const QString &stylePluginName = QString(), QGraphicsItem *parent = 0);
       
    35     virtual ~HsAnalogClockWidget();
       
    36 
       
    37 public slots:
       
    38 
       
    39     void tick();
       
    40 
       
    41 protected:
       
    42 
       
    43     void resizeEvent(QGraphicsSceneResizeEvent *event);
       
    44     void polish(HbStyleParameters& params);
       
    45 
       
    46 private:
       
    47 
       
    48     void createPrimitives();
       
    49     void updatePrimitives();
       
    50 
       
    51 private:
       
    52 
       
    53     QGraphicsItem *mClockBackground;
       
    54     QGraphicsItem *mClockHourHand;
       
    55     QGraphicsItem *mClockMinuteHand;
       
    56     
       
    57     QString mStylePluginName;
       
    58 
       
    59     Q_DISABLE_COPY(HsAnalogClockWidget)
       
    60 
       
    61     HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget)
       
    62 
       
    63 };
       
    64 
       
    65 
       
    66 
       
    67 
       
    68 #endif