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

libtdegames

  • libtdegames
  • highscore
kexthighscore_gui.h
1 /*
2  This file is part of the TDE games library
3  Copyright (C) 2001-02 Nicolas Hadacek (hadacek@kde.org)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KEXTHIGHSCORE_GUI_H
21 #define KEXTHIGHSCORE_GUI_H
22 
23 #include <tqcheckbox.h>
24 #include <tqlabel.h>
25 #include <tqvbox.h>
26 #include <tqtabwidget.h>
27 
28 #include <tdelistview.h>
29 #include <klineedit.h>
30 #include <kpushbutton.h>
31 #include <kdialogbase.h>
32 
33 #include "kexthighscore.h"
34 
35 
36 namespace KExtHighscore
37 {
38 
39 class ItemContainer;
40 class ItemArray;
41 class Score;
42 class AdditionalTab;
43 
44 //-----------------------------------------------------------------------------
45 class ShowItem : public TDEListViewItem
46 {
47  public:
48  ShowItem(TQListView *, bool highlight);
49 
50  protected:
51  virtual void paintCell(TQPainter *, const TQColorGroup &, int column,
52  int width, int align);
53 
54  private:
55  bool _highlight;
56 };
57 
58 class ScoresList : public TDEListView
59 {
60  TQ_OBJECT
61 
62  public:
63  ScoresList(TQWidget *parent);
64 
65  void addHeader(const ItemArray &);
66 
67  protected:
68  TQListViewItem *addLine(const ItemArray &, uint index, bool highlight);
69  virtual TQString itemText(const ItemContainer &, uint row) const = 0;
70 
71  private:
72  virtual void addLineItem(const ItemArray &, uint index,
73  TQListViewItem *item);
74 };
75 
76 //-----------------------------------------------------------------------------
77 class HighscoresList : public ScoresList
78 {
79  TQ_OBJECT
80 
81  public:
82  HighscoresList(TQWidget *parent);
83 
84  void load(const ItemArray &, int highlight);
85 
86  protected:
87  TQString itemText(const ItemContainer &, uint row) const;
88 };
89 
90 class HighscoresWidget : public TQWidget
91 {
92  TQ_OBJECT
93 
94  public:
95  HighscoresWidget(TQWidget *parent);
96 
97  void load(int rank);
98 
99  signals:
100  void tabChanged(int i);
101 
102  public slots:
103  void changeTab(int i);
104 
105  private slots:
106  void showURL(const TQString &) const;
107  void tabChanged() { emit tabChanged(_tw->currentPageIndex()); }
108 
109  private:
110  TQTabWidget *_tw;
111  HighscoresList *_scoresList, *_playersList;
112  KURLLabel *_scoresUrl, *_playersUrl;
113  AdditionalTab *_statsTab, *_histoTab;
114 };
115 
116 class HighscoresDialog : public KDialogBase
117 {
118  TQ_OBJECT
119 
120  public:
121  HighscoresDialog(int rank, TQWidget *parent);
122 
123  private slots:
124  void slotUser1();
125  void slotUser2();
126  void tabChanged(int i) { _tab = i; }
127  void createPage(TQWidget *);
128 
129  private:
130  int _rank, _tab;
131  TQWidget *_current;
132  TQValueVector<HighscoresWidget *> _widgets;
133 };
134 
135 //-----------------------------------------------------------------------------
136 class LastMultipleScoresList : public ScoresList
137 {
138  TQ_OBJECT
139 
140 public:
141  LastMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent);
142 
143 private:
144  void addLineItem(const ItemArray &, uint index, TQListViewItem *line);
145  TQString itemText(const ItemContainer &, uint row) const;
146 
147 private:
148  const TQValueVector<Score> &_scores;
149 };
150 
151 class TotalMultipleScoresList : public ScoresList
152 {
153  TQ_OBJECT
154 
155 public:
156  TotalMultipleScoresList(const TQValueVector<Score> &, TQWidget *parent);
157 
158 private:
159  void addLineItem(const ItemArray &, uint index, TQListViewItem *line);
160  TQString itemText(const ItemContainer &, uint row) const;
161 
162 private:
163  const TQValueVector<Score> &_scores;
164 };
165 
166 //-----------------------------------------------------------------------------
167 class ConfigDialog : public KDialogBase
168 {
169  TQ_OBJECT
170 
171  public:
172  ConfigDialog(TQWidget *parent);
173 
174  bool hasBeenSaved() const { return _saved; }
175 
176  private slots:
177  void modifiedSlot();
178  void removeSlot();
179  void accept();
180  void slotApply() { save(); }
181  void nickNameChanged(const TQString &);
182 
183  private:
184  bool _saved;
185  TQCheckBox *_WWHEnabled;
186  TQLineEdit *_nickname, *_comment;
187  KLineEdit *_key, *_registeredName;
188  KPushButton *_removeButton;
189 
190  void load();
191  bool save();
192 };
193 
194 //-----------------------------------------------------------------------------
195 class AskNameDialog : public KDialogBase
196 {
197  TQ_OBJECT
198 
199  public:
200  AskNameDialog(TQWidget *parent);
201 
202  TQString name() const { return _edit->text(); }
203  bool dontAskAgain() const { return _checkbox->isChecked(); }
204 
205  private slots:
206  void nameChanged();
207 
208  private:
209  TQLineEdit *_edit;
210  TQCheckBox *_checkbox;
211 };
212 
213 } // namespace
214 
215 #endif
KExtHighscore
Definition: kexthighscore.cpp:30

libtdegames

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

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.8.13
This website is maintained by Timothy Pearson.