//
//  ViewController.h
//  RedAnt ERP Suite
//
//  Created by Ray on 14-5-19.
//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CategoryViewController.h"
#import "HomeViewController.h"
#import "CartViewController.h"
#import "WatchListViewController.h"
#import "LoginViewController.h"
#import "RAViewController.h"
#import "OrderListViewController.h"
#import "SearchViewController.h"
#import "CustomerInfoViewController.h"
#import "ItemSearchViewController.h"
#import "PDFListViewController.h"
#import "PortfolioViewController.h"
#import "ContactListViewController.h"


//#import "OrderInfoViewController.h"
//#define VC_HOME 0
//#define VC_CATEGORY 1
//#define VC_CART 2


@interface MainViewController : UIViewController<UITableViewDataSource,UITableViewDelegate,CategoryMenuDelegate/*,CommonEditorViewControllerDelegate*/>
@property (strong, nonatomic) IBOutlet UIImageView *user_head;
@property (strong, nonatomic) IBOutlet UIImageView *blurView;
@property (strong, nonatomic) IBOutlet UIView *sideMenu;
@property (strong, nonatomic) IBOutlet UIView *container;
@property (strong, nonatomic) IBOutlet UITableView *sideMenuTable;
@property  (strong,nonatomic)HomeViewController* homeViewController;
@property  (strong,nonatomic)CategoryViewController* categoryViewController;
@property  (strong,nonatomic)CartViewController* cartViewController;
@property  (strong,nonatomic)OrderListViewController* orderViewController;
@property  (strong,nonatomic)ItemSearchViewController* itemSearchViewController;
@property  (strong,nonatomic)WatchListViewController* watchListViewController;
@property  (strong,nonatomic)PortfolioViewController* portfolioViewController;
@property  (strong,nonatomic)ContactListViewController* contactListViewController;
@property  (strong,nonatomic)PDFListViewController* pdfListViewController;
@property (strong, nonatomic) IBOutlet UIButton *backgroundButton;

@property (strong, nonatomic) IBOutlet UIButton *btn_LogoHome;


@property  (strong,nonatomic)SearchViewController* searchViewController;
//@property (strong, nonatomic) IBOutlet UILabel *labelUser;
//@property (strong, nonatomic) IBOutlet UILabel *labelHello;
@property (strong, nonatomic) IBOutlet UIButton *buttonUser;


@property (strong, nonatomic) IBOutlet UILabel *labelSo;


@property (strong,nonatomic) NSMutableArray * sideMenuItems;
@property  (strong,nonatomic)UIViewController* current_VC;
@property  (strong,nonatomic)UIViewController* previous_VC;
@property (strong, nonatomic) IBOutlet UILabel *sideMenu_UserName;
@property (strong, nonatomic) IBOutlet UIButton *btn_sideMenu_UserName;

@property (strong, nonatomic) IBOutlet UIButton *btnLogin;
//@property (strong, nonatomic) IBOutlet UILabel *labelContact;
@property (strong, nonatomic) IBOutlet UIButton *btnContact;
- (void) flipFromViewController:(UIViewController*) fromController
               toViewController:(UIViewController*) toController
                  withDirection:(UIViewAnimationOptions) direction;
@property (strong, nonatomic) IBOutlet UILabel *labelVer;
- (void)showMenu;
- (void)hideMenu;
- (void) reload;
- (void) checklogin:(bool) reloadCurrentVC;
@property (strong, nonatomic) IBOutlet UIView *headerView;
- (UIImage*)screen_shot;
@property (strong, nonatomic) IBOutlet UIButton *openMenuButton;
@property bool menuShown;
@property (strong, nonatomic) IBOutlet UIButton *menuButton;
//@property bool is_home;
//@property int current_vc;
//@property (strong, nonatomic) IBOutlet UIButton *menuButton;
//@property (strong,nonatomic)NSDictionary* categoryMenu;
@property (strong, nonatomic) IBOutlet UILabel *labelMode;
-(void)topicViewSelected:(int) type _id: (int) _id;
-(void)categoryMenuSelected:(NSString*)_id;
- (void)switchToCagegory:(NSString* )category;
- (void)switchToItemSearch:(NSString* )coverttype;
-(void) reloadDocuments:(BOOL) update_data immediately:(bool)immediately;
-(void) reloadCart:(BOOL) update_data immediately:(bool)immediately;
-(void) reloadWish:(BOOL) update_data immediately:(bool)immediately;
-(void) reloadPortfolio:(BOOL) update_data immediately:(bool)immediately;
-(void) reloadOrder:(BOOL) update_data immediately:(bool)immediately;
-(void) reloadContact:(BOOL) update_data immediately:(bool)immediately;
-(void) reloadCategory:(BOOL) update_data immediately:(bool)immediately;



@property (strong, nonatomic) IBOutlet UIView *employee_bp;
@property (strong, nonatomic) IBOutlet UIView *customer_bp;
@property (strong, nonatomic) IBOutlet UILabel *label_cccount;
@property (strong, nonatomic) IBOutlet UILabel *label_cwcount;


@property (strong, nonatomic) IBOutlet UILabel *label_wcount;

-(void) logoutDocuments;
-(void) logoutCart;
-(void) logoutWish;
-(void) logoutPortfolio;
-(void) logoutOrder;
-(void) logoutContact;
-(void) logoutCategory;

-(void) switchToPreviousVC;
-(void) Loginout:(bool)showlogin;
-(void) switchToOrder;
-(void) switchToCart;
-(void)switchToHome;
@property (strong, nonatomic) IBOutlet UILabel *label_ccount;

-(void)initMenuItems;

@end
