CanShowPurgingSuggestions |
|
|
AddSuggestion AddSuggestionsFromPurger MakeSuggestionsForDiscarding ResetSuggestionList ValidateSuggestionList |
|
CheckedSuggestionList ForOutOfMemory PurgingListView SuggestionList |
Define Class CanShowPurgingSuggestions; mixes in with Object; attribute PurgingListView: CheckboxListView, readOnly, noGetter; // list view that holds the list of purging suggestions // subclass must provide implementation attribute SuggestionList: KeySortedList, readOnly; // getter returns list that stores suggestions for discarding // list is from PurgingListView(self) attribute CheckedSuggestionList: ObjectList, readOnly; // getter returns list that stores suggestions for discarding that user has selected // list is from PurgingListView(self) attribute ForOutOfMemory: Boolean, readOnly; // returns false // override occasionally to return true for subclasses that handle // the completely-out-of-memory scenario // called by system to make decisions about memory vs. performance tradeoffs operation AddSuggestion(discardable: Object); // called by overriders of SearchForSuggestion for each item to be suggested for discarding // adds <discardable> to suggestion list // sometimes override to update user interface as items are added, or to check for // user action that might interrupt lengthy search // sometimes called with nilObject as <discardable> to allow check for user action operation AddSuggestionsFromPurger(purger: CanOfferPurgingSuggestions; containerDevice: ContainerDevice; recommendedOnly: Boolean); // calls SearchForSuggestions // override sometimes to let user interface show progress operation MakeSuggestionsForDiscarding(containerDevice: ContainerDevice; recommendedOnly: Boolean); // iterates through iLowMemoryPurgers, calling AddSuggestionsFromPurger with each one // override rarely operation ResetSuggestionList(); // clears out suggestionList and checkedSuggestionList // override rarely operation ValidateSuggestionList(): Boolean; // removes destroyed objects from suggestionList and checkedSuggestionList // returns true if there were any destroyed objects // override rarely end class;