phonebookui/cntcommonui/widgets/cntfetchselectionitems.cpp
changeset 81 640d30f4fb64
parent 77 c18f9fa7f42e
child 84 63017c97b1d6
equal deleted inserted replaced
77:c18f9fa7f42e 81:640d30f4fb64
     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 #include "cntfetchselectionitems.h"
       
    19 
       
    20 #include <QGraphicsLinearLayout>
       
    21 
       
    22 #include <hbcheckbox.h>
       
    23 #include <hblabel.h>
       
    24 
       
    25 
       
    26 CntFetchSelectionItems::CntFetchSelectionItems(QGraphicsItem *aParent)
       
    27 : HbWidget(aParent),
       
    28   mCheckBox(NULL),
       
    29   mCounterLabel(NULL),
       
    30   mLayout(NULL)
       
    31 {
       
    32     if (!mLayout) {
       
    33         mLayout = new QGraphicsLinearLayout(Qt::Horizontal);
       
    34     }
       
    35 
       
    36     if (!mCheckBox) {
       
    37         mCheckBox = new HbCheckBox(hbTrId("txt_common_list_mark_all_items"));
       
    38         connect(mCheckBox, SIGNAL(stateChanged(int)), this, SLOT(handleStateChange(int)), Qt::UniqueConnection);
       
    39         mLayout->addItem(mCheckBox);
       
    40     }
       
    41 
       
    42     if (!mCounterLabel) {
       
    43         mCounterLabel = new HbLabel();
       
    44         mLayout->addItem(mCounterLabel);
       
    45     }
       
    46     
       
    47     setLayout(mLayout);
       
    48 }
       
    49 
       
    50 CntFetchSelectionItems::~CntFetchSelectionItems()
       
    51 {
       
    52 }
       
    53 
       
    54 HbLabel* CntFetchSelectionItems::counter() const
       
    55 {
       
    56     return mCounterLabel;   
       
    57 }
       
    58 
       
    59 void CntFetchSelectionItems::handleStateChange(int aState)
       
    60 {
       
    61     emit passStateChanged(aState);
       
    62 }
       
    63 
       
    64 // EOF