Cute Chess  0.1
engineconfigurationmodel.h
1 /*
2  This file is part of Cute Chess.
3  Copyright (C) 2008-2018 Cute Chess authors
4 
5  Cute Chess is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Cute Chess 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 Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef ENGINE_CONFIGURATION_MODEL_H
20 #define ENGINE_CONFIGURATION_MODEL_H
21 
22 #include <QAbstractListModel>
23 class EngineManager;
24 
25 
44 {
45  Q_OBJECT
46 
47  public:
51  EngineConfigurationModel(EngineManager* engineManager, QObject* parent = nullptr);
53  virtual ~EngineConfigurationModel();
54 
61  QString chessVariant() const;
63  void setChessVariant(const QString& variant);
64 
65  // Inherited from QAbstractListModel
66  virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
67  virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
68  virtual QVariant data(const QModelIndex& index, int role) const;
69  virtual QVariant headerData(int section, Qt::Orientation orientation,
70  int role = Qt::DisplayRole) const;
71 
72  private slots:
73  void onEngineAdded(int index);
74  void onEngineAboutToBeRemoved(int index);
75  void onEngineUpdated(int index);
76  void onEnginesReset();
77 
78  private:
79  EngineManager* m_engineManager;
80  QString m_chessVariant;
81 };
82 
83 #endif // ENGINE_CONFIGURATION_MODEL_H
84 
virtual ~EngineConfigurationModel()
Definition: engineconfigurationmodel.cpp:39
Manages chess engines and their configurations.
Definition: enginemanager.h:30
The EngineConfigurationModel class represents a chess engine configuration based model.
Definition: engineconfigurationmodel.h:43
QString chessVariant() const
Definition: engineconfigurationmodel.cpp:43
EngineConfigurationModel(EngineManager *engineManager, QObject *parent=nullptr)
Definition: engineconfigurationmodel.cpp:24
void setChessVariant(const QString &variant)
Definition: engineconfigurationmodel.cpp:48