include/OFAchievement.h

Go to the documentation of this file.
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 #pragma once
00016 
00017 #import "OFResource.h"
00018 #import "OFSqlQuery.h"
00019 
00020 @class OFRequestHandle;
00021 class OFHttpService;
00022 class OFImageViewHttpServiceObserver;
00023 
00024 @protocol OFAchievementDelegate;
00025 
00030 @interface OFAchievement : OFResource<OFCallbackable>
00031 {
00032 @private
00033     NSString* title;
00034     NSString* description;
00035     NSUInteger gamerscore;
00036     NSString* iconUrl;
00037     BOOL isSecret;
00038     double percentComplete;
00039     NSDate* unlockDate;
00040     
00041     BOOL isUnlockedByComparedToUser;
00042     NSString* comparedToUserId;
00043     
00044     NSString* endVersion;
00045     NSString* startVersion;
00046     NSUInteger position;    
00047     
00048     OFPointer<OFHttpService> mHttpService;
00049     OFPointer<OFImageViewHttpServiceObserver> mHttpServiceObserver;
00050 }
00057 + (void)setDelegate:(id<OFAchievementDelegate>)delegate;
00058 
00066 + (NSArray*)achievements;
00067 
00075 + (OFAchievement*)achievement:(NSString*)achievementId;
00076 
00085 + (OFRequestHandle*)submitDeferredAchievements;
00086 
00090 + (void)setCustomUrlForSocialNotificaion:(NSString*)url;
00091 
00102 - (OFRequestHandle*)updateProgressionComplete:(double)updatePercentComplete andShowNotification:(BOOL)showUpdateNotification;
00103 
00117 - (void)deferUpdateProgressionComplete:(double)updatePercentComplete andShowNotification:(BOOL)showUpdateNotification;
00118 
00127 - (OFRequestHandle*)getIcon;
00128 
00132 @property (nonatomic, readonly)         NSString*   title;
00133 
00137 @property (nonatomic, readonly)         NSString*   description;
00138 
00142 @property (nonatomic, readonly)         NSUInteger  gamerscore;
00143 
00148 @property (nonatomic, readonly)         BOOL        isSecret;
00149 
00153 @property (nonatomic, readonly)         NSDate*     unlockDate;
00154 
00158 @property (nonatomic, readonly) BOOL isUnlocked;
00159 
00163 @property (nonatomic, readonly) double percentComplete;
00164 
00168 - (id)initWithLocalSQL:(OFSqlQuery*)queryRow;
00169 + (NSString*)getResourceName;
00170 
00171 @property (nonatomic, readonly) BOOL isUnlockedByComparedToUser;
00172 @property (nonatomic, readonly) NSString* comparedToUserId;
00173 @property (nonatomic, readonly) NSString* endVersion;
00174 @property (nonatomic, readonly) NSString* startVersion;
00175 @property (nonatomic, readonly) NSUInteger position;
00176 @property (nonatomic, readonly) NSString*   iconUrl;
00177 
00178 @end
00179 
00180 
00186 @protocol OFAchievementDelegate<NSObject>
00187 @optional
00192 - (void)didSubmitDeferredAchievements;
00193 
00197 - (void)didFailSubmittingDeferredAchievements;
00198 
00202 - (void)didUpdateProgressionCompleteOFAchievement:(OFAchievement*)achievement;
00203 
00207 - (void)didFailUpdateProgressionCompleteOFAchievement:(OFAchievement*)achievement;
00208 
00215 - (void)didGetIcon:(UIImage*)image OFAchievement:(OFAchievement*)achievement;
00216 
00222 - (void)didFailGetIconOFAchievement:(OFAchievement*)achievement;
00223 
00227 - (void)didForceSyncGameCenterAchievements;
00228 
00232 - (void)didFailForceSyncGameCenterAchievements;
00233 
00234 
00235 @end
00236 
00237 
00238 @interface OFAchievement (Deprecated)
00239 
00247 - (OFRequestHandle*)unlock;
00248 
00260 - (void)unlockAndDefer;
00261 
00268 + (void)forceSyncGameCenterAchievements;
00269 
00270 @end
 All Classes Files Functions Variables Enumerations Enumerator Properties