forked from ecstasy2/toast-notifications-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iToast.h
84 lines (61 loc) · 1.62 KB
/
iToast.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// 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>
typedef enum iToastGravity {
iToastGravityTop = 1000001,
iToastGravityBottom,
iToastGravityCenter
}iToastGravity;
enum iToastDuration {
iToastDurationLong = 10000,
iToastDurationShort = 1000,
iToastDurationNormal = 3000
}iToastDuration;
typedef enum iToastType {
iToastTypeInfo = -100000,
iToastTypeNotice,
iToastTypeWarning,
iToastTypeError,
iToastTypeNone // For internal use only (to force no image)
}iToastType;
@class iToastSettings;
@interface iToast : NSObject {
iToastSettings *_settings;
NSInteger offsetLeft;
NSInteger offsetTop;
NSTimer *timer;
UIView *view;
NSString *text;
}
- (void) show;
- (void) show:(iToastType) type;
- (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;
-(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