phonesettings/cpphonesettingsplugins/divertplugin/src/cpdivertselectioncustomitem.h
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 40 bab96b7ed1a4
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
     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:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CPDIVERTSELECTIONCUSTOMITEM_H
       
    19 #define CPDIVERTSELECTIONCUSTOMITEM_H
       
    20 
       
    21 #include <hbwidget.h>
       
    22 
       
    23 class QGraphicsGridLayout;
       
    24 class HbCheckBox;
       
    25 class HbLabel;
       
    26 
       
    27 class CpDivertSelectionCustomitem : public HbWidget
       
    28 {
       
    29     Q_OBJECT
       
    30     Q_PROPERTY(QString number READ number WRITE setNumber)
       
    31     Q_PROPERTY(QString timeoutText READ timeoutText WRITE setTimeoutText)
       
    32     Q_PROPERTY(int timeout READ timeout WRITE setTimeout)
       
    33     Q_PROPERTY(int state READ state WRITE setState)
       
    34 
       
    35 public:    
       
    36     enum State {
       
    37         /** Divert is registered and activated.*/
       
    38         Enabled,
       
    39         /** Divert is registered but inactive.*/
       
    40         Deactivated,
       
    41         /** Divert is not registered.*/
       
    42         Disabled
       
    43     };
       
    44 
       
    45 public:
       
    46     CpDivertSelectionCustomitem(
       
    47             QGraphicsItem *parent=0,
       
    48             Qt::WindowFlags wFlags=0);
       
    49 
       
    50     ~CpDivertSelectionCustomitem();
       
    51 
       
    52     const QString number() const;
       
    53 
       
    54     void setNumber( const QString& number );
       
    55 
       
    56     int timeout() const;
       
    57 
       
    58     void setTimeout( int timeout);
       
    59 
       
    60     const QString timeoutText() const;
       
    61 
       
    62     void setTimeoutText( const QString& text );
       
    63     
       
    64     int state() const;
       
    65 
       
    66     void setState( int state);
       
    67     
       
    68 signals:
       
    69     void clicked();
       
    70 
       
    71 private:
       
    72     void removeItemFromLayout( QGraphicsWidget* item );
       
    73     void updateCheckState();
       
    74 
       
    75 private:
       
    76     QGraphicsGridLayout *layout;
       
    77     HbCheckBox *checkbox;
       
    78     HbLabel *timeoutLabel;
       
    79     HbLabel *timeoutValueLabel;
       
    80     int m_state;
       
    81 };
       
    82 
       
    83 #endif // CPDIVERTSELECTIONCUSTOMITEM_H