/core/externals/update-engine/Samples/Actions/UEImageDownloadAction.h

http://macfuse.googlecode.com/ · C Header · 44 lines · 14 code · 10 blank · 20 comment · 0 complexity · f1538bd0916a370e6b9d8dcdf46ba1c9 MD5 · raw file

  1. // Copyright 2009 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 <Cocoa/Cocoa.h>
  15. #import "KSAction.h"
  16. // This notification is posted when an image downloads succesfully.
  17. #define kImageDownloadSuccessNotification @"UEImageDownloadAction success"
  18. // This is the key in the notification's info dictionary to find the NSImage
  19. #define kImageInfoKey @"UEImageDownloadAction image key"
  20. // This is the key in the notification's info dictionary to find the image name
  21. #define kImageNameKey @"UEImageDownloadAction image name"
  22. @class GDataHTTPFetcher;
  23. // UEImageDownloadAction downloads an image at a given URL. Once it downloads
  24. // succesfully, it posts a notification containing an NSImage and its name
  25. // (derived from the URL).
  26. //
  27. @interface UEImageDownloadAction : KSAction {
  28. NSURL *imageURL_;
  29. GDataHTTPFetcher *httpFetcher_;
  30. int index_; // Used for logging to identify this action.
  31. }
  32. - (id)initWithImageURL:(NSURL *)imageURL
  33. index:(int)index;
  34. @end // UEImageDownloadAction