• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kigo

  • sources
  • kde-4.14
  • kdegames
  • kigo
  • src
preferences.h
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from kigo.kcfg.
2 // All changes you do to this file will be lost.
3 #ifndef PREFERENCES_H
4 #define PREFERENCES_H
5 
6 #include <kconfigskeleton.h>
7 #include <kdebug.h>
8 
9 class Preferences : public KConfigSkeleton
10 {
11  public:
12 
13  static Preferences *self();
14  ~Preferences();
15 
19  static
20  void setEngineCommand( const QString & v )
21  {
22  if (!self()->isImmutable( QString::fromLatin1( "EngineCommand" ) ))
23  self()->mEngineCommand = v;
24  }
25 
29  static
30  QString engineCommand()
31  {
32  return self()->mEngineCommand;
33  }
34 
38  static
39  void setEngineWorking( bool v )
40  {
41  if (!self()->isImmutable( QString::fromLatin1( "EngineWorking" ) ))
42  self()->mEngineWorking = v;
43  }
44 
48  static
49  bool engineWorking()
50  {
51  return self()->mEngineWorking;
52  }
53 
57  static
58  void setTheme( const QString & v )
59  {
60  if (!self()->isImmutable( QString::fromLatin1( "Theme" ) ))
61  self()->mTheme = v;
62  }
63 
67  static
68  QString theme()
69  {
70  return self()->mTheme;
71  }
72 
76  static
77  void setShowBoardLabels( bool v )
78  {
79  if (!self()->isImmutable( QString::fromLatin1( "ShowBoardLabels" ) ))
80  self()->mShowBoardLabels = v;
81  }
82 
86  static
87  bool showBoardLabels()
88  {
89  return self()->mShowBoardLabels;
90  }
91 
95  static
96  void setShowMoveNumbers( bool v )
97  {
98  if (!self()->isImmutable( QString::fromLatin1( "ShowMoveNumbers" ) ))
99  self()->mShowMoveNumbers = v;
100  }
101 
105  static
106  bool showMoveNumbers()
107  {
108  return self()->mShowMoveNumbers;
109  }
110 
114  static
115  void setHintVisibleTime( double v )
116  {
117  if (v < 1.0)
118  {
119  kDebug() << "setHintVisibleTime: value " << v << " is less than the minimum value of 1.0";
120  v = 1.0;
121  }
122 
123  if (v > 5.0)
124  {
125  kDebug() << "setHintVisibleTime: value " << v << " is greater than the maximum value of 5.0";
126  v = 5.0;
127  }
128 
129  if (!self()->isImmutable( QString::fromLatin1( "HintVisibleTime" ) ))
130  self()->mHintVisibleTime = v;
131  }
132 
136  static
137  double hintVisibleTime()
138  {
139  return self()->mHintVisibleTime;
140  }
141 
145  static
146  void setBlackPlayerHuman( bool v )
147  {
148  if (!self()->isImmutable( QString::fromLatin1( "BlackPlayerHuman" ) ))
149  self()->mBlackPlayerHuman = v;
150  }
151 
155  static
156  bool blackPlayerHuman()
157  {
158  return self()->mBlackPlayerHuman;
159  }
160 
164  static
165  void setBlackPlayerName( const QString & v )
166  {
167  if (!self()->isImmutable( QString::fromLatin1( "BlackPlayerName" ) ))
168  self()->mBlackPlayerName = v;
169  }
170 
174  static
175  QString blackPlayerName()
176  {
177  return self()->mBlackPlayerName;
178  }
179 
183  static
184  void setBlackPlayerStrength( int v )
185  {
186  if (v < 1)
187  {
188  kDebug() << "setBlackPlayerStrength: value " << v << " is less than the minimum value of 1";
189  v = 1;
190  }
191 
192  if (v > 10)
193  {
194  kDebug() << "setBlackPlayerStrength: value " << v << " is greater than the maximum value of 10";
195  v = 10;
196  }
197 
198  if (!self()->isImmutable( QString::fromLatin1( "BlackPlayerStrength" ) ))
199  self()->mBlackPlayerStrength = v;
200  }
201 
205  static
206  int blackPlayerStrength()
207  {
208  return self()->mBlackPlayerStrength;
209  }
210 
214  static
215  void setWhitePlayerHuman( bool v )
216  {
217  if (!self()->isImmutable( QString::fromLatin1( "WhitePlayerHuman" ) ))
218  self()->mWhitePlayerHuman = v;
219  }
220 
224  static
225  bool whitePlayerHuman()
226  {
227  return self()->mWhitePlayerHuman;
228  }
229 
233  static
234  void setWhitePlayerName( const QString & v )
235  {
236  if (!self()->isImmutable( QString::fromLatin1( "WhitePlayerName" ) ))
237  self()->mWhitePlayerName = v;
238  }
239 
243  static
244  QString whitePlayerName()
245  {
246  return self()->mWhitePlayerName;
247  }
248 
252  static
253  void setWhitePlayerStrength( int v )
254  {
255  if (v < 1)
256  {
257  kDebug() << "setWhitePlayerStrength: value " << v << " is less than the minimum value of 1";
258  v = 1;
259  }
260 
261  if (v > 10)
262  {
263  kDebug() << "setWhitePlayerStrength: value " << v << " is greater than the maximum value of 10";
264  v = 10;
265  }
266 
267  if (!self()->isImmutable( QString::fromLatin1( "WhitePlayerStrength" ) ))
268  self()->mWhitePlayerStrength = v;
269  }
270 
274  static
275  int whitePlayerStrength()
276  {
277  return self()->mWhitePlayerStrength;
278  }
279 
283  static
284  void setBoardSize( int v )
285  {
286  if (v < 3)
287  {
288  kDebug() << "setBoardSize: value " << v << " is less than the minimum value of 3";
289  v = 3;
290  }
291 
292  if (v > 19)
293  {
294  kDebug() << "setBoardSize: value " << v << " is greater than the maximum value of 19";
295  v = 19;
296  }
297 
298  if (!self()->isImmutable( QString::fromLatin1( "BoardSize" ) ))
299  self()->mBoardSize = v;
300  }
301 
305  static
306  int boardSize()
307  {
308  return self()->mBoardSize;
309  }
310 
314  static
315  void setKomi( double v )
316  {
317  if (v < 0)
318  {
319  kDebug() << "setKomi: value " << v << " is less than the minimum value of 0";
320  v = 0;
321  }
322 
323  if (v > 50)
324  {
325  kDebug() << "setKomi: value " << v << " is greater than the maximum value of 50";
326  v = 50;
327  }
328 
329  if (!self()->isImmutable( QString::fromLatin1( "Komi" ) ))
330  self()->mKomi = v;
331  }
332 
336  static
337  double komi()
338  {
339  return self()->mKomi;
340  }
341 
345  static
346  void setFixedHandicapValue( int v )
347  {
348  if (v < 2)
349  {
350  kDebug() << "setFixedHandicapValue: value " << v << " is less than the minimum value of 2";
351  v = 2;
352  }
353 
354  if (v > 9)
355  {
356  kDebug() << "setFixedHandicapValue: value " << v << " is greater than the maximum value of 9";
357  v = 9;
358  }
359 
360  if (!self()->isImmutable( QString::fromLatin1( "FixedHandicapValue" ) ))
361  self()->mFixedHandicapValue = v;
362  }
363 
367  static
368  int fixedHandicapValue()
369  {
370  return self()->mFixedHandicapValue;
371  }
372 
373  protected:
374  Preferences();
375  friend class PreferencesHelper;
376 
377 
378  // Backend
379  QString mEngineCommand;
380  bool mEngineWorking;
381 
382  // UserInterface
383  QString mTheme;
384  bool mShowBoardLabels;
385  bool mShowMoveNumbers;
386  double mHintVisibleTime;
387 
388  // Game
389  bool mBlackPlayerHuman;
390  QString mBlackPlayerName;
391  int mBlackPlayerStrength;
392  bool mWhitePlayerHuman;
393  QString mWhitePlayerName;
394  int mWhitePlayerStrength;
395  int mBoardSize;
396  double mKomi;
397  int mFixedHandicapValue;
398 
399  private:
400 };
401 
402 #endif
403 
Preferences::setWhitePlayerHuman
static void setWhitePlayerHuman(bool v)
Set Is white a human player?
Definition: preferences.h:215
Preferences::blackPlayerName
static QString blackPlayerName()
Get The name of the black player.
Definition: preferences.h:175
Preferences::mHintVisibleTime
double mHintVisibleTime
Definition: preferences.h:386
Preferences::mBoardSize
int mBoardSize
Definition: preferences.h:395
Preferences::setBlackPlayerHuman
static void setBlackPlayerHuman(bool v)
Set Is black a human player?
Definition: preferences.h:146
Preferences::mTheme
QString mTheme
Definition: preferences.h:383
Preferences::setHintVisibleTime
static void setHintVisibleTime(double v)
Set Number of seconds for which a hint is visible.
Definition: preferences.h:115
Preferences::~Preferences
~Preferences()
Definition: preferences.cpp:99
Preferences::Preferences
Preferences()
Definition: preferences.cpp:27
Preferences::showBoardLabels
static bool showBoardLabels()
Get Determines whether board labels are shown.
Definition: preferences.h:87
Preferences::mBlackPlayerHuman
bool mBlackPlayerHuman
Definition: preferences.h:389
Preferences::hintVisibleTime
static double hintVisibleTime()
Get Number of seconds for which a hint is visible.
Definition: preferences.h:137
Preferences::mEngineCommand
QString mEngineCommand
Definition: preferences.h:379
Preferences::mBlackPlayerStrength
int mBlackPlayerStrength
Definition: preferences.h:391
Preferences::setFixedHandicapValue
static void setFixedHandicapValue(int v)
Set Extra stones for the black player.
Definition: preferences.h:346
Preferences::setEngineCommand
static void setEngineCommand(const QString &v)
Set The current game engine command with (optional) parameters.
Definition: preferences.h:20
Preferences::blackPlayerStrength
static int blackPlayerStrength()
Get The strength of the black player.
Definition: preferences.h:206
KConfigSkeleton
Preferences::setWhitePlayerStrength
static void setWhitePlayerStrength(int v)
Set The strength of the white player.
Definition: preferences.h:253
Preferences::setKomi
static void setKomi(double v)
Set Komi.
Definition: preferences.h:315
Preferences::setBlackPlayerStrength
static void setBlackPlayerStrength(int v)
Set The strength of the black player.
Definition: preferences.h:184
Preferences::mWhitePlayerStrength
int mWhitePlayerStrength
Definition: preferences.h:394
Preferences::mShowMoveNumbers
bool mShowMoveNumbers
Definition: preferences.h:385
Preferences::setBoardSize
static void setBoardSize(int v)
Set Go board size.
Definition: preferences.h:284
Preferences::mWhitePlayerHuman
bool mWhitePlayerHuman
Definition: preferences.h:392
Preferences::setBlackPlayerName
static void setBlackPlayerName(const QString &v)
Set The name of the black player.
Definition: preferences.h:165
Preferences::mShowBoardLabels
bool mShowBoardLabels
Definition: preferences.h:384
Preferences::setTheme
static void setTheme(const QString &v)
Set The graphical theme to be used.
Definition: preferences.h:58
QString
Preferences::blackPlayerHuman
static bool blackPlayerHuman()
Get Is black a human player?
Definition: preferences.h:156
Preferences::mFixedHandicapValue
int mFixedHandicapValue
Definition: preferences.h:397
Preferences::engineWorking
static bool engineWorking()
Get EngineWorking.
Definition: preferences.h:49
Preferences::komi
static double komi()
Get Komi.
Definition: preferences.h:337
Preferences::fixedHandicapValue
static int fixedHandicapValue()
Get Extra stones for the black player.
Definition: preferences.h:368
Preferences::PreferencesHelper
friend class PreferencesHelper
Definition: preferences.h:375
Preferences::theme
static QString theme()
Get The graphical theme to be used.
Definition: preferences.h:68
Preferences::mWhitePlayerName
QString mWhitePlayerName
Definition: preferences.h:393
Preferences::whitePlayerStrength
static int whitePlayerStrength()
Get The strength of the white player.
Definition: preferences.h:275
Preferences::showMoveNumbers
static bool showMoveNumbers()
Get Move numbers are drawn onto stones if enabled.
Definition: preferences.h:106
QString::fromLatin1
QString fromLatin1(const char *str, int size)
Preferences::setWhitePlayerName
static void setWhitePlayerName(const QString &v)
Set The name of the white player.
Definition: preferences.h:234
Preferences::engineCommand
static QString engineCommand()
Get The current game engine command with (optional) parameters.
Definition: preferences.h:30
Preferences::setShowBoardLabels
static void setShowBoardLabels(bool v)
Set Determines whether board labels are shown.
Definition: preferences.h:77
Preferences
Definition: preferences.h:9
Preferences::setShowMoveNumbers
static void setShowMoveNumbers(bool v)
Set Move numbers are drawn onto stones if enabled.
Definition: preferences.h:96
Preferences::mKomi
double mKomi
Definition: preferences.h:396
Preferences::whitePlayerHuman
static bool whitePlayerHuman()
Get Is white a human player?
Definition: preferences.h:225
Preferences::mEngineWorking
bool mEngineWorking
Definition: preferences.h:380
Preferences::mBlackPlayerName
QString mBlackPlayerName
Definition: preferences.h:390
Preferences::boardSize
static int boardSize()
Get Go board size.
Definition: preferences.h:306
Preferences::setEngineWorking
static void setEngineWorking(bool v)
Set EngineWorking.
Definition: preferences.h:39
Preferences::whitePlayerName
static QString whitePlayerName()
Get The name of the white player.
Definition: preferences.h:244
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kigo

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

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal