diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/DkClockData.h |
Initial commit
Diffstat (limited to 'support/dktools/DkClockData.h')
-rw-r--r-- | support/dktools/DkClockData.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/support/dktools/DkClockData.h b/support/dktools/DkClockData.h new file mode 100644 index 0000000000..2a8c8152fb --- /dev/null +++ b/support/dktools/DkClockData.h @@ -0,0 +1,98 @@ +/* + WARNING: This file was generated by dkct. + Changes you make here will be lost if dkct is run again! + You should modify the original source and run dkct on it. + Original source: DkClockData.cpt +*/ + +/** @file DkClockData.h Header file for the DkClockData module. +*/ + +#ifndef DKCLOCKDATA_H_INCLUDED +/** Avoid multiple inclusions. */ +#define DKCLOCKDATA_H_INCLUDED 1 + + +#line 4 "DkClockData.cpt" + +/** Data of interest for the DkClockView class. +*/ +typedef struct { + int h; /**< Current hour. */ + int m; /**< Current minute. */ + int s; /**< Current second. */ + int a; /**< Flag: In alert. */ +} clockview_data_t; + +/** Data for DkClock. +*/ +class DkClockData +{ + protected: + + /** Protect data against concurrent access. + */ + wxMutex mxProtectData; + + /** Current time. + */ + dk3_tm_t tmCurrent; + + /** Output data structure. + */ + clockview_data_t clvd; + + /** Hour of alert. + */ + int iAlertHour; + + /** Minute of alert. + */ + int iAlertMinute; + + /** Flag: Alert enabled. + */ + int iAlertEnabled; + + /** Alert state (0=before alert, 1=in alert, 2=after alert). + */ + int iAlertState; + + public: + + /** Constructor. + */ + DkClockData(); + + /** Retrieve data from object into buffer. + @param dptr Buffer pointer. + */ + void getData(clockview_data_t *dptr); + + /** Get alert settings. + @param en Pointer to enabled variable. + @param h Pointer to hour variable. + @param m Pointer to minute variable. + */ + void getAlertData(int *en, int *h, int *m); + + /** Set new current time. + @param ct Current time. + @return 1 to maximize and raise the window, 0 to do nothing. + */ + int setTime(dk3_time_t *ct); + + /** Enable or disable alert, set time when enabling. + @param flag Flag to enable or disable alert. + @param hour Hour of alert. + @param min Minute of alert. + */ + void setAlert(bool flag, int hour, int min); + + /** End a running alert. + */ + void endAlert(void); +}; + + +#endif |