doc
 All Classes Functions Variables Properties
/Users/rburkes/Projects/mobile/branches/release-1-2/devices/iphone/core/src/EMLib/EMCartDataSource.h
00001 /* 
00002  Copyright 2001, 2012, Oracle and/or its affiliates. All rights reserved.
00003  Oracle and Java are registered trademarks of Oracle and/or its 
00004  affiliates. Other names may be trademarks of their respective owners.
00005  UNIX is a registered trademark of The Open Group.
00006  
00007  This software and related documentation are provided under a license 
00008  agreement containing restrictions on use and disclosure and are 
00009  protected by intellectual property laws. Except as expressly permitted 
00010  in your license agreement or allowed by law, you may not use, copy, 
00011  reproduce, translate, broadcast, modify, license, transmit, distribute, 
00012  exhibit, perform, publish, or display any part, in any form, or by any 
00013  means. Reverse engineering, disassembly, or decompilation of this 
00014  software, unless required by law for interoperability, is prohibited.
00015  The information contained herein is subject to change without notice 
00016  and is not warranted to be error-free. If you find any errors, please 
00017  report them to us in writing.
00018  U.S. GOVERNMENT END USERS: Oracle programs, including any operating 
00019  system, integrated software, any programs installed on the hardware, 
00020  and/or documentation, delivered to U.S. Government end users are 
00021  "commercial computer software" pursuant to the applicable Federal 
00022  Acquisition Regulation and agency-specific supplemental regulations. 
00023  As such, use, duplication, disclosure, modification, and adaptation 
00024  of the programs, including any operating system, integrated software, 
00025  any programs installed on the hardware, and/or documentation, shall be 
00026  subject to license terms and license restrictions applicable to the 
00027  programs. No other rights are granted to the U.S. Government.
00028  This software or hardware is developed for general use in a variety 
00029  of information management applications. It is not developed or 
00030  intended for use in any inherently dangerous applications, including 
00031  applications that may create a risk of personal injury. If you use 
00032  this software or hardware in dangerous applications, then you shall 
00033  be responsible to take all appropriate fail-safe, backup, redundancy, 
00034  and other measures to ensure its safe use. Oracle Corporation and its 
00035  affiliates disclaim any liability for any damages caused by use of this 
00036  software or hardware in dangerous applications.
00037  This software or hardware and documentation may provide access to or 
00038  information on content, products, and services from third parties. 
00039  Oracle Corporation and its affiliates are not responsible for and 
00040  expressly disclaim all warranties of any kind with respect to 
00041  third-party content, products, and services. Oracle Corporation and 
00042  its affiliates will not be responsible for any loss, costs, or damages 
00043  incurred due to your access to or use of third-party content, products, 
00044  or services.
00045  */
00046 
00047 #import <Foundation/Foundation.h>
00048 #import "EMEditAddressViewController.h"
00049 
00055 @class EMPostalAddress, EMCreditCard, EMUser, EMRecord, EMCartItem; 
00056 @class EMTransaction, EMNotification, EMProduct, EMShippingOptionGroup;
00057 @class EMGiftWrapSpec;
00058 
00059 @protocol EMCartDataSourceDelegate <NSObject>
00060 
00061 @optional
00062 
00063 - (void) loginDidStartLoad;
00064 - (void) loginDidFinishLoad;
00065 - (void) loginDidFailWithError:(NSError *)error;
00066 
00067 - (void) calculateAmountsDidStartLoad;
00068 - (void) calculateAmountsDidFinishLoad;
00069 - (void) calculateAmountsDidFailWithError:(NSError *)error;
00070 
00071 @end
00072 
00073 
00074 
00075 @protocol EMCartDataSource <NSObject>
00076 
00080 @property(nonatomic, readonly) NSMutableArray *delegates;
00081 
00082 
00088 - (void) loginWithUsername:(NSString *)username password:(NSString *)password;
00089 
00093 - (EMUser *) loginWithUsername:(NSString *)username password:(NSString *)password error:(NSError **)error;
00094 
00098 - (BOOL) registerUser:(EMUser *)user confirmEmail:(NSString *)confirmEmail password:(NSString *)password confirmPassword:(NSString *)confirmPassword error:(NSError **)error;
00099 
00103 - (void) logout;
00104 
00108 - (BOOL) updateUser:(EMUser *)user error:(NSError **)error;
00109 
00113 - (BOOL) sendPassword:(NSString *)email error:(NSError **)error;
00114 
00118 - (BOOL) resetPassword:(EMUser *)user password:(NSString *)password oldPassword:(NSString *)oldPassword error:(NSError **)error;
00119 
00123 - (BOOL) createAnonymousSessionWithEmail:(NSString *)email error:(NSError **)error;
00124 
00125 
00129 - (BOOL) addOrUpdateAddress:(EMPostalAddress *)address toUser:(EMUser *)user addressType:(EMEditAddressControllerType) type error:(NSError **)error;
00130 
00134 - (BOOL) removeAddress:(EMPostalAddress *)address fromUser:(EMUser *)user error:(NSError **)error;
00135 
00139 - (BOOL) selectShippingAddress:(EMPostalAddress *)address error:(NSError **)error;
00140 
00144 - (BOOL) selectBillingAddress:(EMPostalAddress *)address error:(NSError **)error;
00145 
00149 - (BOOL) setShippingAddress:(EMPostalAddress *)address error:(NSError **)error;
00150 
00154 - (BOOL) setBillingAddress:(EMPostalAddress *)address error:(NSError **)error;
00155 
00159 - (BOOL) addOrUpdateCard:(EMCreditCard *)card toUser:(EMUser *)user error:(NSError **)error;
00160 
00164 - (BOOL) removeCard:(EMCreditCard *)card fromUser:(EMUser *)user error:(NSError **)error;
00165 
00169 - (BOOL) selectCard:(EMCreditCard *)card error:(NSError **)error;
00170 
00174 - (BOOL) setCard:(EMCreditCard *)card error:(NSError **)error;
00175 
00176 
00181 - (NSArray *) getShippingOptions:(EMTransaction *)transaction error:(NSError **)error;
00182 
00186 - (BOOL) selectShippingOption:(EMShippingOptionGroup *)shippingGroup error:(NSError **)error;
00187 
00192 - (NSArray *) getNotifications:(EMTransaction *)transaction error:(NSError **)error location:(NSString *)location;
00193 
00194 
00200 - (void) calculateAmounts;
00201 
00205 - (NSMutableArray *) calculateAmounts:(EMTransaction *)transaction error:(NSError **)error;
00206 
00210 - (NSString *) submitOrder:(EMTransaction *)transaction error:(NSError **)error;
00211 
00215 - (BOOL) addPromotionCode:(NSString*)code error:(NSError **)error;
00216 
00220 - (BOOL) removePromotionCode:(NSString*)code error:(NSError **)error;
00221 
00225 - (BOOL) processGiftWrap:(EMGiftWrapSpec *)giftWrap error:(NSError **)error;
00226 
00230 - (BOOL) appendGiftWrapOptions:(EMCartItem *)item error:(NSError **)error;
00231 
00235 - (BOOL) createOrder:(NSError **) error;
00236 
00237 
00241 - (BOOL) addItem:(EMProduct *)item error:(NSError **) error;
00242 
00246 - (BOOL) deleteItems:(NSArray *)items error:(NSError **)error;
00247 
00251 - (BOOL) updateItems:(NSDictionary *)items error:(NSError **)error;
00252 
00256 - (void) clearCart;
00257 
00258 
00259 @end
00260