homescreenapp/widgetplugins/hsclockwidgetplugin/inc/hsclockwidget.h
author hgs
Fri, 25 Jun 2010 19:19:22 +0300
changeset 62 341166945d65
parent 51 4785f57bf3d4
child 81 7dd137878ff8
permissions -rw-r--r--
201025

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Clock widget
*
*/

#ifndef HSCLOCKWIDGET_H
#define HSCLOCKWIDGET_H

#include <HbWidget>

#include <hstest_global.h>

HOMESCREEN_TEST_CLASS(TestClockWidget)

class HbWidget;
class QGraphicsLinearLayout;
#ifdef Q_OS_SYMBIAN
class HsClockSettingsNotifier;
#endif //Q_OS_SYMBIAN

class HsClockWidget : public HbWidget
{
    Q_OBJECT
    
public:
    HsClockWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
    ~HsClockWidget();

    QPainterPath shape() const;
public slots:
    void onInitialize();
    void onShow();
    void onHide();
    void onUninitialize();

    void updateTime();
    void onSettingsChanged(const QString &clockFormat, const QString &timeFormat);
    void onClockTapped();

private:
    Q_DISABLE_COPY(HsClockWidget)
    HbWidget *loadClockWidget();

private:
    HbWidget *mWidget;
    QGraphicsLinearLayout *mLayout;
    QTimer *mTimer;
    QString mClockType;
    QString mTimeType;        
#ifdef Q_OS_SYMBIAN
    HsClockSettingsNotifier *mClockSettingsNotifier;
#endif //Q_OS_SYMBIAN
    
    HOMESCREEN_TEST_FRIEND_CLASS(TestClockWidget)
};

#endif