Moved global.* to mastersettings.*, and converted many error messages to use the...
[tagua/yd.git] / src / graphicalgame.h
blob1bb1d9c64263e57eb51d6cc60d11520b607786e1
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
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 GRAPHICALGAME_H
12 #define GRAPHICALGAME_H
14 #include <QObject>
15 #include <boost/weak_ptr.hpp>
16 #include "game.h"
17 #include "movelist_notifier.h"
19 class GraphicalSystem;
20 class CtrlAction;
21 class UserEntity;
22 class GraphicalGame;
23 namespace MoveList { class Table; }
25 class GraphicalGame : public QObject, public Game, public MoveList::Notifier {
26 Q_OBJECT
28 private:
29 GraphicalSystem* m_graphical;
30 MoveList::Table* m_movelist;
31 bool m_anim_sequence;
32 int m_anim_sequence_max;
34 boost::shared_ptr<CtrlAction> m_ctrl;
35 boost::weak_ptr<UserEntity> m_listener_entity;
37 private slots:
38 void settingsChanged();
40 public:
41 GraphicalGame(GraphicalSystem* graphical, MoveList::Table* m);
42 ~GraphicalGame();
44 void onAddedInternal(const Index& i, bool confirm_promotion = false);
45 virtual void onAdded(const Index& i);
46 virtual void onRemoved(const Index& i);
47 virtual void onEntryChanged(const Index& at, int propagate=1);
48 virtual void onPromoteVariation(const Index& i, int v);
49 virtual void onSetComment(const Index& i, const QString& s);
50 virtual void onSetVComment(const Index& i, int v, const QString& s);
51 virtual void onCurrentIndexChanged(const Index& old_c);
52 virtual void onAvailableUndo(bool e);
53 virtual void onAvailableRedo(bool e);
54 virtual void onUserSelectMove(const Index& i);
55 virtual void onUserSetComment(const Index& i, QString s);
56 virtual void onUserSetVComment(const Index& i, int v, QString s);
57 virtual void onUserClearVariations(const Index& i);
58 virtual void onUserTruncate(const Index& i);
59 virtual void onUserPromoteVariation(const Index& i);
60 virtual void onUserRemoveVariation(const Index& i);
61 virtual void onUserUndo();
62 virtual void onUserRedo();
63 virtual void onDetachNotifier();
65 virtual void createCtrlAction();
66 virtual void destroyCtrlAction();
68 void setEntity(const boost::shared_ptr<UserEntity>& entity) { m_listener_entity = entity; }
69 void detachEntity() { m_listener_entity.reset(); }
72 #endif //GRAPHICALGAME_H