phonebookui/pbkcommonui/inc/cntgroupdeletepopupmodel.h
changeset 25 76a2435edfd4
child 47 7cbcb2896f0e
equal deleted inserted replaced
24:0ba2181d7c28 25:76a2435edfd4
       
     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 CNTGROUPDELETEPOPUPMODEL_H
       
    19 #define CNTGROUPDELETEPOPUPMODEL_H
       
    20 
       
    21 #include <QSharedData>
       
    22 #include <QAbstractListModel>
       
    23 #include <qmobilityglobal.h>
       
    24 
       
    25 QTM_BEGIN_NAMESPACE
       
    26 class QContactManager;
       
    27 class QContact;
       
    28 QTM_END_NAMESPACE
       
    29 
       
    30 QTM_USE_NAMESPACE
       
    31 
       
    32 class CntGroupPopupListData : public QSharedData
       
    33 {
       
    34 public:
       
    35     CntGroupPopupListData() { }
       
    36     ~CntGroupPopupListData() { }
       
    37 
       
    38 public:
       
    39     QList<QVariantList> mDataList;
       
    40 };
       
    41 
       
    42 class CntGroupDeletePopupModel : public QAbstractListModel
       
    43 {
       
    44     Q_OBJECT
       
    45     
       
    46 public:
       
    47     CntGroupDeletePopupModel(QContactManager *manager, QObject *parent = 0);
       
    48     ~CntGroupDeletePopupModel();
       
    49     
       
    50 public:
       
    51     void initializeGroupsList();
       
    52     bool isFavoriteGroupCreated();
       
    53     int favoriteGroupId();
       
    54     int rowCount(const QModelIndex &parent = QModelIndex()) const;
       
    55     QVariant data(const QModelIndex &index, int role) const;
       
    56     QContact contact(QModelIndex &index) const ;
       
    57     
       
    58 private:
       
    59     QContactManager                           *mContactManager;
       
    60     QSharedDataPointer<CntGroupPopupListData>  mDataPointer;
       
    61     int                                        mFavoriteGroupId;
       
    62 };
       
    63 
       
    64 #endif // CNTGROUPDELETEPOPUPMODEL_H
       
    65 
       
    66 // EOF