MFC Grid manual

CPaintFormatFactory Class Reference

Enables creation of an instance of a specified format by its string name. More...

#include <Dapfor/GUI/PaintFormatFactory.h>

List of all members.


Public Types

typedef ICellPaintFormat *(* pfnCellFormatCreate )()
 Pointer to the function that creates an instance of the format that derives from ICellPaintFormat.
typedef ILinePaintFormat *(* pfnLineFormatCreate )()
 Pointer to the function that creates an instance of the format that derives from ILinePaintFormat.
typedef IColumnPaintFormat *(* pfnColumnFormatCreate )()
 Pointer to the function that creates an instance of the format that derives from IColumnPaintFormat.
typedef IHeaderPaintFormat *(* pfnHeaderFormatCreate )()
 Pointer to the function that creates an instance of the format that derives from IHeaderPaintFormat.

Static Public Member Functions

static bool RegisterCellFormat (const CString &className, pfnCellFormatCreate f)
 Registers a new format that implements ICellPaintFormat interface.
static bool RegisterLineFormat (const CString &className, pfnLineFormatCreate f)
 Registers a new format that implements ILinePaintFormat interface.
static bool RegisterColumnFormat (const CString &className, pfnColumnFormatCreate f)
 Registers a new format that implements IColumnPaintFormat interface.
static bool RegisterHeaderFormat (const CString &className, pfnHeaderFormatCreate f)
 Registers a new format that implements IHeaderPaintFormat interface.
static ICellPaintFormatCreateCellPaintFormat (const CString &className)
 Creates an instance of a format that implements ICellPaintFormat interface.
static ILinePaintFormatCreateLinePaintFormat (const CString &className)
 Creates an instance of a format that implements ILinePaintFormat interface.
static IColumnPaintFormatCreateColumnPaintFormat (const CString &className)
 Creates an instance of a format that implements IColumnPaintFormat interface.
static IHeaderPaintFormatCreateHeaderPaintFormat (const CString &className)
 Creates an instance of a format that implements IHeaderPaintFormat interface.

Detailed Description

Enables creation of an instance of a specified format by its string name.

Version:
1.0.0.0 Initial version

Member Function Documentation

bool RegisterCellFormat ( const CString &  className,
pfnCellFormatCreate  f 
) [inline, static]

Registers a new format that implements ICellPaintFormat interface.

Parameters:
[in] className Name of a format class.
[in] f Pointer to the function that creates an instance of a specified format.
Returns:
True if the format has been successfully registered. Otherwise false.
Example:
It is recommended to use a namespace as a part of this name.
    DF_IMPLEMENT_CELL_PAINT_FORMAT(MyNamespace::CMyFormat);

bool RegisterLineFormat ( const CString &  className,
pfnLineFormatCreate  f 
) [inline, static]

Registers a new format that implements ILinePaintFormat interface.

Parameters:
[in] className Name of a format class.
[in] f Pointer to the function that creates an instance of a specified format.
Returns:
True if the format has been successfully registered. Otherwise false.
Example:
It is recommended to use a namespace as a part of this name.
    DF_IMPLEMENT_LINE_PAINT_FORMAT(MyNamespace::CMyFormat);

bool RegisterColumnFormat ( const CString &  className,
pfnColumnFormatCreate  f 
) [inline, static]

Registers a new format that implements IColumnPaintFormat interface.

Parameters:
[in] className Name of a format class.
[in] f Pointer to the function that creates an instance of a specified format.
Returns:
True if the format has been successfully registered. Otherwise false.
Example:
It is recommended to use a namespace as a part of this name.
    DF_IMPLEMENT_COLUMN_PAINT_FORMAT(MyNamespace::CMyFormat);

bool RegisterHeaderFormat ( const CString &  className,
pfnHeaderFormatCreate  f 
) [inline, static]

Registers a new format that implements IHeaderPaintFormat interface.

Parameters:
[in] className Name of a format class.
[in] f Pointer to the function that creates an instance of a specified format.
Returns:
True if the format has been successfully registered. Otherwise false.
Example:
It is recommended to use a namespace as a part of this name.
    DF_IMPLEMENT_HEADER_PAINT_FORMAT(MyNamespace::CMyFormat);

ICellPaintFormat * CreateCellPaintFormat ( const CString &  className  )  [static]

Creates an instance of a format that implements ICellPaintFormat interface.

Parameters:
[in] className Format class name
Returns:
Instance of a specified format if the class of this format has already been declared.

ILinePaintFormat * CreateLinePaintFormat ( const CString &  className  )  [static]

Creates an instance of a format that implements ILinePaintFormat interface.

Parameters:
[in] className Format class name
Returns:
Instance of a specified format if the class of this format has already been declared.

IColumnPaintFormat * CreateColumnPaintFormat ( const CString &  className  )  [static]

Creates an instance of a format that implements IColumnPaintFormat interface.

Parameters:
[in] className Format class name
Returns:
Instance of a specified format if the class of this format has already been declared.

IHeaderPaintFormat * CreateHeaderPaintFormat ( const CString &  className  )  [static]

Creates an instance of a format that implements IHeaderPaintFormat interface.

Parameters:
[in] className Format class name
Returns:
Instance of a specified format if the class of this format has already been declared.