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

http://macfuse.googlecode.com/ · C Header · 55 lines · 5 code · 5 blank · 45 comment · 0 complexity · f59f84903b7afc6018e226c158091246 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 "KSMultiUpdateAction.h"
  16. @class KSUpdateEngine, KSActionProcessor;
  17. // KSPromptAction
  18. //
  19. // This concrete KSMultiAction subclass takes input from its inPipe, which must
  20. // be an array of product dictionaries (see KSServer.h for more details on the
  21. // dictionary format), and messages the engine_'s delegate to find out which
  22. // of the products in the array should be installed. Based on the response from
  23. // the delegate, KSUpdateActions will be created and run on an internal
  24. // KSActionProcessor. This action never adds any actions to the processor on
  25. // which it itself is running. This action finishes once all of its subactions
  26. // (if any) complete.
  27. //
  28. // Upon completion, this action's outPipe will contain the number of
  29. // KSUpdateActions enqueued, wrapped in an NSNumber.
  30. //
  31. // Sample code to create a checker and a prompt connected via a pipe.
  32. //
  33. // KSActionProcessor *ap = ...
  34. // KSUpdateCheckAction *checker = ...
  35. //
  36. // KSPromptAction *prompt = [KSPromptAction actionWithEngine:engine_];
  37. //
  38. // KSActionPipe *pipe = [KSActionPipe pipe];
  39. // [checker setOutPipe:pipe];
  40. // [prompt setInPipe:pipe];
  41. //
  42. // [ap enqueueAction:checker];
  43. // [ap enqueueAction:prompt];
  44. //
  45. // [ap startProcessing];
  46. //
  47. // See KSUpdateEngine.m for another example of using KSPromptAction.
  48. @interface KSPromptAction : KSMultiUpdateAction
  49. // See KSMultiUpdateAction's interface
  50. @end