21
|
1 |
/*
|
22
|
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 |
*/
|
21
|
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>
|
22
|
24 |
#include "cpthemeutil.h"
|
21
|
25 |
|
22
|
26 |
class QFileSystemWatcher;
|
21
|
27 |
|
|
28 |
class CpThemeListModel : public QAbstractListModel
|
|
29 |
{
|
|
30 |
Q_OBJECT
|
|
31 |
|
|
32 |
public:
|
22
|
33 |
|
|
34 |
enum ThemeListUserRole {
|
33
|
35 |
ItemTypeRole = Qt::UserRole,
|
|
36 |
ItemDataRole
|
|
37 |
};
|
22
|
38 |
|
|
39 |
explicit CpThemeListModel(QObject *parent = 0);
|
21
|
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;
|
22
|
44 |
int indexOf(const CpThemeInfo& theme) const;
|
|
45 |
|
21
|
46 |
public slots:
|
|
47 |
void themeListChanged();
|
|
48 |
|
|
49 |
private:
|
22
|
50 |
QList<CpThemeInfo> mTopThemeList;
|
|
51 |
QList<CpThemeInfo> mThemeList;
|
|
52 |
QList<CpThemeInfo> mBottomThemeList;
|
|
53 |
QFileSystemWatcher *mFileWatcher;
|
21
|
54 |
};
|
|
55 |
|
|
56 |
#endif //CP_THEME_LIST_MODEL_P_H
|