screensaver/snsrplugins/snsrbigclockscreensaverplugin/snsrindicators/inc/snsrindicatorwidget.h
author hgs
Wed, 06 Oct 2010 16:06:24 +0300
changeset 97 66b5fe3c07fd
child 98 e6f74eb7f69f
permissions -rw-r--r--
201039_01

/*
* Copyright (c) 2010 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:  Indicator Widget.
*
*/

#ifndef SNSRINDICATORWIDGET_H
#define SNSRINDICATORWIDGET_H

#include <hbwidget.h>
#include "snsrtest_global.h"

SCREENSAVER_TEST_CLASS(T_SnsrIndicators)

class HbIconItem;
class SnsrIndicatorInfo;


class SnsrIndicatorWidget: public HbWidget
{
    Q_OBJECT
    
    Q_ENUMS(IndicatorLayoutType)
    Q_PROPERTY(IndicatorLayoutType layoutType READ layoutType WRITE setLayoutType)
   
public:
    
    enum IndicatorLayoutType
    {
        IndicatorsAlignedLeft,
        IndicatorsCentered
    };
    
    enum IconColorType
    {
        ThemedColorForActiveMode,
        FixedColorForPowerSaveMode
    };

public:

    explicit SnsrIndicatorWidget(QGraphicsItem *parent = 0);
    virtual ~SnsrIndicatorWidget();
    
    IndicatorLayoutType layoutType() const;
    void setLayoutType(IndicatorLayoutType type);

    void setIconColorType(const IconColorType &colorType);

public slots:
    
    void showIndicators(const QList<SnsrIndicatorInfo> &indicators);
    void removeAllIndicators();
    
protected:

    virtual void changeEvent(QEvent *event);
    
private:

    virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
    void createPrimitives();
   
private:

    QList<HbIconItem*> mIcons;   
    IndicatorLayoutType mLayoutType;
    IconColorType mIconColorType;
    QColor mIconColor;
    
    Q_DISABLE_COPY(SnsrIndicatorWidget)
    SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrIndicators)
};

#endif // SNSRINDICATORWIDGET_H