PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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