package jrummikub.view;

import jrummikub.util.IEvent;
import jrummikub.util.IEvent1;
import jrummikub.util.LoginData;

/**
 * LoginPanel for network game
 * 
 */
public interface ILoginPanel {

	/**
	 * Player has offered all information and wants to connect
	 * 
	 * @return LoginData username, server, password, channel
	 */
	public IEvent1<LoginData> getLoginEvent();

	/**
	 * Emitted when the user cancels the login process
	 * 
	 * @return the event
	 */
	public IEvent getCancelEvent();

	/**
	 * Emitted when the user presses the use dedicated server button
	 * 
	 * @return the event
	 */
	IEvent1<String> getUseDedicatedServerEvent();

	/**
	 * Set the server info in the login panel
	 * 
	 * @param server
	 *            the server's hostname
	 */
	void setServer(String server);

	/**
	 * Set the channel to use
	 * 
	 * @param channel
	 *            channel to use
	 */
	void setChannel(String channel);

	/**
	 * Sets whether the dedicated server is running
	 * 
	 * @param running
	 *            whether the dedicated server is running
	 */
	void setDedicatedServerRunning(boolean running);

}