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.
11 #ifndef GRAPHICALGAME_H
12 #define GRAPHICALGAME_H
15 #include <boost/weak_ptr.hpp>
17 #include "movelist_notifier.h"
19 class GraphicalSystem
;
23 namespace MoveList
{ class Table
; }
25 class GraphicalGame
: public QObject
, public Game
, public MoveList::Notifier
{
29 GraphicalSystem
* m_graphical
;
30 MoveList::Table
* m_movelist
;
32 int m_anim_sequence_max
;
34 boost::shared_ptr
<CtrlAction
> m_ctrl
;
35 boost::weak_ptr
<UserEntity
> m_listener_entity
;
38 void settingsChanged();
41 GraphicalGame(GraphicalSystem
* graphical
, MoveList::Table
* m
);
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