David Goldberg November 8, 1989 3:47:08 pm PST
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Theimer, September 10, 1990 1:56 pm PDT
Last tweaked by Mike Spreitzer August 27, 1993 8:15 am PDT
Willie-s, May 6, 1992 2:37 pm PDT
DIRECTORY
BasicTime USING [GMT],
Rope USING [ROPE];
Remind: CEDAR DEFINITIONS
= BEGIN
MeetingType: TYPE = {none, meeting, command, seminar, protectedCmd};
MeetingRec: TYPE = RECORD[
uniqID: INT,
type: MeetingType ¬ meeting,
start: BasicTime.GMT,
duration: CARD ¬ 60,  -- minutes
explanation: Rope.ROPE ¬ NIL,
repeat: Repetitions ¬ once,
nth: INT ¬ 0,
reminders: RemindList ¬ NIL,
more: Rope.ROPE ¬ NIL,  -- pointer to more, usually a mail message
iconLabel: Rope.ROPE ¬ NIL,
iconFlavor: Rope.ROPE ¬ NIL,
public: BOOL ¬ FALSE,
other: REF ANY ¬ NIL];
Meeting: TYPE = REF MeetingRec;
Repetitions: TYPE = {once, daily, weekdays, weekly, biweekly, monthly, yearly, nthWeekday, everyNthDay, everyNthWeek, everyNthMonth, other};
RemindList: TYPE ~ LIST OF Reminder;
Reminder: TYPE ~ REF ReminderRecord;
AlertReminder: TYPE ~ REF ReminderRecord[alert];
MailReminder: TYPE ~ REF ReminderRecord[mail];
ReminderRecord: TYPE ~ RECORD [
other: REF ANY ¬ NIL,
variant: SELECT how: RemindStyle FROM
alert => [start, stop: BasicTime.GMT],
mail => [when: BasicTime.GMT, to: Rope.ROPE],
ENDCASE];
RemindStyle: TYPE ~ {alert, mail};
Add meeting to database (uniqID field is ignored). Will create a database if needed. If dbName is NIL, then uses default database. The current implementation uses LoganBerry, and Remind.DfFile in the user profile is the default LoganBerry .df file. Normally closes db so that autoback will see the change
AddMeeting: PROC[meeting: Meeting, closeDb: BOOLEAN ¬ TRUE, dbName: Rope.ROPE ¬ NIL] RETURNS [id: INT];
GetDefaultDbName: PROC RETURNS [Rope.ROPE];
mainly used to force an autobackup
CloseDb: PROC[dbName: Rope.ROPE ¬ NIL];
Delete this meeting. Returns true if it was found.
DeleteMeeting: PROC
[start: BasicTime.GMT, id: INT,
closeDb: BOOLEAN ¬ TRUE,
dbName: Rope.ROPE ¬ NIL]
RETURNS [BOOLEAN];
When you only know a range of time in which the meeting starts, use this one. The range includes both endpoints.
DeleteMeetingInRange: PROC
[from, to: BasicTime.GMT, id: INT,
closeDb: BOOLEAN ¬ TRUE,
dbName: Rope.ROPE ¬ NIL]
RETURNS [BOOLEAN];
Delete all meetings; returns the number deleted.
DeleteAllMeetings: PROC[dbName: Rope.ROPE ¬ NIL] RETURNS [INT];
Return list of all meetings in the specified range. Atom is either $start or $stopReminding. Repeated meetings are listed with 'start' field set to the first occurence after from. If all is true, then repeated meetings are listed as many times as they occur in the range, otherwise they are listed just once. Stupid protocols may require implementing this with something that comminucates with a server as much information as a meeting per repetition within the given range.
ListMeetings: PROC[
from, to: BasicTime.GMT,
all: BOOLEAN ¬ FALSE,
dbName: Rope.ROPE ¬ NIL]
RETURNS [LIST OF Meeting];
convert between enumerated type and rope
RopeFromRepetition: PROC[rep: Repetitions] RETURNS [Rope.ROPE];
RepetitionFromRope: PROC[str: Rope.ROPE] RETURNS [Repetitions];
convert between enumerated type and rope
RopeFromMeetingType: PROC[type: MeetingType] RETURNS [Rope.ROPE];
MeetingTypeFromRope: PROC[str: Rope.ROPE] RETURNS [MeetingType];
if a meeting occurs at time with repeat and nth, return time when it will occur next
NextOccurrence: PROC[repeat: Repetitions, nth: INT, time: BasicTime.GMT] RETURNS [BasicTime.GMT];
if a meeting occurs at init with repeat and nth, return first time >= now when it will occur
FirstOccurrenceAfter: PROC[repeat: Repetitions, nth: INT, init, now: BasicTime.GMT] RETURNS [BasicTime.GMT];
when change in meeting database, call proc. Ident is label for use with UnRegister.
RegisterChangeProc: PROC[proc: PROC[data: REF], clientData: REF, ident: ATOM, dbName: Rope.ROPE ¬ NIL];
unregister all procs registered under this ident
UnregisterChangeProc: PROC[ident: ATOM, dbName: Rope.ROPE ¬ NIL];
compact the database
CompactDb: PROC[dbName: Rope.ROPE ¬ NIL];
Use SimpleFeedback instead
Set the I/O stream to use for printing messages to the user.
SetIOPrintStream: PROC [s: IO.STREAM];
Get the I/O stream to use for printing messages to the user.
GetIOPrintStream: PROC [] RETURNS [s: IO.STREAM];
there is bad data in the database (I should provide a cleanup proc)
BadData: ERROR;
END.