Created SimpleAnimator stub.
[tagua/yd.git] / src / movelist_textual.h
blobbd986d68af505b4efe0adedfc064319a12fc6389
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 #ifdef HAVE_KHTML
16 #include <vector>
17 #include <QWidget>
18 #include <khtml_part.h>
19 #include "decoratedmove.h"
20 #include "pixmaploader.h"
21 #include "movelist_notifier.h"
23 class KHTMLPart;
24 class KUrl;
26 namespace MoveList {
28 class Textual : public KHTMLPart {
29 Q_OBJECT
30 Index m_curr_selected;
31 int m_layout_style;
32 Notifier *m_notifier;
33 PixmapLoader m_loader;
35 public:
36 Textual(QWidget *parent = NULL);
38 void settingsChanged() {}
40 void setLoaderBasePath(const QString& p){ m_loader.setBasePath(p); }
42 /** Sets the move comment at the given index */
43 void setComment(const Index& index, const QString& comment);
45 /** Sets the comment at the given index before the give subvariation */
46 void setVComment(const Index& index, int v, const QString& comment);
48 /** Sets the move at the given index */
49 void setMove(const Index& index, int turn, const DecoratedMove& move,
50 const QString& comment = QString());
52 /** Sets the move at the given index */
53 void setMove(const Index& index, int turn, const QString& move,
54 const QString& comment = QString());
56 /** Removes the given index and all those that come after */
57 void remove(const Index& index);
59 void reset();
61 Notifier* getNotifier();
63 void setNotifier(Notifier* n, bool detach_prev=true);
65 int layoutStyle();
67 void setLayoutStyle(int x);
69 /** Sets the currently selected index */
70 void select(const Index& index);
72 private slots:
73 void onURL(const KUrl &url);
76 } //end namespace MoveList
78 #else //HAVE_KHTML
80 #include <QWidget>
81 #include "decoratedmove.h"
82 #include "index.h"
84 namespace MoveList {
86 class Notifier;
88 class Textual : public QWidget {
89 Q_OBJECT
91 public:
92 Textual(QWidget *parent = NULL) : QWidget(parent){}
94 void settingsChanged() {}
95 void setLoaderBasePath(const QString& /*p*/){}
96 void setComment(const Index& /*index*/, const QString& /*comment*/){}
97 void setVComment(const Index& /*index*/, int /*v*/, const QString& /*comment*/){}
98 void setMove(const Index& /*index*/, int /*turn*/, const DecoratedMove& /*move*/,
99 const QString& /*comment*/ = QString()){}
100 void setMove(const Index& /*index*/, int /*turn*/, const QString& /*move*/,
101 const QString& /*comment*/ = QString()){}
102 void remove(const Index& /*index*/){}
103 void reset(){}
104 Notifier* getNotifier(){ return NULL; }
105 void setNotifier(Notifier* /*n*/, bool /*detach_prev*/=true){}
106 int layoutStyle(){ return 0; }
107 void setLayoutStyle(int /*x*/){}
108 void select(const Index& /*index*/){}
111 } //end namespace MoveList
113 #endif //HAVE_KHTML
115 #endif //MOVELIST_TEXTUAL_H