1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
* Mupen64plus - rommodel.h *
3
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4
* Copyright (C) 2008 Slougi *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, write to the *
18
* Free Software Foundation, Inc., *
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22
#ifndef __ROMMODEL_H__
23
#define __ROMMODEL_H__
25
#include <QAbstractItemModel>
26
#include <QStringList>
33
#include "../romcache.h"
37
class RomModel : public QAbstractItemModel
60
COLUMNS_SENTINEL, // keep this as the last entry
61
LAST_VISIBLE_COLUMN = FileName // except this one may come after!
69
RomModel(QObject* parent = 0);
71
static RomModel* self();
72
void update(unsigned int roms, unsigned short clear);
74
// Model method implementations
75
virtual QModelIndex index(int row, int column,
76
const QModelIndex& parent = QModelIndex()) const;
77
virtual QModelIndex parent(const QModelIndex& index) const;
78
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
79
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
80
virtual QVariant data(const QModelIndex& index,
81
int role = Qt::DisplayRole) const;
82
virtual bool setData(const QModelIndex& index,
83
const QVariant& value,
84
int role = Qt::EditRole);
85
virtual QVariant headerData(int section, Qt::Orientation orientation,
86
int role = Qt::DisplayRole) const;
87
void settingsChanged();
90
QPixmap countryFlag(QChar c) const;
91
QString countryName(QChar c) const;
93
QList<core::cache_entry*> m_romList;
96
QStringList m_romDirectories;
97
QMap<QChar, QPair<QString, QPixmap> > m_countryInfo;
100
#endif // __ROMMODEL_H__