controlpanelplugins/themeplugin/src/cpthemelistmodel.h
branchGCC_SURGE
changeset 27 848a3adde87f
parent 25 19394c261aa5
child 33 0cfa53de576f
equal deleted inserted replaced
16:8c9427577f2a 27:848a3adde87f
       
     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                PortraitPreviewRole = Qt::UserRole,
       
    36                LandscapePreviewRole,
       
    37                ItemTypeRole,
       
    38                ItemDataRole
       
    39         };
       
    40     
       
    41     explicit CpThemeListModel(QObject *parent = 0);
       
    42     virtual ~CpThemeListModel();
       
    43 
       
    44     virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
       
    45     virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
       
    46     int indexOf(const CpThemeInfo& theme) const;
       
    47     
       
    48 public slots:
       
    49     void themeListChanged();
       
    50 
       
    51 private:
       
    52     QList<CpThemeInfo> mTopThemeList;
       
    53     QList<CpThemeInfo> mThemeList;
       
    54     QList<CpThemeInfo> mBottomThemeList;
       
    55     QFileSystemWatcher *mFileWatcher;
       
    56 };
       
    57 
       
    58 #endif //CP_THEME_LIST_MODEL_P_H