ICS

QicsTable Documentation Set

QicsCellDisplay Class Reference

Abstract class defining the interface for all cell display objects. More...

#include <QicsCellDisplay.h>

Inherits Qics.

Inherited by QicsMovableEntryWidgetCellDisplay, QicsNoWidgetCellDisplay, and QicsWidgetCellDisplay.

List of all members.

Public Types

 QicsStableSort = 0
 QicsQuickSort
 Clip = 0
 Overflow
 ToolTip
 Spreadsheet = 0
 NormalSelected
 Normal = 0
 Exclusive
 AllowPartial = 0
 NoDisplayOnPartial
 UseClippedSymbol
 TableGrid = 0
 RowHeaderGrid
 ColumnHeaderGrid
 RowHeader = 0
 ColumnHeader
 NoIndex = 0
 RowIndex
 ColumnIndex
 RowAndColumnIndex
 None = 0
 Plain
 Raised
 Sunken
 RepaintOff = 0
 RepaintOn = 1
 RepaintCalcOnly = 2
 Auto = 0
 AlwaysOff
 AlwaysOn
 ScrollNone = 0
 ScrollUp
 ScrollDown
 ScrollLeft
 ScrollRight
 ScrollToRow
 ScrollToColumn
 SelectNone = 0
 SelectSingle
 SelectMultiple
 SelectSingleRow
 SelectMultipleRow
 SelectionNone = 0
 SelectionBegin
 SelectionDrag
 SelectionEnd
 SelectionExtend
 SelectionAdd
 Ascending = 0
 Descending
 DisplayNever = 0
 DisplayAlways
 DisplayFirstPage
 TraverseWithinCell = 0
 TraverseBetweenCells
enum  QicsSortMode { QicsStableSort = 0, QicsQuickSort }
enum  QicsCellOverflowBehavior { Clip = 0, Overflow, ToolTip }
enum  QicsCurrentCellStyle { Spreadsheet = 0, NormalSelected }
enum  QicsSelectionStyle { Normal = 0, Exclusive }
enum  QicsGridCellClipping { AllowPartial = 0, NoDisplayOnPartial, UseClippedSymbol }
enum  QicsGridType { TableGrid = 0, RowHeaderGrid, ColumnHeaderGrid }
enum  QicsHeaderType { RowHeader = 0, ColumnHeader }
enum  QicsIndexType { NoIndex = 0, RowIndex, ColumnIndex, RowAndColumnIndex }
enum  QicsLineStyle { None = 0, Plain, Raised, Sunken }
enum  QicsRepaintBehavior { RepaintOff = 0, RepaintOn = 1, RepaintCalcOnly = 2 }
enum  QicsScrollBarMode { Auto = 0, AlwaysOff, AlwaysOn }
enum  QicsScrollDirection {
  ScrollNone = 0, ScrollUp, ScrollDown, ScrollLeft,
  ScrollRight, ScrollToRow, ScrollToColumn
}
enum  QicsSelectionPolicy {
  SelectNone = 0, SelectSingle, SelectMultiple, SelectSingleRow,
  SelectMultipleRow
}
enum  QicsSelectionType {
  SelectionNone = 0, SelectionBegin, SelectionDrag, SelectionEnd,
  SelectionExtend, SelectionAdd
}
enum  QicsSortOrder { Ascending = 0, Descending }
enum  QicsTableDisplayOption { DisplayNever = 0, DisplayAlways, DisplayFirstPage }
enum  QicsTraversalKeyEditBehavior { TraverseWithinCell = 0, TraverseBetweenCells }

Public Member Functions

 QicsCellDisplay ()
