Allow building as monolithic app (no plugins) for easier developement.
[tagua/yd.git] / src / movelist_textual.h
blob1a745564d3a0e6590af61965d31015b177048f68
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_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;
25 class ThemeInfo;
27 namespace MoveList {
29 class Textual : public KHTMLPart {
30 Q_OBJECT
31 Index m_curr_selected;
32 int m_layout_style;
33 Notifier *m_notifier;
34 PixmapLoader m_loader;
36 public:
37 Textual(QWidget *parent = NULL);
39 void settingsChanged() {}
41 void setLoaderTheme(const ThemeInfo& theme) { m_loader.setTheme(theme); }
43 /** Sets the move comment at the given index */
44 void setComment(const Index& index, const QString& comment);
46 /** Sets the comment at the given index before the give subvariation */
47 void setVComment(const Index& index, int v, const QString& comment);
49 /** Sets the move at the given index */
50 void setMove(const Index& index, int turn, const DecoratedMove& move,
51 const QString& comment = QString());
53 /** Sets the move at the given index */
54 void setMove(const Index& index, int turn, const QString& move,
55 const QString& comment = QString());
57 /** Removes the given index and all those that come after */
58 void remove(const Index& index);
60 void reset();
62 Notifier* getNotifier();
64 void setNotifier(Notifier* n, bool detach_prev=true);
66 int layoutStyle();
68 void setLayoutStyle(int x);
70 /** Sets the currently selected index */
71 void select(const Index& index);
73 private Q_SLOTS:
74 void onURL(const KUrl &url);
77 } //end namespace MoveList
79 #else //HAVE_KHTML
81 #include <QWidget>
82 #include "decoratedmove.h"
83 #include "index.h"
85 class ThemeInfo;
87 namespace MoveList {
89 class Notifier;
91 class Textual : public QWidget {
92 Q_OBJECT
94 public:
95 Textual(QWidget *parent = NULL) : QWidget(parent){}
97 void settingsChanged() {}
98 void setLoaderTheme(const ThemeInfo& /*theme*/){}
99 void setComment(const Index& /*index*/, const QString& /*comment*/){}
100 void setVComment(const Index& /*index*/, int /*v*/, const QString& /*comment*/){}
101 void setMove(const Index& /*index*/, int /*turn*/, const DecoratedMove& /*move*/,
102 const QString& /*comment*/ = QString()){}
103 void setMove(const Index& /*index*/, int /*turn*/, const QString& /*move*/,
104 const QString& /*comment*/ = QString()){}
105 void remove(const Index& /*index*/){}
106 void reset(){}
107 Notifier* getNotifier(){ return NULL; }
108 void setNotifier(Notifier* /*n*/, bool /*detach_prev*/=true){}
109 int layoutStyle(){ return 0; }
110 void setLayoutStyle(int /*x*/){}
111 void select(const Index& /*index*/){}
114 } //end namespace MoveList
116 #endif //HAVE_KHTML
118 #endif //MOVELIST_TEXTUAL_H