123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- //
- // UIFactory.h
- // SmartMeeting
- //
- // Created by luddong on 12-3-30.
- // Copyright (c) 2012年 Twin-Fish. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- #define g_UIFactory [UIFactory sharedUIFactory]
- @interface UIFactory : NSObject
- /**--------------------------------
- * Create UITextField
- *
- * frame :CGRect
- * delegate :id<UITextFieldDelegate>
- * returnKeyType :UIReturnKeyType
- * secureTextEntry :BOOL
- * placeholder :NSString
- * font :UIFont
- *
- */
- + (id)createTextFieldWith:(CGRect)frame
- delegate:(id<UITextFieldDelegate>)delegate
- returnKeyType:(UIReturnKeyType)returnKeyType
- secureTextEntry:(BOOL)secureTextEntry
- placeholder:(NSString *)placeholder
- font:(UIFont *)font;
- /**--------------------------------
- * Create UILabel
- *
- * frame :CGRect
- * label :NSString
- *
- */
- + (id)createLabelWith:(CGRect)frame
- text:(NSString *)text;
- /**--------------------------------
- * Create UILabel
- *
- * frame :CGRect
- * label :NSString
- *
- */
- + (id)createClearBackgroundLabelWith:(CGRect)frame
- text:(NSString *)text;
- /**--------------------------------
- * Create UILabel
- *
- * frame :CGRect
- * label :NSString
- * backgroundColor :UIColor
- *
- */
- + (id)createLabelWith:(CGRect)frame
- text:(NSString *)text
- backgroundColor:(UIColor *)backgroundColor;
- /**--------------------------------
- * Create UILabel
- *
- * frame :CGRect
- * label :NSString
- * font :UIFont
- * textColor :UIColor
- * backgroundColor :UIColor
- *
- */
- + (id)createLabelWith:(CGRect)frame
- text:(NSString *)text
- font:(UIFont *)font
- textColor:(UIColor *)textColor
- backgroundColor:(UIColor *)backgroundColor;
- /**--------------------------------
- * Convert Resizable (Stretchable) Image;
- *
- * title :NSString *
- * message :NSString *
- */
- +(UIView*)createLine:(UIColor*)color parent:(UIView*)parent;
- +(UIView*)createLine:(UIView*)parent;
- + (UIImage*)resizableImageWithSize:(CGSize)size
- image:(UIImage*)image;
- + (UIButton *)createCommonButton:(NSString *)title target:(id)target action:(SEL)selector;
- + (UIButton *)createButtonWithTitle:(NSString *)title
- titleFont:(UIFont *)font
- titleColor:(UIColor *)titleColor
- normal:(NSString *)normalImage
- highlight:(NSString *)clickIamge;
- + (UIButton *)createButtonWithImage:(NSString *)normalImage
- highlight:(NSString *)clickIamge
- target:(id)target
- selector:(SEL)selector;
- + (UIButton *)createButtonWithImage:(NSString *)normalImage
- selected:(NSString *)clickIamge
- target:(id)target
- selector:(SEL)selector;
- + (UIButton *)createButtonWithTitle:(NSString *)title
- titleFont:(UIFont *)font
- titleColor:(UIColor *)titleColor
- normal:(NSString *)normalImage
- highlight:(NSString *)clickIamge
- selected:(NSString *)selectIamge;
-
- + (UIButton *)createButtonWithRect:(CGRect)frame
- title:(NSString *)title
- titleFont:(UIFont *)font
- titleColor:(UIColor *)titleColor
- normal:(NSString *)normalImage
- selected:(NSString *)clickIamge
- selector:(SEL)selector
- target:(id)target;
- + (UIButton *)createButtonWithRect:(CGRect)frame
- title:(NSString *)title
- titleFont:(UIFont *)font
- titleColor:(UIColor *)titleColor
- normal:(NSString *)normalImage
- highlight:(NSString *)clickIamge
- selector:(SEL)selector
- target:(id)target;
- + (UIButton *)createButtonWithRect:(CGRect)frame
- title:(NSString *)title
- titleFont:(UIFont *)font
- titleColor:(UIColor *)titleColor
- normal:(NSString *)normalImage
- highlight:(NSString *)clickIamge
- fixed:(CGSize)fixedSize
- selector:(SEL)selector
- target:(id)target;
- + (UIButton *)createButtonWithRect:(CGRect)frame
- title:(NSString *)title
- titleFont:(UIFont *)font
- titleColor:(UIColor *)titleColor
- normal:(NSString *)normalImage
- highlight:(NSString *)clickIamge
- selected:(NSString *)selectedImage
- selector:(SEL)selector
- target:(id)target;
- + (UITextField *)createTextFieldWithRect:(CGRect)frame
- keyboardType:(UIKeyboardType)keyboardType
- secure:(BOOL)secure
- placeholder:(NSString *)placeholder
- font:(UIFont *)font
- color:(UIColor *)color
- delegate:(id)delegate;
- +(UIButton*)createCheckButtonWithRect:(CGRect)frame
- selector:(SEL)selector
- target:(id)target;
- + (UIButton *)createRadioButtonWithRect:(CGRect)frame
- normalImage:(NSString *)normalImage
- selectedImage:(NSString *)selectedImage
- labelText:(NSString *)labelText
- textColor:(UIColor*)textColor
- selector:(SEL)selector
- target:(id)target
- thisView:(UIView*)thisView;
- + (UIButton *)createRadioButtonWithRect:(CGRect)frame
- labelText:(NSString *)labelText
- textColor:(UIColor*)textColor
- selector:(SEL)selector
- target:(id)target
- thisView:(UIView*)thisView;
- +(UIButton*)createTopButton:(NSString*)s action:(SEL)action target:(id)target;
- + (NSString *)localized:(NSString *)key;
- /**--------------------------------
- * Check Network Address Validation
- *
- * address :NSString *
- */
- + (BOOL)isValidIPAddress:(NSString *)address;
- + (BOOL)isValidPortAddress:(NSString *)address;
- + (BOOL)checkIntValueRange:(NSString *)value min:(int)min max:(int)max;
- + (NSString *)checkValidName:(NSString *)value;
- + (NSString *)checkValidPhoneNumber:(NSString *)value;
- + (void)dissAlert;
- + (void)showAlert:(NSString *)message;
- + (void)showAlert:(NSString *)message tag:(NSUInteger)tag delegate:(id)delegate;
- + (void)showConfirm:(NSString *)message tag:(NSUInteger)tag delegate:(id)delegate;
- + (NSString *)stringFromDate:(NSDate *)date format:(NSString *)formatStr;
- + (NSDate *)dateFromString:(NSString *)str format:(NSString *)formatStr;
- +(void)freeTable:(NSMutableArray*)pool;
- +(void)addToPool:(NSMutableArray*)pool object:(NSObject*)object;
- + (UIFactory*)sharedUIFactory;
- +(void)onGotoBack:(UIViewController*)vc;
- -(void)removeAllChild:(UIView*)parent;
- @property (nonatomic, strong) UIFont* font7;
- @property (nonatomic, strong) UIFont* font8;
- @property (nonatomic, strong) UIFont* font9;
- @property (nonatomic, strong) UIFont* font10;
- @property (nonatomic, strong) UIFont* font11;
- @property (nonatomic, strong) UIFont* font12;
- @property (nonatomic, strong) UIFont* font13;
- @property (nonatomic, strong) UIFont* font14;
- @property (nonatomic, strong) UIFont* font15;
- @property (nonatomic, strong) UIFont* font16;
- @property (nonatomic, strong) UIFont* font17;
- @property (nonatomic, strong) UIFont* font18;
- @property (nonatomic, strong) UIFont* font20;
- @property (nonatomic, strong) UIFont* font24;
- @property (nonatomic, strong) UIFont* font28;
- @property (nonatomic, strong) UIFont* font7b;
- @property (nonatomic, strong) UIFont* font8b;
- @property (nonatomic, strong) UIFont* font9b;
- @property (nonatomic, strong) UIFont* font10b;
- @property (nonatomic, strong) UIFont* font11b;
- @property (nonatomic, strong) UIFont* font12b;
- @property (nonatomic, strong) UIFont* font13b;
- @property (nonatomic, strong) UIFont* font14b;
- @property (nonatomic, strong) UIFont* font15b;
- @property (nonatomic, strong) UIFont* font16b;
- @property (nonatomic, strong) UIFont* font17b;
- @property (nonatomic, strong) UIFont* font18b;
- @property (nonatomic, strong) UIFont* font20b;
- @property (nonatomic, strong) UIFont* font24b;
- @property (nonatomic, strong) UIFont* font28b;
- @end
- @interface UIImage (ImageNamed)
- + (UIImage *)imageNamed:(NSString *)name;
- @end
- extern NSString *kStyle2Dir;
|