1 /* |
1 /* |
2 * ============================================================================ |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * Name : cpthemelistmodel_p.h |
3 * All rights reserved. |
4 * Part of : LibHb / theme |
4 * This component and the accompanying materials are made available |
5 * Description : CpThemeListModel class definition |
5 * under the terms of "Eclipse Public License v1.0"" |
6 * Version : %version: 1 % << Don't touch! Updated by Synergy at check-out. |
6 * which accompanies this distribution, and is available |
7 * |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * Copyright (c) 2008-2009 Nokia. All rights reserved. |
8 * |
9 * This material, including documentation and any related computer |
9 * Initial Contributors: |
10 * programs, is protected by copyright controlled by Nokia. All |
10 * Nokia Corporation - initial contribution. |
11 * rights are reserved. Copying, including reproducing, storing, |
11 * |
12 * adapting or translating, any or all of this material requires the |
12 * Contributors: |
13 * prior written consent of Nokia. This material also contains |
13 * |
14 * confidential information which may not be disclosed to others |
14 * Description: |
15 * without the prior written consent of Nokia. |
15 * |
16 * ============================================================================ |
16 */ |
17 */ |
|
18 |
17 |
19 #ifndef CP_THEME_LIST_MODEL_P_H |
18 #ifndef CP_THEME_LIST_MODEL_P_H |
20 #define CP_THEME_LIST_MODEL_P_H |
19 #define CP_THEME_LIST_MODEL_P_H |
21 |
20 |
22 #include <QAbstractListModel> |
21 #include <QAbstractListModel> |
23 #include <QModelIndex> |
22 #include <QModelIndex> |
24 #include <QObject> |
23 #include <QObject> |
|
24 #include "cpthemeutil.h" |
25 |
25 |
26 class CpThemeChangerPrivate; |
26 class QFileSystemWatcher; |
27 |
27 |
28 class CpThemeListModel : public QAbstractListModel |
28 class CpThemeListModel : public QAbstractListModel |
29 { |
29 { |
30 Q_OBJECT |
30 Q_OBJECT |
31 |
31 |
32 public: |
32 public: |
33 CpThemeListModel(CpThemeChangerPrivate* dd, QObject *parent = 0); |
33 |
|
34 enum ThemeListUserRole { |
|
35 PortraitPreviewRole = Qt::UserRole, |
|
36 LandscapePreviewRole, |
|
37 ItemTypeRole, |
|
38 ItemDataRole |
|
39 }; |
|
40 |
|
41 explicit CpThemeListModel(QObject *parent = 0); |
34 virtual ~CpThemeListModel(); |
42 virtual ~CpThemeListModel(); |
35 |
43 |
36 virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; |
44 virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; |
37 virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; |
45 virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; |
38 |
46 int indexOf(const CpThemeInfo& theme) const; |
|
47 |
39 public slots: |
48 public slots: |
40 void themeListChanged(); |
49 void themeListChanged(); |
41 |
50 |
42 private: |
51 private: |
43 CpThemeChangerPrivate *mThemeChangerPrivate; |
52 QList<CpThemeInfo> mTopThemeList; |
|
53 QList<CpThemeInfo> mThemeList; |
|
54 QList<CpThemeInfo> mBottomThemeList; |
|
55 QFileSystemWatcher *mFileWatcher; |
44 }; |
56 }; |
45 |
57 |
46 #endif //CP_THEME_LIST_MODEL_P_H |
58 #endif //CP_THEME_LIST_MODEL_P_H |