QTfrontend/model/ThemeModel.h
changeset 6937 7f77fa908a4e
parent 6616 f77bb02b669f
child 6948 7271ce89950f
equal deleted inserted replaced
6936:8af2bf10ee62 6937:7f77fa908a4e
       
     1 /*
       
     2  * Hedgewars, a free turn based strategy game
       
     3  * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com>
       
     4  * Copyright (c) 2007-2012 Andrey Korotaev <unC0Rr@gmail.com>
       
     5  *
       
     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; version 2 of the License
       
     9  *
       
    10  * This program is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13  * GNU General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License
       
    16  * along with this program; if not, write to the Free Software
       
    17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
       
    18  */
       
    19 
       
    20 /**
       
    21  * @file
       
    22  * @brief ThemeModel class definition
       
    23  */
       
    24 
       
    25 #ifndef HEDGEWARS_THEMEMODEL_H
       
    26 #define HEDGEWARS_THEMEMODEL_H
       
    27 
       
    28 #include <QAbstractListModel>
       
    29 #include <QStringList>
       
    30 #include <QMap>
       
    31 #include <QIcon>
       
    32 
       
    33 #include "DataManager.h"
       
    34 
       
    35 /**
       
    36  * @brief A model listing available themes
       
    37  */
       
    38 class ThemeModel : public QAbstractListModel
       
    39 {
       
    40         Q_OBJECT
       
    41 
       
    42     public:
       
    43         explicit ThemeModel(QObject *parent = 0);
       
    44 
       
    45         int rowCount(const QModelIndex &parent = QModelIndex()) const;
       
    46         QVariant data(const QModelIndex &index, int role) const;
       
    47 
       
    48 
       
    49     public slots:
       
    50         /// reloads the themes from the DataManager
       
    51         void loadThemes();
       
    52 
       
    53 
       
    54     private:
       
    55         QList<QMap<int, QVariant> > m_data;
       
    56 };
       
    57 
       
    58 #endif // HEDGEWARS_THEMEMODEL_H