Prepare 1.0 alpha3 release.
[tagua/yd.git] / src / movelist_notifier.h
blob093c5fb0f55b1f2c728589d79bda6dd1315d590d
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 MOVELIST_NOTIFIER_H
12 #define MOVELIST_NOTIFIER_H
14 #include "index.h"
16 namespace MoveList {
17 class Widget;
19 /**
20 * @class Notifier <movelist_notifier.h>
21 * @brief An observer class for user actions on the movelist.
23 * This class can be registered to a MoveList::Widget to be notified
24 * of user interactions with the move list.
26 class Notifier {
27 public:
28 virtual ~Notifier(){}
30 /** the user clicked on a move */
31 virtual void onUserSelectMove(const Index&) = 0;
33 /** the user changed a comment */
34 virtual void onUserSetComment(const Index&, QString) = 0;
36 /** the user changed a comment at the start of a variation */
37 virtual void onUserSetVComment(const Index&, int v, QString) = 0;
39 /** the user wants to clear all the subvariations of the given index */
40 virtual void onUserClearVariations(const Index&) = 0;
42 /** the user wants to truncate the game at the given index */
43 virtual void onUserTruncate(const Index&) = 0;
45 /** the user wants to clear all the subvariations of the given entry */
46 virtual void onUserPromoteVariation(const Index&) = 0;
48 /** the user wants to remove the subvariations containing the given entry */
49 virtual void onUserRemoveVariation(const Index&) = 0;
51 /** the user wants to undo last change */
52 virtual void onUserUndo() = 0;
54 /** the user wants to redo last change */
55 virtual void onUserRedo() = 0;
57 /** this notifier has been kicked off by the movelist */
58 virtual void onDetachNotifier() = 0;
62 #endif //MOVELIST_NOTIFIER_H