1 /*----------------------------------------------------------------------------
2 --
3 --  Module:           xtmReminder
4 --
5 --  Project:          Xdiary
6 --  System:           xtm - X Desktop Calendar
7 --    Subsystem:      <>
8 --    Function block: <>
9 --
10 --  Description:
11 --    Interface file for module xtmReminder
12 --
13 --  Filename:         xtmReminder.h
14 --
15 --  Authors:          Roger Larsson, Ulrika Bornetun
16 --  Creation date:    1992-02-16
17 --
18 --
19 --  (C) Copyright Ulrika Bornetun, Roger Larsson (1995)
20 --      All rights reserved
21 --
22 --  Permission to use, copy, modify, and distribute this software and its
23 --  documentation for any purpose and without fee is hereby granted,
24 --  provided that the above copyright notice appear in all copies. Ulrika
25 --  Bornetun and Roger Larsson make no representations about the usability
26 --  of this software for any purpose. It is provided "as is" without express
27 --  or implied warranty.
28 ----------------------------------------------------------------------------*/
29 
30 /* SCCS module identifier. */
31 /* SCCSID = @(#) Module: xtmReminder.h, Version: 1.1, Date: 95/02/18 15:52:41 */
32 
33 
34 /* Include this module only once. */
35 #ifndef define_xtmReminder_h
36 #  define define_xtmReminder_h
37 
38 
39 /*----------------------------------------------------------------------------
40 --  Include files
41 ----------------------------------------------------------------------------*/
42 
43 #include "TimDate.h"
44 
45 
46 /*----------------------------------------------------------------------------
47 --  Macro definitions
48 ----------------------------------------------------------------------------*/
49 
50 /* Max length of the alarm text. */
51 #define  XTM_RD_MAX_ALARM_TEXT    300
52 
53 /* Max number of alarms we can have. */
54 #define  XTM_RD_MAX_ALARMS        5
55 
56 
57 /*----------------------------------------------------------------------------
58 --  Type declarations
59 ----------------------------------------------------------------------------*/
60 
61 /* Reference to reminder record. */
62 typedef struct xtm_rd_reminder  *XTM_RD_REMINDER_REF;
63 
64 
65 /* Callback when Close Window is selected. */
66 typedef void ( *XTM_RD_CLOSE_CB ) (Widget, void *, void * );
67 
68 
69 /* Callback when Help Button is selected. */
70 typedef void ( *XTM_RD_HELP_CB ) (Widget, void *, int );
71 
72 
73 /* Definitions for one single alarm. */
74 typedef struct {
75   Boolean       active;
76   TIM_TIME_REF  alarm_time;
77   char          text[ XTM_RD_MAX_ALARM_TEXT + 1 ];
78 } XTM_RD_ALARM_INFO;
79 
80 
81 /* Data for the reminder. */
82 typedef struct xtm_rd_reminder {
83   Boolean            sliderCB_active;
84   int                curr_work_alarm;
85   char               empty_time;
86   void               *user_data;
87   Widget             reminderW;
88   Widget             toplevel;
89   XtAppContext       context;
90   XTM_RD_ALARM_INFO  alarm[ XTM_RD_MAX_ALARMS ];
91   XTM_RD_CLOSE_CB    closeCB;
92   XTM_RD_HELP_CB     helpCB;
93 } XTM_RD_REMINDER;
94 
95 
96 
97 /*----------------------------------------------------------------------------
98 --  Global definitions
99 ----------------------------------------------------------------------------*/
100 
101 
102 /*----------------------------------------------------------------------------
103 --  Function prototypes
104 ----------------------------------------------------------------------------*/
105 
106 void
107   xtmRdDestroyReminder( XTM_RD_REMINDER_REF  reminder_ref );
108 
109 void
110   xtmRdDisplayReminder( XTM_RD_REMINDER_REF  reminder_ref );
111 
112 void
113   xtmRdHideReminder( XTM_RD_REMINDER_REF  reminder_ref );
114 
115 XTM_RD_REMINDER_REF
116   xtmRdInitializeReminder( Widget           parent,
117                            XtAppContext     context,
118                            XTM_RD_CLOSE_CB  closeCB,
119                            XTM_RD_HELP_CB   helpCB,
120                            void             *user_data );
121 Widget
122   xtmRdToplevelWindow( XTM_RD_REMINDER_REF  reminder_ref );
123 
124 #endif
125