virtual ~QicsCellDisplay ()
virtual void displayCell (QicsGrid *grid, int row, int col, const QicsDataItem *itm, QRect &rect, QPainter *painter)=0
virtual void startEdit (QicsScreenGrid *, int, int, const QicsDataItem *)
virtual void moveEdit (QicsScreenGrid *grid, int row, int col, const QRect &rect)=0
virtual void hideEdit (QicsScreenGrid *grid)=0
virtual Qt::FocusReason lastFocusReason ()
virtual void endEdit (QicsScreenGrid *, int, int)
bool isEditing ()
virtual bool handleMouseEvent (QicsScreenGrid *grid, int row, int col, QMouseEvent *me)
virtual bool handleKeyEvent (QicsScreenGrid *grid, int row, int col, QKeyEvent *ke)
virtual QSize sizeHint (QicsGrid *grid, int row, int col, const QicsDataItem *itm)=0
virtual bool editWhenCurrent (void) const =0
virtual bool needsVisibilityNotification (void) const
virtual bool isEmpty (QicsGridInfo *info, int row, int col, const QicsDataItem *itm) const =0
virtual QString tooltipText (QicsGridInfo *info, int row, int col, const QicsDataItem *itm, const QRect &rect) const
virtual QWidget * widget ()
virtual QString cellDisplayName () const
virtual QDomElement toDomXml (QString tag, QDomDocument *doc)
virtual void configureFromDomXml (const QDomElement &e)
virtual void drawCellBorders (QicsGridInfo *info, int row, int col, const QRect &rect, QPainter *painter)

Static Public Attributes

static const QString BasicCellDisplayName

Protected Member Functions

virtual void drawBackground (QicsGridInfo *info, int row, int col, const QRect &rect, const QPalette &pal, QPainter *painter, bool is_current=false, bool is_selected=false)
virtual void drawBorder (QicsGridInfo *info, int row, int col, const QRect &rect, const QPalette &pal, QPainter *painter, bool is_current=false, bool is_selected=false)
virtual bool isCellSelected (QicsGridInfo *info, int row, int col)
virtual QPalette cellPalette (QicsGridInfo *info, int row, int col, bool for_printer=false)
virtual QRect displayableCellArea (QicsGridInfo *ginfo, int row, int col, const QRect &cr_full, bool consider_margin=true, bool consider_border=true) const

Protected Attributes

QPointer< QicsCellmyCell
QPointer< QicsRowmyRow
QPointer< QicsColumnmyColumn
QPointer< QicsMainGridmyGrid
QPointer< QStyle > myStyle
bool myIsEditing
Qt::FocusReason myLastFocusReason


Detailed Description

Abstract class defining the interface for all cell display objects.

QicsCellDisplay is an abstract base class defining the interface that all cell display objects must implement.

Please note that all row and column index parameters are given in visual coordinates. If model coordinates are needed, use QicsGridInfo::modelRowIndex() and QicsGridInfo::modelColumnIndex().

See Customizing Table Display Using Cell Display Objects for more information on creating a cell display class.


Member Enumeration Documentation

enum Qics::QicsCellOverflowBehavior [inherited]

Denotes the behavior of grids when handling cells whose contents cannot be displayed in the boundaries of the cell.

enum Qics::QicsCurrentCellStyle [inherited]

Denotes the visual style that the current cell of the table will be drawn with.

enum Qics::QicsGridCellClipping [inherited]

Denotes the policy for displaying text that is too long to fit in its cell

enum Qics::QicsGridType [inherited]

Specifies a type of grid object.

enum Qics::QicsHeaderType [inherited]

Specifies the type of table header.

enum Qics::QicsIndexType [inherited]

Specifies the type of table index.

enum Qics::QicsLineStyle [inherited]

Denotes the style of lines and borders in the table widget.

enum Qics::QicsRepaintBehavior [inherited]

Specifies the recalculation and repainting behavior of tables and grids.

enum Qics::QicsScrollBarMode [inherited]

Specifies the various modes of QicsTable's scroll bars.

enum Qics::QicsScrollDirection [inherited]

Denotes a direction for scrolling operations, or that an absolute scroll should occur.

enum Qics::QicsSelectionPolicy [inherited]

Denotes the selection policy for the table.

enum Qics::QicsSelectionStyle [inherited]

enum Qics::QicsSortMode [inherited]

Denotes the sort algorithm which is used

enum Qics::QicsSortOrder [inherited]

Specifies whenever ordering should be ascending or descending.

enum Qics::QicsTableDisplayOption [inherited]

Specifies a printing display policy for elements of the table

enum Qics::QicsTraversalKeyEditBehavior [inherited]

Specifies the behavior of the traversal keys (left, right, up, down, etc) while editing a cell.


Constructor & Destructor Documentation

QicsCellDisplay::QicsCellDisplay (  ) 

Constructor for the class. No arguments are passed.

