-- Hickory.mesa: the interface for the event data base -- Last Edited by: Binding, August 16, 1984 2:28:57 pm PDT DIRECTORY BasicTime USING [ GMT, nullGMT], Rope USING [ ROPE], RopeSets USING [ RopeSet] ; Hickory: CEDAR DEFINITIONS = BEGIN OPEN BasicTime, Rope; <> Event: TYPE = ROPE; -- this is in fact the name of an event entity in event domain EventSet: TYPE = RopeSets.RopeSet; RepetitionType: TYPE = { None, Hourly, Daily, Weekdays, Weekly, Monthly, Yearly, Complicated }; ProtectionType: TYPE = { Private, Public}; -- for multiple user calendar system EventTuple: TYPE = RECORD [ Key: Event _ nullEvent, EventTime: GMT _ nullGMT, -- absolute time Duration: CARDINAL _ 0, -- minutes, constrained to terminate on same day RepeatType: RepetitionType _ None, -- is is a repeated event RepeatTime: ROPE _ NIL, -- in case of RepeatParam = Complicated RepeatUntil: GMT _ nullGMT, -- until when to schedule the event ( defaulted to latestGMT) LeadTime: INTEGER _ 0, -- how long ahead of EventTime to post reminder NagTime: INTEGER _ 0, -- for how long to keep reminder posted KeepUntil: GMT _ nullGMT, -- until when is event kept in data base ( defaulted to latestGMT) Text: ROPE _ NIL, Message: ROPE _ NIL, -- the walnut mesg. id. Place: ROPE _ NIL, -- where is event happening IconFlavor: ROPE _ NIL, -- the icon to be displayed IconLabel: ROPE _ NIL, Protection: ProtectionType _ Private, Remind: BOOLEAN _ TRUE, -- Is event to be seen by reminder Forgotten: BOOLEAN _ FALSE ]; EventList: TYPE = LIST OF EventTuple; nullEvent: Event = NIL; <> Options: TYPE = ARRAY [0..15] OF BOOLEAN; NoOptions: Options = ALL[ FALSE]; -- non forgotten events, no expansion All: CARDINAL = 0; -- return all events stored in data base, including 'forgotten' events ExpandRepetitions: CARDINAL = 1; -- repetitions are expanded Reminders: CARDINAL = 2; -- return the events to be reminded only <> SameEvent: PROCEDURE [ ev1, ev2: Event] RETURNS [ BOOLEAN]; <> <<>> SameEventTuple: PROCEDURE [ ev1, ev2: EventTuple] RETURNS [ BOOLEAN] ; <> <<>> AppendEventLists: PROCEDURE [ evl1, evl2: EventList] RETURNS [ evl: EventList]; <> <<>> MergeLists: PROCEDURE [ evl1, evl2: EventList] RETURNS [ evl: EventList]; <> <<>> OrderEventList: PROCEDURE [ evl: EventList] RETURNS [ orderedList: EventList]; <> <> RestoreEvents: PROCEDURE [ from, to: GMT, options: Options _ NoOptions, group: Group _ NIL, key: Event _ NIL] RETURNS [ evList: EventList]; <> <> <> <> <> <> <> <> <> <> <> <> <> <> EnterEvent: PROCEDURE [ ev: EventTuple, groups: GroupSet _ [NIL, NIL]] RETURNS [ updatedEv: EventTuple]; <> <> <> <> <<>> ForgetEvent: PROCEDURE [ ev: Event, on: BOOLEAN]; <> << except when 'All' included in 'options'. To unforget, 'on' = FALSE!>> <> <> <<>> ChangeEvent: PROCEDURE [ oldEv, newEv: EventTuple]; <> <> <> <> <> DestroyEvent: PROCEDURE [ ev: Event]; <> <> <> DestroyDataBase: PROCEDURE; <> <> <> <> <<>> <> Group: TYPE = Rope.ROPE; GroupSet: TYPE = RopeSets.RopeSet; InsertToGroup: PROCEDURE [ ev: Event, groups: GroupSet]; <> <> <> <<>> RemoveFromGroup: PROCEDURE [ ev: Event, groups: GroupSet]; <> <> <> <> <<>> ListGroups: PROCEDURE [ ev: Event _ NIL] RETURNS [ gSet: GroupSet]; <> <> <> <<>> RemoveGroup: PROCEDURE [ group: Group]; <> <> <> <> <> Property: TYPE = Rope.ROPE; PropertySet: TYPE = RopeSets.RopeSet; SetProperty: PROCEDURE [ ev: Event, name: Property, value: REF ANY]; <> <> <> <> <> GetProperty: PROCEDURE [ ev: Event, name: Property] RETURNS [ value: REF ANY]; <> <> <> <<>> ListProperties: PROCEDURE [ ev: Event _ NIL] RETURNS [ pSet: PropertySet]; <> <> <> RemoveProperty: PROCEDURE [ property: Property]; <> <> <> <> <> NotifyProc: TYPE = PROCEDURE [ reason: Reason, ev: Event, data: RopeSets.RopeSet]; <> <<>> Reason: TYPE = { NewEvent, -- ev, group Forget, -- ev, NIL UnForget, -- ev, NIL Edit, -- ev, NIL Destroy, -- ev, NIL DestroyDB, -- NIL, NIL NewGroup, -- NIL, group InsertionToGroup, -- ev, groups RemoveFromGroup, --ev, groups GroupDestroy, -- NIL, group NewProperty, -- NIL, property AddProperty, -- ev, property PropertyDestroy -- NIL, property }; RegisterNotifyProc: PROCEDURE [ proc: NotifyProc]; RemoveNotifyProc: PROCEDURE [ proc: NotifyProc]; <> <> Error: PUBLIC SIGNAL [ errCode: ErrorCode, arg: ROPE]; ErrorCode: TYPE = { NullInterval, -- query with fromWhen = upTo BadInterval, -- query with upTo > fromWhen NoSuchEvent, -- supplied event does not exist NoSuchGroup, -- supplied group does not exist NoSuchProperty, -- supplied property does not exist MismatchedPropertyType, -- supplied property value mismatches existing property type BadValueType, -- supplied property value is of wrong type BadValue, -- NIL value given for a property NotOwner, -- only owner of Hickory can write it... NotStored, -- if KeepUntil < EventTime NotSameKey, -- if oldEv.Key # newEv.Key TooLong -- event must start and end on same calendar day, i.e. can not be longer than 24 hours }; END.