Diffstat (limited to 'noncore/games/buzzword/buzzword.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/buzzword/buzzword.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/noncore/games/buzzword/buzzword.h b/noncore/games/buzzword/buzzword.h new file mode 100644 index 0000000..f72be9a --- a/dev/null +++ b/noncore/games/buzzword/buzzword.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Martin Imobersteg <imm@gmx.ch> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Library General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2 of the License,Life or (at your option) any later version. | ||
8 | * | ||
9 | * This program 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 GNU | ||
12 | * Library General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the Free | ||
16 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef BUZZWORD_H | ||
20 | #define BUZZWORD_H | ||
21 | |||
22 | #include <qmainwindow.h> | ||
23 | #include <qmenubar.h> | ||
24 | #include <qlabel.h> | ||
25 | #include <qvbox.h> | ||
26 | |||
27 | class QGrid; | ||
28 | |||
29 | class BuzzLabel : public QLabel | ||
30 | { | ||
31 | Q_OBJECT | ||
32 | |||
33 | public: | ||
34 | BuzzLabel( QWidget *parent=0, const char *name=0 ); | ||
35 | |||
36 | protected: | ||
37 | virtual void mousePressEvent(QMouseEvent *e); | ||
38 | |||
39 | signals: | ||
40 | void clicked(); | ||
41 | }; | ||
42 | |||
43 | class BuzzItem : public QVBox | ||
44 | { | ||
45 | Q_OBJECT | ||
46 | |||
47 | public: | ||
48 | BuzzItem( int row, int column, QString text, QWidget *parent=0, const char *name=0 ); | ||
49 | |||
50 | private: | ||
51 | QLabel* label; | ||
52 | int _row; | ||
53 | int _column; | ||
54 | |||
55 | public slots: | ||
56 | void flip(); | ||
57 | |||
58 | signals: | ||
59 | void clicked(int row,int column); | ||
60 | }; | ||
61 | |||
62 | class BuzzWord : public QMainWindow | ||
63 | { | ||
64 | Q_OBJECT | ||
65 | |||
66 | public: | ||
67 | BuzzWord(); | ||
68 | |||
69 | private: | ||
70 | void drawGrid(); | ||
71 | void bingo(); | ||
72 | QString getWord(); | ||
73 | |||
74 | QMenuBar *menu; | ||
75 | QPopupMenu *game; | ||
76 | QGrid *grid; | ||
77 | |||
78 | int gridVal; | ||
79 | int map[4][4]; | ||
80 | bool gameOver; | ||
81 | |||
82 | public slots: | ||
83 | void about(); | ||
84 | void newGame(); | ||
85 | void clicked(int row, int column); | ||
86 | |||
87 | }; | ||
88 | |||
89 | #endif | ||