| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- //
- // JSFacade.h
- // kneet2
- //
- // Created by Created by Jason Lee on 10/1/15.
- // Copyright (c) 2015 ntels. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- //#import <ReactiveCocoa/ReactiveCocoa.h>
- #import "Common.h"
- #import "Definitions.h"
- #import "CommonUtil.h"
- //Categories
- #import "NSArray-Addtions.h"
- #import "NSDictionary-Additions.h"
- #import "NSString-Addtions.h"
- #import "NSDate+Utilities.h"
- #import "UIView+Additions.h"
- #import "UIWindow+Addtions.h"
- #import "NSLayoutConstraint+Additions.h"
- #import "UIView+FindUIViewController.h"
- #import "UITableView+EnumarateCells.h"
- #import "TargetConditionals.h"
- #import "Responder+Keyboard.h"
- #import "UINavigationController+CompletionBlock.h"
- #import "UIView+AutoLayout.h"
- //Common UI
- #import "CustomAlertView.h"
- //OpenSource
- @import ReactiveObjC;
- #import "AppDelegate.h"
- #import "LoginModel.h"
- #import "ModeModel.h"
- #import "DataSelectModel.h"
- @class DeviceModel;
- @class MainViewController;
- typedef void(^JDFacadeCompletionCallBackHandler)(void);
- typedef void(^JDFacadeFailureCallBackHandler)(void);
- typedef void(^JDFacadeSelectCallBackHandler)(DataSelectModel *seleced);
- extern CGRect gKeyboardRect;
- @interface JDFacade : NSObject {
- BOOL _isHomeHubOnlineState;
- }
- @property (strong, nonatomic) NSString *deviceUUID; //local uuid
- @property (strong, nonatomic) NSString *APNSToken; //APNS 토큰
- @property (strong, nonatomic) NSString *deviceHostName; //호스트네임
- @property (strong, nonatomic) NSString *keyboardRect; //키보드 사이즈
- @property (strong, nonatomic) LoginModel *loginUser;
- @property (strong, nonatomic) SignUpModel *signUpUser;
- @property (strong, nonatomic) NSString *signType; // 회원가입 유형
- @property (strong, nonatomic) NSArray<ModeModel> *modeList;
- @property (assign, nonatomic) KNMenuId wishMenuId;
- @property (assign, nonatomic) BOOL hasLoggedIn;
- //Local Temporary Variables
- @property (strong, nonatomic) NSString *tmpHomegrpName;
- @property (strong, nonatomic) NSString *tmpEmailId;
- @property (strong, nonatomic) NSString *tmpPassword;
- //tasks
- @property (weak, nonatomic) NSOperation *currentOperation;
- @property (weak, nonatomic) MainViewController *mainViewController;
- //Local Temporary Variables
- + (JDFacade *)facade;
- - (AppDelegate *)appDelegate;
- //Screens
- - (UIViewController *)currentViewController;
- - (id)viewControllerOnNaviationController:(Class)viewControllerClass;
- - (id)viewControllerOnPresentingViewController:(UIViewController *)vc viewControllerClass:(Class)viewControllerClass;
- - (id)viewControllerOnPresentedViewController:(UIViewController *)pvc viewControllerClass:(Class)viewControllerClass;
- //Keychain Wrapper
- - (void)storeObjectToKeychain:(id)object forKey:(NSString *)aKey;
- - (id)objectForKeyFromKeychain:(NSString *)aKey;
- - (void)removeObjectAtKeychain:(NSString *)aKey;
- //UserDefautls - Local Store
- - (void)storeObjectToUserDefaults:(id)object forKey:(NSString *)aKey;
- - (id)objectForKeyFromUserDefaults:(NSString *)aKey;
- //loading
- - (void)loadIndicator:(BOOL)showIndicator allowUserInteraction:(BOOL)allowUserInteracton;
- - (void)loadIndicatorWhileExecutingBlock:(dispatch_block_t)block;
- - (void)showLoadingWhileExecutingBlock:(dispatch_block_t)block completionHandler:(JDFacadeCompletionCallBackHandler)completion;
- //alert
- - (void)alert:(NSString *)message;
- - (void)warn:(NSString *)message;
- - (void)alert:(NSString *)message completionHander:(JDFacadeCompletionCallBackHandler)completion;
- - (void)alertTitle:(NSString *)title message:(NSString *)message;
- - (void)alertTitle:(NSString *)title message:(NSString *)message completionHander:(JDFacadeCompletionCallBackHandler)completion;
- - (void)confirm:(NSString *)message completion:(CustomAlertViewCallBackHandler)completion;
- - (void)confirmTitle:(NSString *)title message:(NSString *)message completion:(CustomAlertViewCallBackHandler)completion;
- - (void)confirmTitle:(NSString *)title message:(NSString *)message btnOKLabel:(NSString *)btnOKLabel
- btnCancelLabel:(NSString *)btnCancelLabel completion:(CustomAlertViewCallBackHandler)completion;
- - (void)retryAlert:(NSString *)message target:(id)target selector:(SEL)selector;
- - (void)retryAlert:(NSString *)message target:(id)target selector:(SEL)selector arguments:(id)arguments,... NS_REQUIRES_NIL_TERMINATION;
- - (void)retryAlert:(NSString *)message completionHander:(JDFacadeCompletionCallBackHandler)handler;
- -(void)selectDatas:(id)target listInfo:(DataSelectListModel *)listInfo completion:(JDFacadeSelectCallBackHandler)completion;
- - (void)fireLocalNotification:(NSString *)message;
- - (void)toast:(NSString *)message;
- //Control UI
- - (id)getRadioButtonStatus:(id)object;
- - (void)setRadioButtonStatus:(id)status object:(id)object;
- - (id)getCheckBoxStatus:(id)object;
- - (void)setCheckBoxStatus:(id)status object:(id)object;
- - (void)presentViewControllerByPush:(UIViewController *)vc;
- - (void)presentViewControllerByPush:(UIViewController *)vc pvc:(UIViewController *)pvc;
- - (void)dismissViewControllerByPush:(UIViewController *)vc;
- - (void)dismissViewControllerByPush:(UIViewController *)vc completion:(JDFacadeCompletionCallBackHandler)completion;
- - (void)dismissAllViewControllers;
- - (void)dismissModalStack:(BOOL)animated completion:(JDFacadeCompletionCallBackHandler)completion;
- //Biz Logic
- - (void)requestPollingHomeHubStatusInBackground;
- - (void)requestPollingHomeHubStatus:(JDFacadeCompletionCallBackHandler)completion;
- //UI Flow
- - (void)gotoLoginView;
- //- (void)gotoLoginViewWithExpiring;
- - (void)logout;
- - (void)loadInvitationView;
- - (void)loadSettingsNumChangeView;
- - (void)loadHomeHubView;
- - (void)gotoHomeHubRegistration;
- - (void)gotoStartHome:(BOOL)canGoBack;
- //- (void)gotoTutorial:(BOOL)isCalledFromMenu;
- - (void)gotoWishMenu:(KNMenuId)menuId;
- - (void)gotoWishMenu:(KNMenuId)menuId completion:(JDFacadeCompletionCallBackHandler)completion;
- //- (void)updateHomegrpListForLoginUser:(JDFacadeCompletionCallBackHandler)completion;
- - (void)updateLoginInfo:(JDFacadeCompletionCallBackHandler)completion;
- - (void)updateMainViewController;
- - (void)loadURLExternalBrowser:(NSString *)URLString;
- - (void)alertCameraPermissionDisabled;
- //Debug
- - (BOOL)redirectNSLog;
- - (void)showFlex;
- -(NSString *)getUrlWithCustID:(NSString *)str aditional:(NSString *)aditional;
- -(NSString *)getUrlWithCustAndGroupID:(NSString *)str aditional:(NSString *)aditional;
- -(NSString *)getUrlWithCustAndGroupID:(NSString *)str arguments:(NSArray *)arguments;
- -(NSString *)getUrlWithArr:(NSString *)str arguments:(NSArray *)arguments;
- -(NSString *)getUrlWithCustGroupIDAndMemberID:(NSString *)str;
- -(NSString *)getUrlWithCustAndGroupIDAndInputMemId:(NSString *)str inputId:(NSString *)inputId;
- - (NSString*)deviceIconFromSourceSubId:(NSString*)source;
- - (NSString*)deviceIconFromSourceName:(NSString*)name;
- @end
|