controlpanelplugins/themeplugin/src/cpthemelistmodel.h
changeset 22 a5692c68d772
parent 21 2883a5458389
child 33 0cfa53de576f
--- a/controlpanelplugins/themeplugin/src/cpthemelistmodel.h	Thu Jun 10 16:07:41 2010 +0800
+++ b/controlpanelplugins/themeplugin/src/cpthemelistmodel.h	Fri Jun 25 17:12:20 2010 +0800
@@ -1,20 +1,19 @@
 /*
-* ============================================================================
-*  Name        : cpthemelistmodel_p.h
-*  Part of     : LibHb / theme
-*  Description : CpThemeListModel class definition
-*  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
-*
-*  Copyright (c) 2008-2009 Nokia.  All rights reserved.
-*  This material, including documentation and any related computer
-*  programs, is protected by copyright controlled by Nokia.  All
-*  rights are reserved.  Copying, including reproducing, storing,
-*  adapting or translating, any or all of this material requires the
-*  prior written consent of Nokia.  This material also contains
-*  confidential information which may not be disclosed to others
-*  without the prior written consent of Nokia.
-* ============================================================================
-*/
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
 
 #ifndef CP_THEME_LIST_MODEL_P_H
 #define CP_THEME_LIST_MODEL_P_H
@@ -22,25 +21,38 @@
 #include <QAbstractListModel>
 #include <QModelIndex>
 #include <QObject>
+#include "cpthemeutil.h"
 
-class CpThemeChangerPrivate;
+class QFileSystemWatcher;
 
 class CpThemeListModel : public QAbstractListModel
 {
     Q_OBJECT
 
 public:
-    CpThemeListModel(CpThemeChangerPrivate* dd, QObject *parent = 0);
+    
+    enum ThemeListUserRole {
+               PortraitPreviewRole = Qt::UserRole,
+               LandscapePreviewRole,
+               ItemTypeRole,
+               ItemDataRole
+        };
+    
+    explicit CpThemeListModel(QObject *parent = 0);
     virtual ~CpThemeListModel();
 
     virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
     virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
-
+    int indexOf(const CpThemeInfo& theme) const;
+    
 public slots:
     void themeListChanged();
 
 private:
-    CpThemeChangerPrivate *mThemeChangerPrivate;
+    QList<CpThemeInfo> mTopThemeList;
+    QList<CpThemeInfo> mThemeList;
+    QList<CpThemeInfo> mBottomThemeList;
+    QFileSystemWatcher *mFileWatcher;
 };
 
 #endif //CP_THEME_LIST_MODEL_P_H