(**** * * Module CalendarDB defines the major database objects of the calendar system. * *) module CalendarDB; import Schedule.ScheduledItem; import Admin.UserDB, Admin.GroupDB, Admin.RoomDB, Admin.Id; import File.FileSpace, File.File; import Edit.Clipboard, Edit.Selection, Edit.SelectionContext; export CalendarDB, UserWorkSpace, UserCalendar, RequiresSaving, UserOptions, GlobalOptions, UserId, PreviousState; object CalendarDB components: user_calendars:UserCalendars and user_db:UserDB and group_db:GroupDB and room_db:RoomDB and global_options:GlobalOptions and workspace:UserWorkSpace; description: (* The CalendarDB is the top-level object for the Calendar Tool. The first component is the list of UserCalendars for all registered users. The next three components are the registered UserDB, the user GroupDB, and the RoomDB. The GlobalOptions component is the set of calendar options common by default for all users, both registered and non-registered. The UserWorkSpace component is active calendars upon which the current user is working. *); end; object UserWorkSpace components: uid:UserId and calendars:UserCalendar* and options:UserOptions and previous_state:PreviousState and clipboard:Clipboard and selection:Selection and context:SelectionContext; description: (* The UserWorkSpace contains the active calendars upon which the user is working. The first component is the UserId of the current user, which is used as necessary by operations that input the workspace to determine who the user is. The UserCalendars component is the list of active calendars. The UserOptions component is the list of individualized user options, some of which may be different than the global calendar options. The previous_state component is used to support one level of command undo. The Clipboard is used with the Edit cut, copy, and paste operations. *); end; object PreviousState components: ScheduledItem*; description: (* PreviousState is the snapshot of scheduled items before the most recently performed scheduling operation used by EditUndo. The Schedule, Change, and Delete operations save the previous state to support Undo. *); end PreviousState; object UserCalendars components: UserCalendar*; description: (* UserCalendars is the list of active calendars upon which the user is working. The list is maintained in the order visited by the user, with the first element being the most recently visited, and hence current, and the last element being the earliest visited. *); end UserCalendars; object UserCalendar components: uid:UserId and file:File and options:UserOptions and requires_saving:RequiresSaving and items:ScheduledItem*; description: (* A UserCalendar has the id of the user who owns it, the specialized user options for the calendar, a flag indicating if the calendar requires saving, and the list of scheduled items. *); end UserCalendar; object UserName = string description: (* The name of a registered user. *); end Username; object UserId = Id description: (* The id of a registered user. *); end UserId; object UserOptions = Option* description: (* The personal options of a user, initially a copy of the default global options, and subsequently changed if the user chooses to do so using the EditPreferences dialog. *); end UserOptions; object Option = ...; object RequiresSaving = boolean description: (* True if a calendar requires saving, which is the case if one or more successful edit operations has been performed on the calendar since the most recent save. The calendar edit operations are Schedule, Change, and Delete. *); end RequiresSaving; object GlobalOptions = Option* description: (* The global default options for all users. The local options for each user calendar are initially a copy of the global options. The local options can be changed if the user chooses to do so using the EditPreferences dialog. *); end GlobalOptions; end CalendarDB;