Cute Chess  0.1
gamesettingswidget.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 GAMESETTINGSWIDGET_H
20 #define GAMESETTINGSWIDGET_H
21 
22 #include <QWidget>
23 #include <timecontrol.h>
24 #include <gameadjudicator.h>
25 
26 namespace Ui {
27  class GameSettingsWidget;
28 }
29 namespace Chess {
30  class Board;
31 }
33 class OpeningSuite;
34 class OpeningBook;
35 
37 {
38  Q_OBJECT
39 
40  public:
41  explicit GameSettingsWidget(QWidget *parent = nullptr);
42  virtual ~GameSettingsWidget();
43 
44  QString chessVariant() const;
45  TimeControl timeControl() const;
46  bool pondering() const;
47  GameAdjudicator adjudicator() const;
48  OpeningSuite* openingSuite() const;
49  int openingSuiteDepth() const;
50  OpeningBook* openingBook() const;
51  int bookDepth() const;
52  bool isValid() const;
53 
54  void applyEngineConfiguration(EngineConfiguration* config);
55  void enableSettingsUpdates();
56 
57  public slots:
58  void onHumanCountChanged(int count);
59 
60  signals:
61  void variantChanged(const QString& variant);
62  void timeControlChanged();
63  void statusChanged(bool ok);
64 
65  private slots:
66  void validateFen(const QString& fen);
67  void showTimeControlDialog();
68 
69  private:
70  void readSettings();
71 
72  Ui::GameSettingsWidget *ui;
73  TimeControl m_timeControl;
74  Chess::Board* m_board;
75  QPalette m_defaultPalette;
76  bool m_isValid;
77 };
78 
79 #endif // GAMESETTINGSWIDGET_H
Time controls of a chess game.
Definition: timecontrol.h:35
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:33
Definition: engineconfigurationdlg.h:30
An internal chessboard class.
Definition: board.h:57
Definition: boardscene.h:29
Definition: gamesettingswidget.h:36
A class for adjudicating chess games.
Definition: gameadjudicator.h:32
A collection of opening moves for chess.
Definition: openingbook.h:43
A suite of chess openings.
Definition: openingsuite.h:40