screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/inc/snsrindicatorwidget.h
changeset 97 66b5fe3c07fd
parent 95 32e56106abf2
child 98 e6f74eb7f69f
equal deleted inserted replaced
95:32e56106abf2 97:66b5fe3c07fd
     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:  Indicator Widget.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SNSRINDICATORWIDGET_H
       
    19 #define SNSRINDICATORWIDGET_H
       
    20 
       
    21 #include <hbwidget.h>
       
    22 #include "snsrtest_global.h"
       
    23 
       
    24 SCREENSAVER_TEST_CLASS(T_SnsrIndicatorWidget)
       
    25 
       
    26 class HbIconItem;
       
    27 class SnsrIndicatorInfo;
       
    28 
       
    29 
       
    30 class SnsrIndicatorWidget: public HbWidget
       
    31 {
       
    32     Q_OBJECT
       
    33     
       
    34     Q_ENUMS(IndicatorLayoutType)
       
    35     Q_PROPERTY(IndicatorLayoutType layoutType READ layoutType WRITE setLayoutType)
       
    36    
       
    37 public:
       
    38     
       
    39     enum IndicatorLayoutType
       
    40     {
       
    41         IndicatorsAlignedLeft,
       
    42         IndicatorsCentered
       
    43     };
       
    44 
       
    45 public:
       
    46 
       
    47     explicit SnsrIndicatorWidget(QGraphicsItem *parent = 0);
       
    48     virtual ~SnsrIndicatorWidget();
       
    49     
       
    50     IndicatorLayoutType layoutType() const;
       
    51     void setLayoutType(IndicatorLayoutType type);
       
    52 
       
    53     void setPowerSaveModeColor(bool savemode);
       
    54 
       
    55 public slots:
       
    56     
       
    57     void showIndicators(const QList<SnsrIndicatorInfo> &indicators);
       
    58     void removeAllIndicators();
       
    59     
       
    60 private:
       
    61 
       
    62     virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
       
    63     void createPrimitives();
       
    64    
       
    65 private:
       
    66 
       
    67     QList<HbIconItem*> mIcons;   
       
    68     IndicatorLayoutType mLayoutType;
       
    69     bool mPowerSaveModeColor;
       
    70 
       
    71     Q_DISABLE_COPY(SnsrIndicatorWidget)
       
    72     SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrIndicatorWidget)
       
    73 };
       
    74 
       
    75 #endif // SNSRINDICATORWIDGET_H