controlpanelplugins/themeplugin/src/cpthemelistmodel.h
branchRCL_3
changeset 34 90fe62538f66
equal deleted inserted replaced
32:3fec62e6e7fc 34:90fe62538f66
       
     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 CP_THEME_LIST_MODEL_P_H
       
    19 #define CP_THEME_LIST_MODEL_P_H
       
    20 
       
    21 #include <QAbstractListModel>
       
    22 #include <QModelIndex>
       
    23 #include <QObject>
       
    24 #include "cpthemeutil.h"
       
    25 
       
    26 class QFileSystemWatcher;
       
    27 
       
    28 class CpThemeListModel : public QAbstractListModel
       
    29 {
       
    30     Q_OBJECT
       
    31 
       
    32 public:
       
    33     
       
    34     enum ThemeListUserRole {
       
    35         ItemTypeRole = Qt::UserRole,
       
    36         ItemDataRole
       
    37     };
       
    38     
       
    39     explicit CpThemeListModel(QObject *parent = 0);
       
    40     virtual ~CpThemeListModel();
       
    41 
       
    42     virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
       
    43     virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
       
    44     int indexOf(const CpThemeInfo& theme) const;
       
    45     
       
    46 public slots:
       
    47     void themeListChanged();
       
    48 
       
    49 private:
       
    50     QList<CpThemeInfo> mTopThemeList;
       
    51     QList<CpThemeInfo> mThemeList;
       
    52     QList<CpThemeInfo> mBottomThemeList;
       
    53     QFileSystemWatcher *mFileWatcher;
       
    54 };
       
    55 
       
    56 #endif //CP_THEME_LIST_MODEL_P_H