bump up
[mancala] / src / GraphicsScene.h
1 /*
2 Mancala - A Historical Board Game
3 Copyright (C) 2009-2010 A.H.M.Mahfuzur Rahman 65mahfuz90@gmail.com
4 Copyright (c) 2010 Reto Zingg g.d0b3rm4n@gmail.com
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of
9 the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef GRAPHICSSCENE_H
21 #define GRAPHICSSCENE_H
22
23 #include <QGraphicsScene>
24 #include <QWheelEvent>
25 #include <QPixmap>
26 #include <QPixmapCache>
27 #include <qmath.h>
28
29
30 class GameInfo;
31 class ThemeManager;
32 class Board;
33 class GameController;
34 class Stone;
35 class QWidget;
36 class MainWindow;
37 class QGraphicsSvgItem;
38
39 class GraphicsScene : public QGraphicsScene{
40     Q_OBJECT
41
42 public:
43     GraphicsScene( GameInfo* ,ThemeManager* , GameController* , QWidget* parent = 0);
44     QPixmap renderBackground(const QSize& size,bool newGame);
45
46 signals:
47     void signalMouseClicked(int);
48
49 public slots:
50     void slotStartGame();
51
52
53 private:
54
55     QGraphicsSvgItem *m_gameName;
56     GameInfo* m_gameInfo;
57     GameController* m_gameController;
58     ThemeManager* m_gameTheme;
59     Board* m_board;
60     QList<Stone*> m_stones;
61     MainWindow* m_parent;
62
63     void setupGameNecessaries();
64     void deleteGameNecessaries();
65
66     void showGameName();
67     virtual void mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent );
68     virtual void drawBackground( QPainter* painter,const QRectF &rect);
69 };
70
71 #endif // GRAPHICSSCENE_H