// // iToast.h // iToast // // Created by Diallo Mamadou Bobo on 2/10/11. // Copyright 2011 __MyCompanyName__. All rights reserved. // #import #import #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef enum iToastGravity { iToastGravityTop = 1000001, iToastGravityBottom, iToastGravityCenter } iToastGravity; typedef enum iToastDuration { iToastDurationLong = 10000, iToastDurationShort = 1000, iToastDurationNormal = 3000 } iToastDuration; typedef enum iToastType { iToastTypeInfo = -100000, iToastTypeNotice, iToastTypeWarning, iToastTypeError } iToastType; @class iToastSettings; @interface iToast : NSObject { iToastSettings *_settings; NSInteger offsetLeft; NSInteger offsetTop; NSTimer *timer; UIView *view; NSString *text; NSAttributedString *attartext; /** * @brief 标记是否使用富文本 */ BOOL useAttr; } - (void)show; - (iToast *)setDuration:(NSInteger)duration; - (iToast *)setGravity:(iToastGravity) gravity offsetLeft:(NSInteger)left offsetTop:(NSInteger)top; - (iToast *)setGravity:(iToastGravity)gravity; - (iToast *)setPostion:(CGPoint) position; + (iToast *)makeText:(NSString *)text; + (iToast *)makeAttrText:(NSAttributedString *)_attrtext; - (iToastSettings *)theSettings; @end @interface iToastSettings : NSObject{ NSInteger duration; iToastGravity gravity; CGPoint postition; iToastType toastType; NSDictionary *images; BOOL positionIsSet; } @property (assign) NSInteger duration; @property (assign) iToastGravity gravity; @property (assign) CGPoint postition; @property (readonly) NSDictionary *images; - (void)setImage:(UIImage *)img forType:(iToastType) type; + (iToastSettings *) getSharedSettings; @end #ifdef __cplusplus } #endif /* __cplusplus */