• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

KGameClock Class Reference

#include <kgameclock.h>

Inheritance diagram for KGameClock:

Inheritance graph
[legend]

List of all members.


Detailed Description

Class representing a game clock, wraps after 24 hours.

Definition at line 33 of file kgameclock.h.


Public Types

enum  ClockType { HourMinSec = 0, MinSecOnly }

Public Slots

virtual void restart ()
virtual void pause ()
virtual void resume ()

Signals

void timeChanged (const QString &)

Public Member Functions

 KGameClock (QObject *parent=0, ClockType clocktype=HourMinSec)
virtual ~KGameClock ()
uint seconds () const
QString timeString () const
void setTime (uint seconds)
void setTime (const QString &s)
void showTime ()

Protected Slots

virtual void timeoutClock ()

Friends

class KGameClockPrivate

Member Enumeration Documentation

enum KGameClock::ClockType

Enumerator:
HourMinSec 
MinSecOnly 

Definition at line 37 of file kgameclock.h.


Constructor & Destructor Documentation

KGameClock::KGameClock ( QObject *  parent = 0,
KGameClock::ClockType  clocktype = HourMinSec 
) [explicit]

Returns:
Constructor

Definition at line 40 of file kgameclock.cpp.

KGameClock::~KGameClock (  )  [virtual]

Definition at line 48 of file kgameclock.cpp.


Member Function Documentation

uint KGameClock::seconds (  )  const

Returns:
the total number of seconds elapsed.

Definition at line 103 of file kgameclock.cpp.

QString KGameClock::timeString (  )  const

Returns:
the time as a string to be displayed: "mm:ss" or "hh:mm:ss" depending on clock type.

Definition at line 68 of file kgameclock.cpp.

void KGameClock::setTime ( uint  seconds  ) 

Set the time.

Definition at line 108 of file kgameclock.cpp.

void KGameClock::setTime ( const QString &  s  ) 

Set the time (format should be "hh:mm:ss").

Definition at line 117 of file kgameclock.cpp.

void KGameClock::showTime (  ) 

Refresh.

Definition at line 78 of file kgameclock.cpp.

void KGameClock::timeChanged ( const QString &   )  [signal]

void KGameClock::restart (  )  [virtual, slot]

Reset the clock and start again from zero.

Definition at line 83 of file kgameclock.cpp.

void KGameClock::pause (  )  [virtual, slot]

Pause the clock.

Definition at line 98 of file kgameclock.cpp.

void KGameClock::resume (  )  [virtual, slot]

Resume counting time from the current position.

Definition at line 93 of file kgameclock.cpp.

void KGameClock::timeoutClock (  )  [protected, virtual, slot]

Definition at line 53 of file kgameclock.cpp.


Friends And Related Function Documentation

friend class KGameClockPrivate [friend]

Definition at line 94 of file kgameclock.h.


The documentation for this class was generated from the following files:
  • kgameclock.h
  • kgameclock.cpp

libkdegames

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

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal