Object <- DatebookSearchResult |
|
|
DisplaySearchResult DoneListingSearchResult Init |
|
ContentDescription DateAsText IsValid TinyImage |
| Field | Type | |
|---|---|---|
| DatebookSearchResult: | task: | Task |
| whereFound: | Viewable | |
| whatFound: | Object | |
| viewDate: | Signed | |
| viewMode: | Unsigned |
instance DatebookSearchResult tag; task: nilObject; whereFound: nilObject; whatFound: nilObject; viewDate: 0; viewMode: 0; end instance;
Define Class DatebookSearchResult; inherits from Object, CanBeSearchResult; field task: Task, weak; field whereFound: Viewable, weak; field whatFound: Object, weak; field viewDate: Signed; field viewMode: Unsigned; overrides ContentDescription; // uses content description of task, or LocationDescription of whatFound if task is nilObject overrides TinyImage; // uses content icon of task, or of <whatFound> if task is nilObject overrides DateAsText; // uses DateAsText of task, or returns DateRangeAsText with <viewDate> and <viewMode> if task is nilObject overrides DisplaySearchResult; // handles four types of searching results: // for text found in a task's notes, goes to task, opens notes window, and selects found text // for a viewable found in a task's attachments, goes to task, opens notes window, highlights viewable // for a viewable found in a task's editor viewables, goes to task, highlights viewable // for a viewable found on a date or date range in task view, goes to datebook scene and sets appropriate date and view mode overrides DoneListingSearchResult; // destroys self, since these objects have no further purpose when they are removed from search list overrides Init; // sets up the four fields from parameters; the four recognized cases are as follows // for text found in a task's notes, <task> is the task, <whereFound> is the notes window, <whatFound> is a TextSearchResult, <viewDate> and <viewMode> are ignored // for a viewable found in a task's attachments, <task> is the task, <whereFound> is the notes window, <whatFound> is the viewable, <viewDate> and <viewMode> are ignored // for a viewable found in a task's editor viewables, <task> is the task, <whereFound> is the task editor, <whatFound> is the viewable, <viewDate> and <viewMode> are ignored // for a viewable found in the task view, <task> is ignored, <whereFound> is the task view, <whatFound> is the viewable, <viewDate> is date and <viewMode> is view mode of task view overrides IsValid; // returns false if <whatFound> is not an object or not valid itself, or if <task> is not object and <whereFound> is not a task view end class;