1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- //
- // iToast.h
- // iToast
- //
- // Created by Diallo Mamadou Bobo on 2/10/11.
- // Copyright 2011 __MyCompanyName__. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
- #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<NSCopying>{
- 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 */
|