//
//  MVMCoreUIMoleculeViewProtocol.h
//  MVMCoreUI
//
//  Created by Scott Pfeil on 2/11/19.
//  Copyright © 2019 Verizon Wireless. All rights reserved.
//

#import <UIKit/UIKit.h>
@import MVMCore.MVMCoreViewProtocol;
@class MVMCoreUIDelegateObject;
@class MVMCoreErrorObject;

@protocol MVMCoreUIMoleculeViewProtocol <NSObject, MVMCoreViewProtocol>

/// Sets up the ui based on the json
- (void)setWithJSON:(nullable NSDictionary *)json delegateObject:(nullable MVMCoreUIDelegateObject *)delegateObject additionalData:(nullable NSDictionary *)additionalData;

@optional

/// Called after init to provide an early setter for any molecule specific logic
- (void)setAsMolecule;

/// Resets to default state before set with json is called again.
- (void)reset;


/// For the molecule list to load more efficiently.
+ (CGFloat)estimatedHeightForRow:(nullable NSDictionary *)json delegateObject:(nullable MVMCoreUIDelegateObject *)delegateObject;

/// Allows the molecule to set its name for reuse. Default could be moleculeName.
+ (nullable NSString *)nameForReuse:(nullable NSDictionary *)molecule delegateObject:(nullable MVMCoreUIDelegateObject *)delegateObject;

/// Can return the required modules
+ (nullable NSArray <NSString *>*)requiredModules:(nullable NSDictionary *)json delegateObject:(nullable MVMCoreUIDelegateObject *)delegateObject error:(MVMCoreErrorObject *_Nullable *_Nullable)error;

@end


