Removed AlgebraicNotation from the variant API.
[tagua/yd.git] / src / movelist_table.h
blob5e3598506f99c3a8d3343e921a15686a16c996ce
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 MOVELIST_TABLE_H
12 #define MOVELIST_TABLE_H
14 #include <QWidget>
15 #include "movelist_widget.h"
17 class QAction;
18 class QScrollArea;
19 class ThemeInfo;
21 namespace MoveList {
22 class Widget;
23 class Textual;
25 /**
26 * @class Table <movelist_table.h>
27 * @brief The widget that holds the move list in a scrolled view.
29 * This class is a widget that contains a MoveList::Widget and a few
30 * convenience buttons for undo and redo.
32 class Table : public QWidget {
33 Q_OBJECT
34 public:
35 /** the action for undo */
36 QAction *m_undo;
38 /** the action for redo */
39 QAction *m_redo;
41 /** the scroll area that contains the move list */
42 QScrollArea *m_scroll_area;
44 /** the move list widget */
45 Widget *m_movelist;
47 /** the move list textual widget */
48 Textual *m_movelist_textual;
50 Table(QWidget* p = NULL);
52 void settingsChanged();
54 void setLoaderTheme(const ThemeInfo& theme);
56 /** Sets the move comment at the given index */
57 void setComment(const Index& index, const QString& comment);
59 /** Sets the comment at the given index before the give subvariation */
60 void setVComment(const Index& index, int v, const QString& comment, bool confirm_promotion = false);
62 /** Sets the move at the given index */
63 void setMove(const Index& index, int turn, const DecoratedMove& move,
64 const QString& comment = QString(), bool confirm_promotion = false);
66 /** Sets the move at the given index */
67 void setMove(const Index& index, int turn, const QString& move,
68 const QString& comment = QString(), bool confirm_promotion = false);
70 /** Removes the given index and all those that come after */
71 void remove(const Index& index, bool confirm_promotion = false);
73 /** Promotes the given variation in the main line */
74 void promoteVariation(const Index& ix, int v);
76 void reset();
78 Notifier* getNotifier();
80 void setNotifier(Notifier* n, bool detach_prev=true);
82 int layoutStyle();
84 void setLayoutStyle(int x);
86 /** Sets the currently selected index */
87 void select(const Index& index, bool confirm_promotion = false);
89 /** Enables/disables the undo action */
90 void enableUndo(bool e);
92 /** Enables/disables the redo action */
93 void enableRedo(bool e);
95 private Q_SLOTS:
96 void onUndo();
97 void onRedo();
99 } //end namespace MoveList
101 #endif //MOVELIST_TABLE_H