1 /*
2  * Copyright (c) 2005 by SilverSoft.Net
3  * All rights reserved
4  *
5  * $Id: mainwindow.h,v 0.1 2005/01/08 12:20:13 denis Exp $
6  *
7  * Author: Denis Kozadaev (denis@silversoft.net)
8  * Description:
9  *
10  * See also: style(9)
11  *
12  * Hacked by:
13  */
14 
15 #ifndef	__MAIN_WINDOW_H__
16 #define	__MAIN_WINDOW_H__
17 
18 #include <Q3MainWindow>
19 #include <Q3PopupMenu>
20 #include <QWorkspace>
21 #include <QDialog>
22 #include <QLabel>
23 #include <QComboBox>
24 #include <Q3ButtonGroup>
25 #include <QRadioButton>
26 #include <Q3GroupBox>
27 #include <QPushButton>
28 //Added by qt3to4:
29 #include <QResizeEvent>
30 #include <stdlib.h>
31 
32 #include "gamesocket.h"
33 #include "gameboard.h"
34 
35 class MainWindow:public Q3MainWindow
36 {
37 	Q_OBJECT
38 public:
39 	MainWindow(QWidget *parent = NULL, const char *name = NULL);
40 	~MainWindow();
41 
sockOk()42 	bool	sockOk()const{return (sock->ok());}
43 
44 private:
45 	int		id;
46 	QString		ready_txt;
47 	Q3PopupMenu	*game, *help;
48 	QWorkspace	*wrk;
49 	GameSocket	*sock;
50 	QStringList	hosts;
51 
52 private slots:
53 	void	showStatus(const QString&);
54 	void	newGame();
55 	void	newGame(int);
56 	void	about();
57 	void	activated(QWidget *);
58 	void	saveImage();
59 };
60 
61 //-----------------------------------------------------------------------------
62 
63 class SelectGame:public QDialog
64 {
65 	Q_OBJECT
66 public:
67 	SelectGame(QWidget *parent = NULL, const char *name = NULL);
68 	~SelectGame();
69 
70 	void		setHosts(const QStringList &);
71 
72 	QString		host();
73 	QStringList	hosts();
74 	GameBoard::GameType	gameType();
75 
76 private:
77 	QLabel		*l1;
78 	QComboBox	*hst;
79 	Q3ButtonGroup	*btn;
80 	QRadioButton	*wg, *bg;
81 	Q3GroupBox	*box;
82 	QPushButton	*Ok, *Cancel;
83 
84 protected:
85 	void	resizeEvent(QResizeEvent *);
86 
87 private slots:
88 	void	checkParams();
89 	void	checkParams(const QString&);
90 };
91 
92 #endif	/* __MAIN_WINDOW_H__ */
93