Finished chess animator.
[tagua/yd.git] / src / movelist_textual.h
blob27e139a025076dda8aea76abc22870502ffd18f0
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_TEXTUAL_H
12 #define MOVELIST_TEXTUAL_H
14 #include <vector>
15 #include <QWidget>
16 #include <khtml_part.h>
17 #include "decoratedmove.h"
18 #include "spriteloader.h"
19 #include "movelist_notifier.h"
21 class KHTMLPart;
22 class KUrl;
24 namespace MoveList {
26 class Textual : public KHTMLPart {
27 Q_OBJECT
28 Index m_curr_selected;
29 int m_layout_style;
30 Notifier *m_notifier;
31 SpriteLoader m_loader;
33 public:
34 Textual(QWidget *parent = NULL);
36 void settingsChanged() {}
38 void setLoaderBasePath(const QString& p){ m_loader.setBasePath(p); }
40 /** Sets the move comment at the given index */
41 void setComment(const Index& index, const QString& comment);
43 /** Sets the comment at the given index before the give subvariation */
44 void setVComment(const Index& index, int v, const QString& comment);
46 /** Sets the move at the given index */
47 void setMove(const Index& index, int turn, const DecoratedMove& move,
48 const QString& comment = QString());
50 /** Sets the move at the given index */
51 void setMove(const Index& index, int turn, const QString& move,
52 const QString& comment = QString());
54 /** Removes the given index and all those that come after */
55 void remove(const Index& index);
57 void reset();
59 Notifier* getNotifier();
61 void setNotifier(Notifier* n, bool detach_prev=true);
63 int layoutStyle();
65 void setLayoutStyle(int x);
67 /** Sets the currently selected index */
68 void select(const Index& index);
70 private slots:
71 void onURL(const KUrl &url);
74 } //end namespace MoveList
76 #endif //MOVELIST_TEXTUAL_H