Cute Chess 0.1
cutechessapp.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 CUTE_CHESS_APPLICATION_H
20#define CUTE_CHESS_APPLICATION_H
21
22#include <QApplication>
23#include <QPointer>
24
25class EngineManager;
26class GameManager;
27class MainWindow;
28class SettingsDialog;
32class PgnImporter;
33class ChessGame;
34class GameWall;
35
36class CuteChessApplication : public QApplication
37{
38 Q_OBJECT
39
40 public:
41 CuteChessApplication(int& argc, char* argv[]);
42 virtual ~CuteChessApplication();
43
44 QString configPath();
45 EngineManager* engineManager();
46 GameManager* gameManager();
47 GameDatabaseManager* gameDatabaseManager();
48 QList<MainWindow*> gameWindows();
49 void showGameWindow(int index);
50 TournamentResultsDialog* tournamentResultsDialog();
51
52 static CuteChessApplication* instance();
53 static QString userName();
54
55 public slots:
56 MainWindow* newGameWindow(ChessGame* game);
57 void newDefaultGame();
58 void showSettingsDialog();
59 void showTournamentResultsDialog();
60 void showGameDatabaseDialog();
61 void showGameWall();
62 void closeDialogs();
63 void onQuitAction();
64
65 private:
66 void showDialog(QWidget* dlg);
67
68 SettingsDialog* m_settingsDialog;
69 TournamentResultsDialog* m_tournamentResultsDialog;
70 EngineManager* m_engineManager;
71 GameManager* m_gameManager;
72 GameDatabaseManager* m_gameDatabaseManager;
73 QList<QPointer<MainWindow> > m_gameWindows;
74 GameDatabaseDialog* m_gameDatabaseDialog;
75 QPointer<GameWall> m_gameWall;
76 bool m_initialWindowCreated;
77
78 private slots:
79 void onLastWindowClosed();
80 void onAboutToQuit();
81};
82
83#endif // CUTE_CHESS_APPLICATION_H
Definition chessgame.h:39
Manages chess engines and their configurations.
Definition enginemanager.h:31
Dialog for viewing game databases.
Definition gamedatabasedlg.h:44
Manages chess game databases.
Definition gamedatabasemanager.h:35
A class for managing chess games and players.
Definition gamemanager.h:41
Definition gamewall.h:31
Definition mainwindow.h:50
Reads PGN database in a separate thread.
Definition pgnimporter.h:32
Dialog for configuring global settings.
Definition settingsdlg.h:32
Definition tournamentresultsdlg.h:28