screensaver/screensaverplugins/snsrbigclockscreensaverplugin/snsrindicatorwidget/inc/snsrindicatorwidget.h
changeset 62 341166945d65
child 86 e4f038c420f7
equal deleted inserted replaced
57:2e2dc3d30ca8 62:341166945d65
       
     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 public slots:
       
    54     
       
    55     void showIndicators(const QList<SnsrIndicatorInfo> &indicators);
       
    56     void removeAllIndicators();
       
    57     
       
    58 private:
       
    59 
       
    60     virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
       
    61     void createPrimitives();
       
    62    
       
    63 private:
       
    64 
       
    65     QList<HbIconItem*> mIcons;   
       
    66     IndicatorLayoutType mLayoutType;
       
    67 
       
    68     Q_DISABLE_COPY(SnsrIndicatorWidget)
       
    69     SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrIndicatorWidget)
       
    70 };
       
    71 
       
    72 #endif // SNSRINDICATORWIDGET_H