• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkdegames
 

libkdegames

kexthighscore_gui.h

00001 /*
00002     This file is part of the KDE games library
00003     Copyright (C) 2001-02 Nicolas Hadacek (hadacek@kde.org)
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License version 2 as published by the Free Software Foundation.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KEXTHIGHSCORE_GUI_H
00021 #define KEXTHIGHSCORE_GUI_H
00022 
00023 #include <tqcheckbox.h>
00024 #include <tqlabel.h>
00025 #include <tqvbox.h>
00026 #include <tqtabwidget.h>
00027 
00028 #include <klistview.h>
00029 #include <klineedit.h>
00030 #include <kpushbutton.h>
00031 #include <kdialogbase.h>
00032 
00033 #include "kexthighscore.h"
00034 
00035 
00036 namespace KExtHighscore
00037 {
00038 
00039 class ItemContainer;
00040 class ItemArray;
00041 class Score;
00042 class AdditionalTab;
00043 
00044 //-----------------------------------------------------------------------------
00045 class ShowItem : public KListViewItem
00046 {
00047  public:
00048     ShowItem(TQListView *, bool highlight);
00049 
00050  protected:
00051     virtual void paintCell(TQPainter *, const TQColorGroup &, int column,
00052                            int width, int align);
00053 
00054  private:
00055     bool _highlight;
00056 };
00057 
00058 class ScoresList : public KListView
00059 {
00060  Q_OBJECT
00061   TQ_OBJECT
00062  public:
00063     ScoresList(TQWidget *parent);
00064 
00065     void addHeader(const ItemArray &);
00066 
00067  protected:
00068     TQListViewItem *addLine(const ItemArray &, uint index, bool highlight);
00069     virtual TQString itemText(const ItemContainer &, uint row) const = 0;
00070 
00071  private:
00072     virtual void addLineItem(const ItemArray &, uint index,
00073                              TQListViewItem *item);
00074 };
00075 
00076 //-----------------------------------------------------------------------------
00077 class HighscoresList : public ScoresList
00078 {
00079  Q_OBJECT
00080   TQ_OBJECT
00081  public:
00082     HighscoresList(TQWidget *parent);
00083 
00084     void load(const ItemArray &, int highlight);
00085 
00086  protected:
00087     TQString itemText(const ItemContainer &, uint row) const;
00088 };
00089 
00090 class HighscoresWidget : public TQWidget
00091 {
00092  Q_OBJECT
00093   TQ_OBJECT
00094  public:
00095     HighscoresWidget(TQWidget *parent);
00096 
00097     void load(int rank);
00098 
00099  signals:
00100     void tabChanged(int i);
00101 
00102  public slots:
00103     void changeTab(int i);
00104 
00105  private slots:
00106     void showURL(const TQString &) const;
00107     void tabChanged() { emit tabChanged(_tw->currentPageIndex()); }
00108 
00109  private:
00110     TQTabWidget     *_tw;
00111     HighscoresList *_scoresList, *_playersList;
00112     KURLLabel      *_scoresUrl, *_playersUrl;
00113     AdditionalTab  *_statsTab, *_histoTab;
00114 };
00115 
00116 class HighscoresDialog : public KDialogBase
00117 {
00118  Q_OBJECT
00119   TQ_OBJECT
00120  public:
00121     HighscoresDialog(int rank, TQWidget *parent);
00122 
00123  private slots:
00124     void slotUser1();
00125     void slotUser2();
00126     void tabChanged(int i) { _tab = i; }
00127     void createPage(TQWidget *);
00128 
00129  private:
00130     int _rank, _tab;
00131     TQWidget *_current;
00132     TQValueVector<HighscoresWidget *> _widgets;
00133 };
00134 
00135 //-----------------------------------------------------------------------------
00136 class LastMultipleScoresList : public ScoresList
00137 {
00138     Q_OBJECT
00139   TQ_OBJECT
00140 public:
00141     LastMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent);
00142 
00143 private:
00144     void addLineItem(const ItemArray &, uint index, TQListViewItem *line);
00145     TQString itemText(const ItemContainer &, uint row) const;
00146 
00147 private:
00148     const TQValueVector<Score> &_scores;
00149 };
00150 
00151 class TotalMultipleScoresList : public ScoresList
00152 {
00153     Q_OBJECT
00154   TQ_OBJECT
00155 public:
00156     TotalMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent);
00157 
00158 private:
00159     void addLineItem(const ItemArray &, uint index, TQListViewItem *line);
00160     TQString itemText(const ItemContainer &, uint row) const;
00161 
00162 private:
00163     const TQValueVector<Score> &_scores;
00164 };
00165 
00166 //-----------------------------------------------------------------------------
00167 class ConfigDialog : public KDialogBase
00168 {
00169  Q_OBJECT
00170   TQ_OBJECT
00171  public:
00172     ConfigDialog(TQWidget *parent);
00173 
00174     bool hasBeenSaved() const { return _saved; }
00175 
00176  private slots:
00177     void modifiedSlot();
00178     void removeSlot();
00179     void accept();
00180     void slotApply() { save(); }
00181     void nickNameChanged(const TQString &);
00182 
00183  private:
00184     bool         _saved;
00185     TQCheckBox   *_WWHEnabled;
00186     TQLineEdit   *_nickname, *_comment;
00187     KLineEdit   *_key, *_registeredName;
00188     KPushButton *_removeButton;
00189 
00190     void load();
00191     bool save();
00192 };
00193 
00194 //-----------------------------------------------------------------------------
00195 class AskNameDialog : public KDialogBase
00196 {
00197  Q_OBJECT
00198   TQ_OBJECT
00199  public:
00200     AskNameDialog(TQWidget *parent);
00201 
00202     TQString name() const { return _edit->text(); }
00203     bool dontAskAgain() const { return _checkbox->isChecked(); }
00204 
00205  private slots:
00206     void nameChanged();
00207 
00208  private:
00209     TQLineEdit *_edit;
00210     TQCheckBox *_checkbox;
00211 };
00212 
00213 } // namespace
00214 
00215 #endif

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkdegames

Skip menu "libkdegames"
  • libkdegames
Generated for libkdegames by doxygen 1.7.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |