include/OFUser.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 
00016 #import "OFResource.h"
00017 #import "OFSqlQuery.h"
00018 
00019 @class OFRequestHandle;
00020 class OFHttpService;
00021 class OFImageViewHttpServiceObserver;
00022 
00023 @protocol OFUserDelegate;
00024 
00032 @interface OFUser : OFResource<NSCoding, OFCallbackable>
00033 {
00034     @package
00035     NSString* name;
00036     NSString* profilePictureUrl;
00037     NSString* profilePictureSource;
00038     BOOL usesFacebookProfilePicture;
00039     NSString* lastPlayedGameId;
00040     NSString* lastPlayedGameName;
00041     BOOL followsLocalUser;
00042     BOOL followedByLocalUser;
00043     NSUInteger gamerScore;
00044     BOOL online;
00045     double latitude;
00046     double longitude;
00047     
00048     OFPointer<OFHttpService> mHttpService;
00049     OFPointer<OFImageViewHttpServiceObserver> mHttpServiceObserver;
00050 }
00051 
00058 + (void)setDelegate:(id<OFUserDelegate>)delegate;
00059 
00070 + (OFRequestHandle*)getUser:(NSString*)userId;
00071 
00080 - (OFRequestHandle*)getFriends;
00081 
00090 - (OFRequestHandle*)getFriendsWithThisApplication;
00091 
00100 - (OFRequestHandle*)getProfilePicture;
00101 
00105 @property (nonatomic, readonly) NSString* name;
00106 
00110 @property (nonatomic, readonly) NSString* lastPlayedGameId;
00111 
00115 @property (nonatomic, readonly) NSString* lastPlayedGameName;
00116 
00120 @property (nonatomic, readonly) NSUInteger gamerScore;
00121 
00125 @property (nonatomic, readonly) BOOL followsLocalUser;
00126 
00130 @property (nonatomic, readonly) BOOL followedByLocalUser;
00131 
00135 @property (nonatomic, readonly) BOOL online;
00136 
00140 @property (nonatomic, readonly) NSString* userId;
00141 
00145 @property (nonatomic, readonly, retain) NSString* profilePictureUrl;
00146 @property (nonatomic, readonly, retain) NSString* profilePictureSource;
00147 @property (nonatomic, readonly) BOOL usesFacebookProfilePicture;
00148 @property (nonatomic, readonly) double latitude;
00149 @property (nonatomic, readonly) double longitude;
00150 
00151 - (id)initWithLocalSQL:(OFSqlQuery*)queryRow;
00152 - (id)initWithCoder:(NSCoder *)aDecoder;
00153 - (void)encodeWithCoder:(NSCoder *)aCoder;
00154 + (id)invalidUser;
00155 + (NSString*)getResourceName;
00156 - (bool)isLocalUser;
00157 - (void)adjustGamerscore:(int)gamerscoreAdjustment;
00158 - (void)changeProfilePictureUrl:(NSString*)url facebook:(BOOL)isFacebook twitter:(BOOL)isTwitter uploaded:(BOOL)isUploaded;
00159 - (void)setName:(NSString*)value;
00160 - (void)setFollowedByLocalUser:(BOOL)value;
00161 
00162 @end
00163 
00164 
00169 @protocol OFUserDelegate
00170 @optional
00171 
00177 - (void)didGetUser:(OFUser*)user;
00178 
00182 - (void)didFailGetUser;
00183 
00190 - (void)didGetFriends:(NSArray*)follows OFUser:(OFUser*)user;
00191 
00197 - (void)didFailGetFriendsOFUser:(OFUser*)user;
00198 
00205 - (void)didGetFriendsWithThisApplication:(NSArray*)follows OFUser:(OFUser*)user;
00206 
00212 - (void)didFailGetFriendsWithThisApplicationOFUser:(OFUser*)user;
00213 
00220 - (void)didGetProfilePicture:(UIImage*)image OFUser:(OFUser*)user;
00221 
00227 - (void)didFailGetProfilePictureOFUser:(OFUser*)user;
00228 
00229 
00230 @end
00231 
00232 
00233 
 All Classes Files Functions Variables Enumerations Enumerator Properties