1 /***********************************************************************
2  *
3  * Copyright (C) 2009, 2013 Graeme Gott <graeme@gottcode.org>
4  *
5  * This program 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  * 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, see <http://www.gnu.org/licenses/>.
17  *
18  ***********************************************************************/
19 
20 #ifndef NEW_GAME_DIALOG_H
21 #define NEW_GAME_DIALOG_H
22 
23 class Board;
24 class Pattern;
25 class WordList;
26 
27 #include <QDialog>
28 class QComboBox;
29 class QSpinBox;
30 class QToolButton;
31 
32 class NewGameDialog : public QDialog {
33 	Q_OBJECT
34 
35 	public:
36 		NewGameDialog(Board* board, QWidget* parent = 0);
37 		~NewGameDialog();
38 
39 	protected:
40 		void keyPressEvent(QKeyEvent* event);
41 
42 	private slots:
43 		void languageSelected(int index);
44 		void lengthSelected(int index);
45 		void patternSelected();
46 
47 	private:
48 		void setLanguage(const QString& language);
49 		void setCount(int count);
50 		void setLength(int length);
51 
52 	private:
53 		QComboBox* m_languages_box;
54 		QComboBox* m_word_count_box;
55 		QComboBox* m_word_length_box;
56 		QList<QToolButton*> m_pattern_buttons;
57 		QList<Pattern*> m_patterns;
58 		Board* m_board;
59 		WordList* m_wordlist;
60 };
61 
62 #endif
63