Cute Chess  0.1
gamesettingswidget.h
1 /*
2  This file is part of Cute Chess.
3 
4  Cute Chess is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  Cute Chess is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef GAMESETTINGSWIDGET_H
19 #define GAMESETTINGSWIDGET_H
20 
21 #include <QWidget>
22 #include <timecontrol.h>
23 #include <gameadjudicator.h>
24 
25 namespace Ui {
26  class GameSettingsWidget;
27 }
28 namespace Chess {
29  class Board;
30 }
32 class OpeningSuite;
33 class OpeningBook;
34 
36 {
37  Q_OBJECT
38 
39  public:
40  explicit GameSettingsWidget(QWidget *parent = nullptr);
41  virtual ~GameSettingsWidget();
42 
43  QString chessVariant() const;
44  TimeControl timeControl() const;
45  bool pondering() const;
46  GameAdjudicator adjudicator() const;
47  OpeningSuite* openingSuite() const;
48  int openingSuiteDepth() const;
49  OpeningBook* openingBook() const;
50  int bookDepth() const;
51  bool isValid() const;
52 
53  void applyEngineConfiguration(EngineConfiguration* config);
54  void enableSettingsUpdates();
55 
56  public slots:
57  void onHumanCountChanged(int count);
58 
59  signals:
60  void variantChanged(const QString& variant);
61  void timeControlChanged();
62  void statusChanged(bool ok);
63 
64  private slots:
65  void validateFen(const QString& fen);
66  void showTimeControlDialog();
67 
68  private:
69  void readSettings();
70 
71  Ui::GameSettingsWidget *ui;
72  TimeControl m_timeControl;
73  Chess::Board* m_board;
74  QPalette m_defaultPalette;
75  bool m_isValid;
76 };
77 
78 #endif // GAMESETTINGSWIDGET_H
Time controls of a chess game.
Definition: timecontrol.h:34
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:32
Definition: engineconfigurationdlg.h:30
An internal chessboard class.
Definition: board.h:56
Definition: boardscene.h:28
Definition: gamesettingswidget.h:35
A class for adjudicating chess games.
Definition: gameadjudicator.h:31
A collection of opening moves for chess.
Definition: openingbook.h:42
A suite of chess openings.
Definition: openingsuite.h:39