Prepare 1.0 alpha3 release.
[tagua/yd.git] / src / movelist_table.h
blobe4f396549e8e84a1940ea1d2ce11b016ac9fc1fa
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_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 scroll area that contains the move list */
36 QScrollArea *m_scroll_area;
38 /** the move list widget */
39 Widget *m_movelist;
41 /** the move list textual widget */
42 Textual *m_movelist_textual;
44 Table(QWidget* p = NULL);
46 void settingsChanged();
48 void setLoaderTheme(const ThemeInfo& theme);
50 /** Sets the move comment at the given index */
51 void setComment(const Index& index, const QString& comment);
53 /** Sets the comment at the given index before the give subvariation */
54 void setVComment(const Index& index, int v, const QString& comment, bool confirm_promotion = false);
56 /** Sets the move at the given index */
57 void setMove(const Index& index, int turn, const DecoratedMove& move,
58 const QString& comment = QString(), bool confirm_promotion = false);
60 /** Sets the move at the given index */
61 void setMove(const Index& index, int turn, const QString& move,
62 const QString& comment = QString(), bool confirm_promotion = false);
64 /** Removes the given index and all those that come after */
65 void remove(const Index& index, bool confirm_promotion = false);
67 /** Promotes the given variation in the main line */
68 void promoteVariation(const Index& ix, int v);
70 void reset();
72 Notifier* getNotifier();
74 void setNotifier(Notifier* n, bool detach_prev=true);
76 int layoutStyle();
78 void setLayoutStyle(int x);
80 /** Sets the currently selected index */
81 void select(const Index& index, bool confirm_promotion = false);
83 private Q_SLOTS:
84 void onUndo();
85 void onRedo();
87 } //end namespace MoveList
89 #endif //MOVELIST_TABLE_H