virtual QicsCellDisplay::~QicsCellDisplay (  )  [virtual]

Destructor for the class.


Member Function Documentation

virtual QString QicsCellDisplay::cellDisplayName (  )  const [virtual]

Returns displayer string name.

Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, and QicsTextCellDisplay.

virtual QPalette QicsCellDisplay::cellPalette ( QicsGridInfo info,
int  row,
int  col,
bool  for_printer = false 
) [protected, virtual]

Returns the palette to be used when drawing in cell (row, col ), using grid information from info. If for_printer is true, the palette will have a white background color substituted for any background colors that are the same as the default background color of the grid.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
for_printer will this palette be used to print?

Reimplemented in QicsComboCellDisplay, and QicsDateTimeCellDisplay.

virtual void QicsCellDisplay::configureFromDomXml ( const QDomElement &  e  )  [virtual]

Helper function. Restore displayer state from QDomElement.

Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, and QicsTextCellDisplay.

virtual QRect QicsCellDisplay::displayableCellArea ( QicsGridInfo ginfo,
int  row,
int  col,
const QRect &  cr_full,
bool  consider_margin = true,
bool  consider_border = true 
) const [protected, virtual]

Returns a rectangle specifying the area of cell (row, col ) that can be used to display information. This rectangle is based on the full area of the cell (contained in cr_full ), minus the area reserved for the cell's border and margin.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
cr_full the full area of the cell
consider_margin should the returned area exclude the margin of the cell?
consider_border should the returned area exclude the border of the cell?

virtual void QicsCellDisplay::displayCell ( QicsGrid grid,
int  row,
int  col,
const QicsDataItem itm,
QRect &  rect,
QPainter *  painter 
) [pure virtual]

Displays the cell (row, col ) in grid widget grid. The cell will be displayed in region rect, using painter.

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates
itm the value to display. This value may be 0.
rect the rectangle to paint into
painter a painting context

Implemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual void QicsCellDisplay::drawBackground ( QicsGridInfo info,
int  row,
int  col,
const QRect &  rect,
const QPalette &  pal,
QPainter *  painter,
bool  is_current = false,
bool  is_selected = false 
) [protected, virtual]

Draws the background of cell (row, col ) using painter (based on cell and grid properties contained info) at the location specified by rect.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
rect location to draw in
pal color group to draw with
painter painter to draw with
is_current is this cell the current cell?
is_selected is this cell selected?

virtual void QicsCellDisplay::drawBorder ( QicsGridInfo info,
int  row,
int  col,
const QRect &  rect,
const QPalette &  pal,
QPainter *  painter,
bool  is_current = false,
bool  is_selected = false 
) [protected, virtual]

