/*
 * Created on Feb 18, 2004
 *
 */
package LumiSoft.UI.Controls.Grid;

import java.util.*;
import LumiSoft.Data.*;

/**
 * Grid events.
 */
public interface WGridListener extends EventListener
{
	/**
	 * Invoked when active row changed.
	 * @param dr Row what is new active row or null if no active row.
	 */
	public void OnActiveRowChanged(DataRowView dr);
	
	/**
	 * Invoked when row double clicked.
	 * @param dr Row what double clicked.
	 */
	public void OnRowDoubleClicked(DataRowView dr);
	
	/**
	 * Invoked when grid needs to add new row.
	 * @param dr Row what to add.
	 * @return Return false to cancel this operation.
	 */
	public boolean OnAddRow(DataRowView dr);
	
	/**
	 * Invoked when grid needs to delete row.
	 * @param dr Row what to delete.
	 * @return Return false to cancel this operation.
	 */
	public boolean OnDeleteRow(DataRowView dr);
	
	/**
	 * Invoked when grid needs to update row.
	 * @param dr Row what to update.
	 * @return Return false to cancel this operation.
	 */
	public boolean OnUpdateRow(DataRowView dr);
	
	/**
	 * Invoked when grid needs to store cell value.
	 * @param column Column what value to validate.
	 * @param dr DataRow what value to validate.
	 * @param value Value to validate.
	 * @return Return false to cancel this operation.
	 */
	public boolean OnValidateCellValue(WGridColumn column,DataRowView dr,Object value);
	
	/**
	 * Invoked when new newitem row added. This place is usefull for applying row default values.
	 * @param dr New DataRow what added. 
	 */
	public void OnNewItemRowAdded(DataRowView dr);
	
	/**
	 * Invoked when Main Grid View minimize/maximize button pressed.
	 * @param maximized
	 */
	public void OnMaxMinButtonPressed(boolean maximized);
}
