1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-06-30 21:02:21 +03:00
gmenu2x/src/clock.h

33 lines
565 B
C
Raw Normal View History

2013-07-22 06:54:09 +03:00
#ifndef __CLOCK_H__
#define __CLOCK_H__
#include <memory>
2013-07-22 06:54:09 +03:00
#include <string>
/**
* A keeper of wall clock time with minute accuracy.
* Sends a user event on every minute boundary, to force a repaint of the
* clock display.
*/
2013-07-22 06:54:09 +03:00
class Clock {
public:
/**
* Used by implementation; please ignore.
*/
class Timer;
Clock();
2013-07-22 06:54:09 +03:00
/**
* Gets a string representation of the current time.
* Uses 24-hour format if is24 is true, otherwise AM/PM.
*/
std::string getTime(bool is24 = true);
2013-07-22 06:54:09 +03:00
private:
std::shared_ptr<Timer> timer;
2013-07-22 06:54:09 +03:00
};
#endif /* __CLOCK_H__ */