//
//  MVMCoreUITabBarPageControlViewController.h
//  mobilefirst
//
//  Created by Scott Pfeil on 2/11/16.
//  Copyright © 2016 Verizon Wireless. All rights reserved.
//

#import <MVMCoreUI/MFViewController.h>
#import <MVMCoreUI/TopTabbar.h>
@import MVMCore.MVMCoreViewManagerProtocol;
@class MVMCoreLoadObject;

@interface MVMCoreUITabBarPageControlViewController : MFViewController <TopTabbarDataSource,TopTabbarDelegate,MVMCoreViewManagerProtocol>

@property (nullable, weak, nonatomic) TopTabbar *tabBar;
@property (nonnull, strong, nonatomic, readonly) UIViewController <MVMCoreViewControllerProtocol>*viewController;
@property (assign, nonatomic, readonly) BOOL tabbarIsShown;

// Can be used to store values for pages on different tabs to share.
@property (nullable, strong, nonatomic) NSMutableDictionary *sharedObjects;

// For server driven architecture.
- (nullable instancetype)initWithViewController:(nonnull UIViewController <MVMCoreViewControllerProtocol>*)viewController loadObject:(nullable MVMCoreLoadObject *)loadObject tabsInfo:(nonnull NSArray *)tabsInfo;
- (nullable instancetype)initWithViewController:(nonnull UIViewController <MVMCoreViewControllerProtocol>*)viewController loadObject:(nullable MVMCoreLoadObject *)loadObject tabsInfo:(nonnull NSArray *)tabsInfo shoudEnableSwipeGestures:(BOOL)enableSwipeGestures;

// For client driven architecture
- (nullable instancetype)initWithViewControllers:(nonnull NSArray <UIViewController<MVMCoreViewControllerProtocol>*>*)viewControllers tabNames:(nonnull NSArray <NSString*>*)tabNames loadObject:(nullable MVMCoreLoadObject *)loadObject tabsInfo:(nonnull NSArray *)tabsInfo selectedIndex:(NSUInteger)selectedIndex shoudEnableSwipeGestures:(BOOL)enableSwipeGestures;

// Returns the number of tabs
- (NSInteger)numberOfTabs;

// Returns the informations for the selected tab
- (nullable NSDictionary *)infoForSelectedTab;

// Programmatically selects a tab as if the user had selected it.
- (void)selectTabAtIndex:(NSUInteger)index animated:(BOOL)shouldAnimate;
- (void)swipeToNextViewController;
- (void)swipeToPreviousViewController;

// Returns a the tab for a page with a passed in page type. Returns NSNotFound if not present.
- (NSInteger)tabForPageWithPageType:(nullable NSString *)pageType;

// For showing and hiding the top tab bar.
- (void)show:(BOOL)show animated:(BOOL)animated;

// Override to add tracking when a tab is selected.
- (void)trackSelectTab;

// Overide to pass custom parameters or additional data for a new tab load.
- (nullable NSDictionary *)getAdditionalDataForNewTabLoad:(nullable NSDictionary *)actionMap;
- (nonnull MVMCoreRequestParameters *)getRequestParametersForNewTabLoad:(nonnull MVMCoreRequestParameters *)requestParameters actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData;

@end
