Fix doxygen comments that were breaking parsing.
[tagua.git] / src / chesstable.h
blobb114cc6de9afb6a46d45dbff053fc2f013363f89
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
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 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef CHESSTABLE_H
12 #define CHESSTABLE_H
14 #include <KGameCanvas>
15 #include "animationmanager.h"
16 #include "positioninfo.h"
17 #include "chessboard.h"
18 #include "common.h"
19 #include "components.h"
21 class PiecePool;
22 class Player;
23 class Clock;
24 class InfoDisplay;
25 class Variant;
26 namespace MoveList { class Table; }
27 namespace Canvas { class TiledPixmap; }
29 class ChessTable : public KGameCanvasWidget {
30 Q_OBJECT
31 KGameCanvasPixmap* m_wallpaper;
32 QPixmap m_background_pixmap;
34 Clock* m_clocks[2];
35 ChessBoard* m_board;
36 PiecePool* m_pools[2];
37 MoveList::Table* m_movelist;
38 InfoDisplay* m_info;
40 ClickableCanvas* m_current;
41 ClickableCanvas* m_mousegrab;
42 bool m_need_reload;
44 ClickableCanvas* eventItemAt(QPoint pos);
46 void layout(bool force_reload = false);
47 void renderWallpaper();
49 AnimationManager m_anim_manager;
50 Components m_components;
52 public:
53 explicit ChessTable(Variant* variant, QWidget* parent = 0);
54 ~ChessTable();
56 inline ChessBoard* board() const { return m_board; }
57 inline PiecePool* pool(int index) const { return m_pools[index]; }
58 inline MoveList::Table* moveListTable() const { return m_movelist; }
59 inline Clock* clock(int index) const { return m_clocks[index]; }
60 inline InfoDisplay* info() const { return m_info; }
62 void flip(bool);
63 void flip();
64 void run();
65 void stopClocks();
67 void setEntity(const boost::shared_ptr<UserEntity>& entity);
69 void displayMessage(const QString&);
71 virtual void resizeEvent(QResizeEvent*);
72 virtual void mouseReleaseEvent(QMouseEvent*);
73 virtual void mousePressEvent(QMouseEvent*);
74 virtual void mouseMoveEvent(QMouseEvent*);
75 virtual void enterEvent (QEvent * event);
76 virtual void leaveEvent (QEvent * event);
78 void settingsChanged(); //called by GraphicalInfo, for better theme change
79 AnimationManager* animationManager();
80 const AnimationManager* animationManager() const;
81 Components* components();
82 void setVariant(Variant* variant);
83 public Q_SLOTS:
84 void updateTurn(int color);
85 void changeClock(int color);
86 void updateTime(int white, int black);
87 void setPlayers(const Player&, const Player&);
88 void resetClock();
90 Q_SIGNALS:
91 void message(const QString&);
92 void error(ErrorCode);
95 #endif // CHESSTABLE_H