diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /libksirtet/lib/pline.h | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/lib/pline.h')
-rw-r--r-- | libksirtet/lib/pline.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/libksirtet/lib/pline.h b/libksirtet/lib/pline.h new file mode 100644 index 00000000..2defd10a --- /dev/null +++ b/libksirtet/lib/pline.h @@ -0,0 +1,112 @@ +#ifndef PLINE_H +#define PLINE_H + +#include <qframe.h> +#include <qscrollbar.h> +#include <qlineedit.h> +#include <qlabel.h> +#include <qptrlist.h> +#include <qlayout.h> + +#include "types.h" + +class QPushButton; + +/** Internal class : display a "player line" in netmeeting. */ +class MeetingLine : public QFrame +{ + Q_OBJECT + + public: + MeetingLine(bool isOwner, bool readerIsServer, bool serverLine, + QWidget *parent, const char *name = 0); + + MeetingCheckBox::Type type() const { return tcb->type(); } + void setType(MeetingCheckBox::Type type) { tcb->setType(type); } + void setText(const QString &text) { qle->setText(text); } + + void setData(const ExtData &ed); + void data(ExtData &ed) const; + QString text() const { return qle->text(); } + + signals: + void typeChanged(MeetingCheckBox::Type); + void textChanged(const QString &); + + private slots: + void _typeChanged(int t) + { emit typeChanged((MeetingCheckBox::Type)t); } + void _textChanged(const QString &text) { emit textChanged(text); } + + protected: + QHBoxLayout *hbl; + + private: + MeetingCheckBox *tcb; + QLabel *lname, *labH, *labAI; + QValueList<BoardData> bds; + QLineEdit *qle; +}; + +class PlayerLine : public QFrame +{ + Q_OBJECT + + public: + PlayerLine(PlayerComboBox::Type type, const QString &txt, + bool humanSetting, bool AISetting, + bool canBeEmpty, bool acceptAI, + QWidget *parent = 0, const char *name = 0); + + PlayerComboBox::Type type() const { return pcb->type(); } + QString name() const { return edit->text(); } + + signals: + void setHuman(); + void setAI(); + void typeChanged(int); + + private slots: + void setSlot(); + void typeChangedSlot(int); + + private: + PlayerComboBox *pcb; + QLineEdit *edit; + QPushButton *setting; + bool hs, as; +}; + +/** Internal class : scrolable list of widgets. */ +class GWidgetList : public QWidget +{ + Q_OBJECT + + public: + GWidgetList(uint interval, QWidget *parent = 0, const char * name = 0); + + void remove(uint i); + uint size() const { return widgets.count(); } + + protected: + /** The widget must be created with this widget as parent. */ + void append(QWidget *); + QWidget *widget(uint i) { return widgets.at(i); } + + private: + QPtrList<QWidget> widgets; + QVBoxLayout vbl; +}; + +template <class Type> +class WidgetList : public GWidgetList +{ + public: + WidgetList(uint interval, QWidget *parent=0, const char *name=0) + : GWidgetList(interval, parent, name) {} + + void append(Type *w) { GWidgetList::append(w); } + Type *widget(uint i) { return (Type *)GWidgetList::widget(i); } +}; + +#endif // PLINE_H |