//------------------------------------------------------------------------------
// <copyright file=”*.cs” company=”EhLib Team”>
//     Copyright (c) 2017 Dmitry V. Bolshakov   
// </copyright>
//------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Design;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Reflection;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;

namespace EhLib
{

  public class DataGridFooterCellPaintEventArgs : BaseGridCellPaintEventArgs
  {

    public DataGridFooterCellPaintEventArgs(BaseGridCellManager cellManager, Graphics graphics, int colIndex, int rowIndex,
      Rectangle cellRect, BasePaintCellStates state, int areaColIndex, int areaRowIndex, Point inCellMousePos,
      DataGridColumn column)
      : base(cellManager, graphics, colIndex, rowIndex, cellRect, state, areaColIndex, areaRowIndex, inCellMousePos)
    {
      Column = column;
    }

    public DataGridColumn Column { get; internal set; }

    public new DataGridFooterCellMan CellManager
    {
      get { return (DataGridFooterCellMan)base.CellManager; }
    }

    public Rectangle ContentRect { get; internal set; }
    public TextFormatFlags AlignFlags { get; set; }
    public Color BackColor { get; set; }
    public bool EndEllipsis { get; set; }
    public Font Font { get; set; }
    public Color ForeColor { get; set; }
    public Padding Padding { get; set; }
    public Orientation TextOrientation { get; set; }
    public DataGridTextWrapMode WrapMode { get; set; }

    public CellFillStyle FillStyle { get; set; }
    public Color SecondFillColor { get; set; }
    public CellInnerBorderStyle InnerBorder { get; set; }
    public HorizontalAlignment HorzAlign { get; set; }
    public VerticalAlignment VertAlign { get; set; }
    public bool WordWrap { get; set; }


    public virtual void Paint(DataGridFooterCellPaintEventArgs e)
    {
      CellManager.OnPaint(e);
    }

    public virtual void PaintBackground(DataGridFooterCellPaintEventArgs e)
    {
      CellManager.OnPaintBackground(e);
    }

    public virtual void PaintForeground(DataGridFooterCellPaintEventArgs e)
    {
      CellManager.OnPaintForeground(e);
    }
  }

  public class DataGridFooterCalculationEventArgs : HandledEventArgs
  {

    public DataGridFooterCalculationEventArgs(DataGridColumn column, DataGridRow row, DataGridColumnFooterItem footerItem, int footerItemIndex, int step)
    {
      Column = column;
      Row = row;
      FooterItem = footerItem;
      FooterItemIndex = footerItemIndex;
      Step = step;
    }

    public void Reset(DataGridColumn column, DataGridRow row, DataGridColumnFooterItem footerItem, int footerItemIndex, int step)
    {
      Column = column;
      Row = row;
      FooterItem = footerItem;
      FooterItemIndex = footerItemIndex;
      Step = step;
      Handled = false;
    }

    public DataGridColumn Column { get; internal set; }

    public DataGridRow Row { get; internal set; }

    public DataGridColumnFooterItem FooterItem { get; internal set; }

    public int FooterItemIndex { get; internal set; }

    public int Step { get; internal set; }

    public object Value { get; set; }

  }

  public class DataGridFooterCellFormatValueEventArgs : HandledEventArgs
  {

    public DataGridFooterCellFormatValueEventArgs(DataGridColumn column, DataGridColumnFooterItem footerItem, int footerItemIndex, object sourceValue)
    {
      Column = column;
      FooterItem = footerItem;
      FooterItemIndex = footerItemIndex;
      SourceValue = sourceValue;
    }

    public void Reset(DataGridColumn column, DataGridColumnFooterItem footerItem, int footerItemIndex, object sourceValue)
    {
      Column = column;
      FooterItem = footerItem;
      FooterItemIndex = footerItemIndex;
      SourceValue = sourceValue;
      Handled = false;
    }

    public DataGridColumn Column { get; internal set; }

    public DataGridRow Row { get; internal set; }

    public DataGridColumnFooterItem FooterItem { get; internal set; }

    public int FooterItemIndex { get; internal set; }

    public object SourceValue { get; internal set; }

    public object FormatedValue { get; set; }

  }

  public class DataGridFooterCellMouseEventArgs : BaseGridCellMouseEventArgs
  {
    public DataGridFooterCellMouseEventArgs(BaseGridCellManager cellManager, int colIndex, int rowIndex,
      int areaColIndex, int areaRowIndex, int inCellX, int inCellY, Rectangle cellRect,
      MouseEventArgs e, DataGridColumn column, DataGridColumnFooterItem footerItem, int footerItemIndex)
      : base(cellManager, colIndex, rowIndex, areaColIndex, areaRowIndex, inCellX, inCellY, cellRect, e)
    {
      this.Column = column;
      this.FooterItem = footerItem;
      this.FooterItemIndex = footerItemIndex;
    }

    public DataGridColumn Column { get; internal set; }

    public DataGridColumnFooterItem FooterItem { get; internal set; }

    public int FooterItemIndex { get; internal set; }
  }

  public class DataGridFooterCellEnterEventArgs : BaseGridCellEnterEventArgs
  {
    public DataGridFooterCellEnterEventArgs(
      int colIndex, int rowIndex, int areaColIndex, int areaRowIndex, Rectangle cellRect, int leaveColIndex, int leaveRowIndex, 
      DataGridColumn column, DataGridColumnFooterItem footerItem, int footerItemIndex)
      : base(colIndex, rowIndex, areaColIndex, areaRowIndex, cellRect, leaveColIndex, leaveRowIndex)
    {
      this.Column = column;
      this.FooterItem = footerItem;
      this.FooterItemIndex = footerItemIndex;
    }

    public DataGridColumn Column { get; internal set; }

    public DataGridColumnFooterItem FooterItem { get; internal set; }

    public int FooterItemIndex { get; internal set; }

  }

  public class DataGridFooterCellLeaveEventArgs : BaseGridCellLeaveEventArgs
  {
    public DataGridFooterCellLeaveEventArgs(
      int colIndex, int rowIndex, int areaColIndex, int areaRowIndex, Rectangle cellRect, int enterColIndex, int enterRowIndex,
      DataGridColumn column, DataGridColumnFooterItem footerItem, int footerItemIndex)
      : base(colIndex, rowIndex, areaColIndex, areaRowIndex, cellRect, enterColIndex, enterRowIndex)
    {
      this.Column = column;
      this.FooterItem = footerItem;
      this.FooterItemIndex = footerItemIndex;
    }

    public DataGridColumn Column { get; internal set; }

    public DataGridColumnFooterItem FooterItem { get; internal set; }

    public int FooterItemIndex { get; internal set; }

  }

}