00001 // Copyright 2009-2010 Aurora Feint, Inc. 00002 // 00003 // Licensed under the Apache License, Version 2.0 (the "License"); 00004 // you may not use this file except in compliance with the License. 00005 // You may obtain a copy of the License at 00006 // 00007 // http://www.apache.org/licenses/LICENSE-2.0 00008 // 00009 // Unless required by applicable law or agreed to in writing, software 00010 // distributed under the License is distributed on an "AS IS" BASIS, 00011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00012 // See the License for the specific language governing permissions and 00013 // limitations under the License. 00014 00015 #import "OFResource.h" 00016 #import "OFCallbackable.h" 00017 00018 @class OFService; 00019 @class OFRequestHandle; 00020 class OFHttpService; 00021 class OFImageViewHttpServiceObserver; 00022 00023 @protocol OFChallengeDefinitionDelegate; 00024 00030 @interface OFChallengeDefinition : OFResource<OFCallbackable> 00031 { 00032 @package 00033 NSString* title; 00034 NSString* clientApplicationId; 00035 NSString* iconUrl; 00036 BOOL multiAttempt; 00037 00038 OFPointer<OFHttpService> mHttpService; 00039 OFPointer<OFImageViewHttpServiceObserver> mHttpServiceObserver; 00040 } 00041 00048 + (void)setDelegate:(id<OFChallengeDefinitionDelegate>)delegate; 00049 00058 + (OFRequestHandle*)downloadAllChallengeDefinitions; 00059 00071 + (OFRequestHandle*)downloadChallengeDefinitionWithId:(NSString*)challengeDefinitionId; 00072 00081 - (OFRequestHandle*)getIcon; 00082 00086 @property (nonatomic, readonly) NSString* title; 00087 00091 @property (nonatomic, readonly) BOOL multiAttempt; 00092 00096 @property (nonatomic, readonly) NSString* clientApplicationId; 00097 @property (nonatomic, readonly) NSString* iconUrl; 00098 + (NSString*)getResourceName; 00099 00100 @end 00101 00107 @protocol OFChallengeDefinitionDelegate 00108 @optional 00112 - (void)didDownloadAllChallengeDefinitions:(NSArray*)challengeDefinitions; 00113 00117 - (void)didFailDownloadChallengeDefinitions; 00118 00122 - (void)didDownloadChallengeDefinition:(OFChallengeDefinition*)challengeDefinition; 00123 00127 - (void)didFailDownloadChallengeDefinition; 00128 00135 - (void)didGetIcon:(UIImage*)image OFChallengeDefintion:(OFChallengeDefinition*)challengeDef; 00136 00142 - (void)getFailGetIconOFChallengeDefinition:(OFChallengeDefinition*)challengeDef; 00143 @end