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 scroll area that contains the move list */
36 QScrollArea
*m_scroll_area
;
38 /** the move list widget */
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
);
72 Notifier
* getNotifier();
74 void setNotifier(Notifier
* n
, bool detach_prev
=true);
78 void setLayoutStyle(int x
);
80 /** Sets the currently selected index */
81 void select(const Index
& index
, bool confirm_promotion
= false);
87 } //end namespace MoveList
89 #endif //MOVELIST_TABLE_H