Draws the border of cell (row, col ) (based on cell and grid properties contained in info at the location specified by rect.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
rect location to draw in
pal color group to draw with
painter painter to draw with
is_current is this cell the current cell?
is_selected is this cell selected?

virtual void QicsCellDisplay::drawCellBorders ( QicsGridInfo info,
int  row,
int  col,
const QRect &  rect,
QPainter *  painter 
) [virtual]

Draws the borders of cell (row, col ) (based on cell borders properties contained in info at the location specified by rect.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
rect location to draw in
painter painter to draw with

virtual bool QicsCellDisplay::editWhenCurrent ( void   )  const [pure virtual]

Returns true if cells using this displayer should automatically be put into edit mode when they become the current cell in the table.

Implemented in QicsNoWidgetCellDisplay, QicsMovableEntryWidgetCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual void QicsCellDisplay::endEdit ( QicsScreenGrid ,
int  ,
int   
) [inline, virtual]

This method is called by the grid widget when an edit operation of a cell should be ended. This would most commonly occur when the user traverses out of the cell via keyboard or mouse action.

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates

Reimplemented in QicsNoWidgetCellDisplay, QicsMovableEntryWidgetCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual bool QicsCellDisplay::handleKeyEvent ( QicsScreenGrid grid,
int  row,
int  col,
QKeyEvent *  ke 
) [virtual]

Handler for keyboard events that occur within cell (row, col ). The handler must return true if the event was handled by the cell displayer (and thus should not be handled by the grid), or false otherwise.

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates
ke the keyboard event

Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, and QicsTextCellDisplay.

virtual bool QicsCellDisplay::handleMouseEvent ( QicsScreenGrid grid,
int  row,
int  col,
QMouseEvent *  me 
) [virtual]

Handler for mouse events that occur within cell (row, col ). The handler must return true if the event was handled by the cell displayer (and thus should not be handled by the grid), or false otherwise.

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates
me the mouse event

Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, and QicsPushButtonCellDisplay.

virtual void QicsCellDisplay::hideEdit ( QicsScreenGrid grid  )  [pure virtual]

This method is called by the grid widget when the cell currently being edited is no longer visible on the screen. (This would most commonly occur when the user scrolls the table.)

Parameters:
grid the controlling grid

Implemented in QicsNoWidgetCellDisplay, QicsMovableEntryWidgetCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual bool QicsCellDisplay::isCellSelected ( QicsGridInfo info,
int  row,
int  col 
) [protected, virtual]

Returns true if cell (row, col ) is selected in grids described by info. If the grid(s) are main table grids, this method simply determines if the cell is contained in the current selection list. If the grid(s) are header grids, this method determines if all the cells in the header cell's row or column are selected.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates

bool QicsCellDisplay::isEditing (  )  [inline]

Returns true if cell displayer is editing now, otherwise returns false.

virtual bool QicsCellDisplay::isEmpty ( QicsGridInfo info,
int  row,
int  col,
const QicsDataItem itm 
) const [pure virtual]

Returns true if the contents of cell (row, col ) (given data item itm ) are empty, false otherwise.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
itm item that will be displayed in the cell

Implemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual void QicsCellDisplay::moveEdit ( QicsScreenGrid grid,
int  row,
int  col,
const QRect &  rect 
) [pure virtual]

This method is called by the grid widget when the cell currently being edited has changed location in the grid. This would most commonly occur when the table is scrolled while an edit operation is underway.

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates
rect the new location of the cell

Implemented in QicsNoWidgetCellDisplay, QicsMovableEntryWidgetCellDisplay, QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual bool QicsCellDisplay::needsVisibilityNotification ( void   )  const [inline, virtual]

Returns true if this displayer should be notified when its cells are no longer visible in the grid, false otherwise.

Reimplemented in QicsWidgetCellDisplay.

virtual QSize QicsCellDisplay::sizeHint ( QicsGrid grid,
int  row,
int  col,
const QicsDataItem itm 
) [pure virtual]

Returns the size that cell (row, col ) needs to be if it is to completely display itm.

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates
itm the value to display. This value may be 0.

Implemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual void QicsCellDisplay::startEdit ( QicsScreenGrid ,
int  ,
int  ,
const QicsDataItem  
) [inline, virtual]

Begin an edit operation in cell (row, col ). This method is intended to be used as a "preparation" for an edit operation. It will be called by the grid in response to a user action or a programmatic call. Note that this method does not specify a location in the grid widget for the edit operation to take place. The location will be specified in a subsequent call to moveEdit().

Parameters:
grid the controlling grid
row the row in visual coordinates
col the column in visual coordinates
itm the value to edit. This value may be 0.

Reimplemented in QicsNoWidgetCellDisplay, QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.

virtual QDomElement QicsCellDisplay::toDomXml ( QString  tag,
QDomDocument *  doc 
) [virtual]

Helper function. Save displayer state to QDomDocument.

Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, and QicsTextCellDisplay.

virtual QString QicsCellDisplay::tooltipText ( QicsGridInfo info,
int  row,
int  col,
const QicsDataItem itm,
const QRect &  rect 
) const [virtual]

Returns the text that a grid widget can display in a tooltip when the user hovers the mouse pointer over this cell.

Parameters:
info grid info object
row the row in visual coordinates
col the column in visual coordinates
itm item that will be displayed in the cell
rect size of the cell

Reimplemented in QicsTextCellDisplay.

virtual QWidget* QicsCellDisplay::widget (  )  [inline, virtual]

Returns widget that cell displayer uses or '0' otherwise.

Reimplemented in QicsCheckCellDisplay, QicsComboCellDisplay, QicsDateTimeCellDisplay, QicsPushButtonCellDisplay, QicsTextCellDisplay, and QicsWidgetCellDisplay.


The documentation for this class was generated from the following file:

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.