/core/externals/update-engine/Core/KSMultiUpdateAction.h

http://macfuse.googlecode.com/ · C Header · 51 lines · 14 code · 11 blank · 26 comment · 0 complexity · e037ae7f895339b6da1779fe5c44d346 MD5 · raw file

  1. // Copyright 2008 Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "KSMultiAction.h"
  16. @class KSUpdateEngine;
  17. // KSMultiUpdateAction
  18. //
  19. // Abstract action that encapsulates running multiple sub-KSUpdateActions. Two
  20. // concrete subclasses of this class are KSSilentUpdateAction and
  21. // KSPromptAction, each of which differ only in how they figure out which of
  22. // the available updates should be installed.
  23. @interface KSMultiUpdateAction : KSMultiAction {
  24. @private
  25. KSUpdateEngine *engine_;
  26. }
  27. // Returns an autoreleased action associated with the given |engine|
  28. + (id)actionWithEngine:(KSUpdateEngine *)engine;
  29. // Designated initializer. Returns an action associated with |engine|
  30. - (id)initWithEngine:(KSUpdateEngine *)engine;
  31. // Returns the KSUpdateEngine instance for this KSMultiUpdateAction
  32. - (KSUpdateEngine *)engine;
  33. @end
  34. // These methods MUST be implemented by subclasses. These methods are called
  35. // from the -performAction method and are required.
  36. @interface KSMultiUpdateAction (PureVirtualMethods)
  37. // Given an array of KSUpdateInfos. Returns an array of KSUpdateInfos for the
  38. // products that should be updated.
  39. - (NSArray *)productsToUpdateFromAvailable:(NSArray *)availableUpdates;
  40. @end