/*
* Delegates - All delegate definitions used in ObjectListView
*
* Author: Phillip Piper
* Date: 31-March-2011 5:53 pm
*
* Change log:
* 2011-03-31 JPP - Split into its own file
*
* Copyright (C) 2011-2014 Phillip Piper
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* If you wish to use this code in a closed source application, please contact phillip_piper@bigfoot.com.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace BrightIdeasSoftware {
#region Delegate declarations
///
/// These delegates are used to extract an aspect from a row object
///
public delegate Object AspectGetterDelegate(Object rowObject);
///
/// These delegates are used to put a changed value back into a model object
///
public delegate void AspectPutterDelegate(Object rowObject, Object newValue);
///
/// These delegates can be used to convert an aspect value to a display string,
/// instead of using the default ToString()
///
public delegate string AspectToStringConverterDelegate(Object value);
///
/// These delegates are used to get the tooltip for a cell
///
public delegate String CellToolTipGetterDelegate(OLVColumn column, Object modelObject);
///
/// These delegates are used to the state of the checkbox for a row object.
///
///
/// For reasons known only to someone in Microsoft, we can only set
/// a boolean on the ListViewItem to indicate it's "checked-ness", but when
/// we receive update events, we have to use a tristate CheckState. So we can
/// be told about an indeterminate state, but we can't set it ourselves.
///
/// As of version 2.0, we can now return indeterminate state.
///
public delegate CheckState CheckStateGetterDelegate(Object rowObject);
///
/// These delegates are used to get the state of the checkbox for a row object.
///
///
///
public delegate bool BooleanCheckStateGetterDelegate(Object rowObject);
///
/// These delegates are used to put a changed check state back into a model object
///
public delegate CheckState CheckStatePutterDelegate(Object rowObject, CheckState newValue);
///
/// These delegates are used to put a changed check state back into a model object
///
///
///
///
public delegate bool BooleanCheckStatePutterDelegate(Object rowObject, bool newValue);
///
/// The callbacks for RightColumnClick events
///
public delegate void ColumnRightClickEventHandler(object sender, ColumnClickEventArgs e);
///
/// This delegate will be used to own draw header column.
///
public delegate bool HeaderDrawingDelegate(Graphics g, Rectangle r, int columnIndex, OLVColumn column, bool isPressed, HeaderStateStyle stateStyle);
///
/// This delegate is called when a group has been created but not yet made
/// into a real ListViewGroup. The user can take this opportunity to fill
/// in lots of other details about the group.
///
public delegate void GroupFormatterDelegate(OLVGroup group, GroupingParameters parms);
///
/// These delegates are used to retrieve the object that is the key of the group to which the given row belongs.
///
public delegate Object GroupKeyGetterDelegate(Object rowObject);
///
/// These delegates are used to convert a group key into a title for the group
///
public delegate string GroupKeyToTitleConverterDelegate(Object groupKey);
///
/// These delegates are used to get the tooltip for a column header
///
public delegate String HeaderToolTipGetterDelegate(OLVColumn column);
///
/// These delegates are used to fetch the image selector that should be used
/// to choose an image for this column.
///
public delegate Object ImageGetterDelegate(Object rowObject);
///
/// These delegates are used to draw a cell
///
public delegate bool RenderDelegate(EventArgs e, Graphics g, Rectangle r, Object rowObject);
///
/// These delegates are used to fetch a row object for virtual lists
///
public delegate Object RowGetterDelegate(int rowIndex);
///
/// These delegates are used to format a listviewitem before it is added to the control.
///
public delegate void RowFormatterDelegate(OLVListItem olvItem);
///
/// These delegates are used to sort the listview in some custom fashion
///
public delegate void SortDelegate(OLVColumn column, SortOrder sortOrder);
#endregion
}