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

libkdegames

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
kgameclock.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE games library
3  Copyright (C) 2007 Mauricio Piacentini (mauricio@tabuleiro.com)
4  Portions reused from KGameLCDClock
5  Copyright (C) 2001,2002,2003 Nicolas Hadacek (hadacek@kde.org)
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License version 2 as published by the Free Software Foundation.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef __KGAMECLOCK_H
23 #define __KGAMECLOCK_H
24 
25 #include <QtCore/QObject>
26 #include <libkdegames_export.h>
27 
28 class KGameClockPrivate;
29 
35 class KDEGAMES_EXPORT KGameClock : public QObject
36 {
37  Q_OBJECT
38 public:
39  enum ClockType { HourMinSec = 0, MinSecOnly };
40 
44  explicit KGameClock(QObject *parent = 0, ClockType clocktype = HourMinSec);
45 
46  virtual ~KGameClock();
47 
51  uint seconds() const;
52 
56  QString timeString() const;
57 
61  void setTime(uint seconds);
62 
66  void setTime(const QString &s);
67 
71  void showTime();
72 
73 Q_SIGNALS:
74  void timeChanged(const QString &);
75 
76 public Q_SLOTS:
80  virtual void restart();
81 
85  virtual void pause();
86 
90  virtual void resume();
91 
92 protected Q_SLOTS:
93  virtual void timeoutClock();
94 
95 private:
96  friend class KGameClockPrivate;
97  KGameClockPrivate *const d;
98 
99  Q_DISABLE_COPY(KGameClock)
100 };
101 
102 #endif
KStandardGameAction::restart
KDEGAMES_EXPORT KAction * restart(const QObject *recvr, const char *slot, QObject *parent)
Restart the game.
Definition: kstandardgameaction.cpp:225
libkdegames_export.h
KStandardGameAction::pause
KDEGAMES_EXPORT KToggleAction * pause(const QObject *recvr, const char *slot, QObject *parent)
Pause the game.
Definition: kstandardgameaction.cpp:170
KGameClock::ClockType
ClockType
Definition: kgameclock.h:39
KDEGAMES_EXPORT
#define KDEGAMES_EXPORT
Definition: libkdegames_export.h:32
QObject
QString
KGameClock
Class representing a game clock, wraps after 24 hours.
Definition: kgameclock.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames

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

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