#ifndef USERINTERFACE_H_
#define USERINTERFACE_H_

// Author: Steve Talbot

#pragma once

using namespace std;

#include "Account.h"
#include "ConfigurationFactory.h"
#include "ConfigurationFactory1.h"
#include "ConfigurationFactory2.h"
#include "ConfigurationIds.h"
#include "String_Utilities.h"
#include <iostream>

class UserInterface {

public:
	UserInterface();
	~UserInterface();

	void startProgram();

	void showApplicationTitle();
	void showRootMenu();
	void showConfigurationSubMenu();
	void showMainMenu();
	void showConfiguration1( bool showCurrent_ );
	void showConfiguration2( bool showCurrent_ );
	void showConfigurationMix( bool showCurrent_ );

	string promptForInput( string prompt_, int numberOfCharacters_ );

	// "menu" methods ..
	void parseRootMenuInput( string inputString_ );
	void parseMainMenuInput( string inputString_ );

	// "log in" methods ..
	bool parseLoginInput( string inputString_ );
	void parsePinInput( string inputString_ );

	// "open account" methods ..
	bool parseUserIdInput( string inputString_ );
	bool parseUserPinInput( string inputString_ );
	bool parseAccountBalanceInput( string inputString_ );

	// "change configuration" methods ..
	void parseConfigurationSubMenuInput( string inputString_ );
	void loadConfiguration( ConfigurationFactory* configurationFactory_ );
	void showConfigurationSubMenu2();
	bool parseConfigurationSubMenu2Input( string inputString_, ConfigurationFactory1* cf1_, ConfigurationFactory2* cf2_ );
	void loadMixConfiguration( int selection_, int configurationSelection_, ConfigurationFactory* cf_ );

	// "main menu" methods ..
	bool parseDepositAmountInput( string inputString_ );
	bool parseWithdrawAmountInput( string inputString_ );


private:

	Account* _account;

	bool _showRootMenu;

	bool _showSubMenu1;

	bool _endSession;

	int _id;		// temp user "id" ..

	int _pn;		// temp user "pin" ..

	int _a;			// temp account "initial balance" ..

	string _notAnIntegerMessage;
	
	string _notGreaterThanMinBalanceMessage;

	string _incorrectMenuSelectionMessage;

	string _inputNotReceivedMessage;

	// "0" = first (default), "1" = second ..
	// used for "pick ALL Configuration #1" or "pick ALL Configuration #2" ..
	int _currentConfiguration;

	// 1 - 21 selections, each either "0" = first (default), "1" = second ..
	// used for "Select MIX of Configuration #1 & #2" ..
	vector<int>* _currentMixConfigurations;

	int _minSelection;

	int _maxSelection;

	int _startOPSelection;

	// "_currentMixConfigurations" index constants ..
	int MAX_NUM_PIN_ATTEMPTS_INDEX;		// 0
	int MIN_ACCOUNT_BALANCE_INDEX;		// 1
	int OVERDRAW_PENALTY_INDEX;			// 2
	int LOGIN_INDEX;					// 3
	int PIN_INDEX;						// 4
	int OPEN_ACCOUNT_INDEX;				// 5
	int BALANCE_INDEX;					// 6
	int DEPOSIT_INDEX;					// 7
	int WITHDRAW_INDEX;					// 8
	int PIN_PROMPT_INDEX;				// 9
	int INCORRECT_ID_MSG_INDEX;			// 10
	int INCORRECT_PIN_MSG_INDEX;		// 11
	int TOO_MANY_ATTEMPTS_MSG_INDEX;	// 12
	int DISPLAY_MENU_INDEX;				// 13
	int DEACTIVATE_MSG_INDEX;			// 14
	int MAKE_WITHDRAW_INDEX;			// 15
	int PENALTY_MSG_INDEX;				// 16
	int MAKE_DEPOSIT_INDEX;				// 17
	int DISPLAY_BALANCE_INDEX;			// 18
	int BELOW_MIN_BALANCE_INDEX;		// 19
	int ACTIVATE_MSG_INDEX;				// 20
	int INACTIVE_ACCOUNT_MSG_INDEX;		// 21


};

#endif /*USERINTERFACE_H_*/
