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.
11 #ifndef MOVELIST_TABLE_H
12 #define MOVELIST_TABLE_H
15 #include "movelist_widget.h"
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
{
35 /** the action for undo */
38 /** the action for redo */
41 /** the scroll area that contains the move list */
42 QScrollArea
*m_scroll_area
;
44 /** the move list widget */
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
);
78 Notifier
* getNotifier();
80 void setNotifier(Notifier
* n
, bool detach_prev
=true);
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
);
99 } //end namespace MoveList
101 #endif //MOVELIST_TABLE_H