callbackapi.cpp File Reference

Public API functions for callback functions (customized drawing). More...


Functions

fn_DrawRow BCGetFuncDrawRow (t_BarCode* pBarCode)
 Gets call-back function for drawing a single row of a barcode. Returns currently adjusted function pointer.
See also:
BCSetFuncDrawRaw() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default
fn_DrawRow   Otherwise ----------------------------------------------------------------------------.


ERRCODE BCSetFuncDrawRow (t_BarCode* pBarCode, fn_DrawRow fn)
 Sets the callback function for drawing a single row of a barcode. these functions informs TBarCode that drawing of a single barcode row (one row for linear barcodes, multiple rows for 2D or stacked codes) is done by the specified function. The specified function will be called from BCDraw() instead of the built-in row-drawing functionality. Default: no callback function is used.
Use this function to implement your custom drawing routines for specialized output requirements.
See also:
BCGetFuncDrawRow() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


fn_DrawBar BCGetFuncDrawBar (t_BarCode* pBarCode)
 Gets call-back function for drawing a bar. Returns currently adjusted function pointer.
See also:
BCSetFuncDrawBar() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawBar   Otherwise ----------------------------------------------------------------------------.


ERRCODE BCSetFuncDrawBar (t_BarCode* pBarCode, fn_DrawBar fn)
 Sets call-back function for drawing the bars of a barcode. these functions informs TBarCode that drawing of the bars (for linear barcodes) is done by the specified function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.
See also:
BCGetFuncDrawText() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


fn_DrawColoredBar BCGetFuncDrawColoredBar (t_BarCode* pBarCode)
 Gets call-back function for drawing a colored bar. Returns currently adjusted function pointer.
See also:
BCSetFuncDrawColoredBar() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawColoredBar   Otherwise ----------------------------------------------------------------------------.


ERRCODE BCSetFuncDrawColoredBar (t_BarCode* pBarCode, fn_DrawColoredBar fn)
 Sets call-back function for drawing colored bars. these functions informs TBarCode that drawing of colored bars (e.g. the Swiss cross in Swiss QR Code) is done by the specified function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.
See also:
BCGetFuncDrawColoredBar() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


fn_DrawTextA BCGetFuncDrawTextA (t_BarCode* pBarCode)
 Gets call-back function for drawing a text Returns currently adjusted function pointer.
See also:
BCSetFuncDrawText() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default
fn_DrawText   Otherwise ----------------------------------------------------------------------------.


fn_DrawTextW BCGetFuncDrawTextW (t_BarCode* pBarCode)
 Gets call-back function for drawing a text Returns currently adjusted function pointer.
See also:
BCSetFuncDrawText() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default
fn_DrawText   Otherwise ----------------------------------------------------------------------------.


ERRCODE BCSetFuncDrawTextA (t_BarCode* pBarCode, fn_DrawTextA fn)
ERRCODE BCSetFuncDrawTextW (t_BarCode* pBarCode, fn_DrawTextW fn)
fn_DrawRing BCGetFuncDrawRing (t_BarCode* pBarCode)
 Gets call-back function for drawing a MaxiCode finder ring. Returns currently adjusted function pointer.
See also:
BCSetFuncDrawRing() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawRing   Otherwise ----------------------------------------------------------------------------.


ERRCODE BCSetFuncDrawRing (t_BarCode* pBarCode, fn_DrawRing fn)
 Sets call-back function for drawing the MaxiCode finder rings. This function informs the TBarCode drawing functions that drawing of the MaxiCode finders is done by a callback function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.
See also:
BCGetFuncDrawRing() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


fn_DrawHexagon BCGetFuncDrawHexagon (t_BarCode* pBarCode)
 Gets call-back function for drawing a MaxiCode hexagon. Returns currently adjusted function pointer.
See also:
BCSetFuncDrawHexagon() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawHexagon   Otherwise ----------------------------------------------------------------------------.


ERRCODE BCSetFuncDrawHexagon (t_BarCode* pBarCode, fn_DrawHexagon fn)
 Sets call-back function for drawing the MaxiCode finder rings. This function informs the TBarCode drawing functions that drawing of the MaxiCode hexagons is done by a callback function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.
See also:
BCGetFuncDrawHexagon() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.


LPVOID BCGetCBData (t_BarCode* pBarCode)
 Gets the user-defined data that is passed to the callback functions. More...

VOID BCSetCBData (t_BarCode* pBarCode, LPVOID customData)
 Sets the user-defined data that is passed to the callback functions. More...

ERRCODE BCDrawCB (t_BarCode* pBarCode, HDC hDC, RECT* pRect)
 Callback version of barcode draw function. Call this function instead of BCDraw() if you want to use your own drawing routines (e.g. for generating a barcode on special devices or in special output formats). - fn_DrawRow is used for drawing the bars, see BCSetFuncDrawRow() - fn_DrawBar is used for drawing the bars, see BCSetFuncDrawBar() - fn_DrawText is used for drawing the human readable text, see BCSetFuncDrawText()
Note:
BCDrawCB() can be used only with a developer license. Sample code is available on request: support@tec-it.com
Call-backs are disabled in the demo-version of TBarCode. If you need to try it please contact TEC-IT for a temporary license key. \param[in] pBarCode Pointer to barcode structure. \param[in] hDC Device context handle (optional, Windows only). \param[in] pRect Bounding rectangle (bar code size). If hDC is NULL, the unit is [0.001 mm]. The coordinates are transformed to an origin of (0,0).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred.
See also:
BCGetFuncDrawRow(), BCSetFuncDrawRow(), BCGetFuncDrawBar(), BCSetFuncDrawBar(), BCGetFuncDrawText(), BCSetFuncDrawText(), BCGetCBData(), BCSetCBData() ----------------------------------------------------------------------------.


LPCSTR BCGetMetaDataA (t_BarCode* pBarCode)
 Returns meta-representation of a barcode. This function provides access to the meta-data of the current barcode row (refer to BCSetFuncDrawRow()). The result of this function is only valid, when it is called in the scope of your callback function (set by BCSetFuncDrawRow()).
Note:
Sample code is available on request: support@tec-it.com \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   Meta-description of barcode row. ----------------------------------------------------------------------------.


LPCWSTR BCGetMetaDataW (t_BarCode* pBarCode)
 Returns meta-representation of a barcode. This function provides access to the meta-data of the current barcode row (refer to BCSetFuncDrawRow()). The result of this function is only valid, when it is called in the scope of your callback function (set by BCSetFuncDrawRow()).
Note:
Sample code is available on request: support@tec-it.com \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   Meta-description of barcode row. ----------------------------------------------------------------------------.


COLORREF BCGetColorFromMetaData (t_BarCode* pBarCode, INT chMeta)
 Converts a single meta character returned by BCGetMetaData into a corresponding color value. If the given meta character is a placeholder for a color value, the corresponding RGB color value is returned. For all other meta characters the function returns the invalid color value BC_USEDEFAULT (0xFFFFFFFF) \param[in] pBarCode Pointer to barcode structure. \param[in] chMeta Meta character.
Return values:
COLORREF   a valid color value if meta character stands for a color value or otherwise BC_USEDEFAULT (0xFFFFFFFF) ----------------------------------------------------------------------------.



Detailed Description

Public API functions for callback functions (customized drawing).

Required include file: "tbarcode.h"

Author(s):
TEC-IT Datenverarbeitung GmbH
Hans-Wagnerstr. 6, 4400 Steyr, AUSTRIA/EUROPE
https://www.tec-it.com
Copyright© by TEC-IT Datenverarbeitung GmbH


Function Documentation

ERRCODE BCDrawCB ( t_BarCode * pBarCode,
HDC hDC,
RECT * pRect )

Callback version of barcode draw function. Call this function instead of BCDraw() if you want to use your own drawing routines (e.g. for generating a barcode on special devices or in special output formats). - fn_DrawRow is used for drawing the bars, see BCSetFuncDrawRow() - fn_DrawBar is used for drawing the bars, see BCSetFuncDrawBar() - fn_DrawText is used for drawing the human readable text, see BCSetFuncDrawText()

Note:
BCDrawCB() can be used only with a developer license. Sample code is available on request: support@tec-it.com
Call-backs are disabled in the demo-version of TBarCode. If you need to try it please contact TEC-IT for a temporary license key. \param[in] pBarCode Pointer to barcode structure. \param[in] hDC Device context handle (optional, Windows only). \param[in] pRect Bounding rectangle (bar code size). If hDC is NULL, the unit is [0.001 mm]. The coordinates are transformed to an origin of (0,0).
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred.
See also:
BCGetFuncDrawRow(), BCSetFuncDrawRow(), BCGetFuncDrawBar(), BCSetFuncDrawBar(), BCGetFuncDrawText(), BCSetFuncDrawText(), BCGetCBData(), BCSetCBData() ----------------------------------------------------------------------------.

LPVOID BCGetCBData ( t_BarCode * pBarCode )

Gets the user-defined data that is passed to the callback functions.

\param[in] pBarCode Pointer to barcode structure.

See also:
BCDrawCB(), fn_DrawRow, fn_DrawBar, fn_DrawText

COLORREF BCGetColorFromMetaData ( t_BarCode * pBarCode,
INT chMeta )

Converts a single meta character returned by BCGetMetaData into a corresponding color value. If the given meta character is a placeholder for a color value, the corresponding RGB color value is returned. For all other meta characters the function returns the invalid color value BC_USEDEFAULT (0xFFFFFFFF) \param[in] pBarCode Pointer to barcode structure. \param[in] chMeta Meta character.

Return values:
COLORREF   a valid color value if meta character stands for a color value or otherwise BC_USEDEFAULT (0xFFFFFFFF) ----------------------------------------------------------------------------.

fn_DrawBar BCGetFuncDrawBar ( t_BarCode * pBarCode )

Gets call-back function for drawing a bar. Returns currently adjusted function pointer.

See also:
BCSetFuncDrawBar() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawBar   Otherwise ----------------------------------------------------------------------------.

fn_DrawColoredBar BCGetFuncDrawColoredBar ( t_BarCode * pBarCode )

Gets call-back function for drawing a colored bar. Returns currently adjusted function pointer.

See also:
BCSetFuncDrawColoredBar() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawColoredBar   Otherwise ----------------------------------------------------------------------------.

fn_DrawHexagon BCGetFuncDrawHexagon ( t_BarCode * pBarCode )

Gets call-back function for drawing a MaxiCode hexagon. Returns currently adjusted function pointer.

See also:
BCSetFuncDrawHexagon() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawHexagon   Otherwise ----------------------------------------------------------------------------.

fn_DrawRing BCGetFuncDrawRing ( t_BarCode * pBarCode )

Gets call-back function for drawing a MaxiCode finder ring. Returns currently adjusted function pointer.

See also:
BCSetFuncDrawRing() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default.
fn_DrawRing   Otherwise ----------------------------------------------------------------------------.

fn_DrawRow BCGetFuncDrawRow ( t_BarCode * pBarCode )

Gets call-back function for drawing a single row of a barcode. Returns currently adjusted function pointer.

See also:
BCSetFuncDrawRaw() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default
fn_DrawRow   Otherwise ----------------------------------------------------------------------------.

fn_DrawTextA BCGetFuncDrawTextA ( t_BarCode * pBarCode )

Gets call-back function for drawing a text Returns currently adjusted function pointer.

See also:
BCSetFuncDrawText() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default
fn_DrawText   Otherwise ----------------------------------------------------------------------------.

fn_DrawTextW BCGetFuncDrawTextW ( t_BarCode * pBarCode )

Gets call-back function for drawing a text Returns currently adjusted function pointer.

See also:
BCSetFuncDrawText() \param[in] pBarCode Pointer to barcode structure.
Return values:
NULL   No call-back function defined. This is the default
fn_DrawText   Otherwise ----------------------------------------------------------------------------.

LPCSTR BCGetMetaDataA ( t_BarCode * pBarCode )

Returns meta-representation of a barcode. This function provides access to the meta-data of the current barcode row (refer to BCSetFuncDrawRow()). The result of this function is only valid, when it is called in the scope of your callback function (set by BCSetFuncDrawRow()).

Note:
Sample code is available on request: support@tec-it.com \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   Meta-description of barcode row. ----------------------------------------------------------------------------.

LPCWSTR BCGetMetaDataW ( t_BarCode * pBarCode )

Returns meta-representation of a barcode. This function provides access to the meta-data of the current barcode row (refer to BCSetFuncDrawRow()). The result of this function is only valid, when it is called in the scope of your callback function (set by BCSetFuncDrawRow()).

Note:
Sample code is available on request: support@tec-it.com \param[in] pBarCode Pointer to barcode structure.
Return values:
LPCSTR   Meta-description of barcode row. ----------------------------------------------------------------------------.

VOID BCSetCBData ( t_BarCode * pBarCode,
LPVOID customData )

Sets the user-defined data that is passed to the callback functions.

Each callback function for barcode drawing provides a parameter called 'customData'. This parameter can be used to pass user-defined data to the callback functions. \param[in] pBarCode Pointer to barcode structure. \param[in] customData User-defined data for callback functions.

See also:
BCDrawCB(), fn_DrawRow, fn_DrawBar, fn_DrawText

ERRCODE BCSetFuncDrawBar ( t_BarCode * pBarCode,
fn_DrawBar fn )

Sets call-back function for drawing the bars of a barcode. these functions informs TBarCode that drawing of the bars (for linear barcodes) is done by the specified function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.

See also:
BCGetFuncDrawText() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetFuncDrawColoredBar ( t_BarCode * pBarCode,
fn_DrawColoredBar fn )

Sets call-back function for drawing colored bars. these functions informs TBarCode that drawing of colored bars (e.g. the Swiss cross in Swiss QR Code) is done by the specified function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.

See also:
BCGetFuncDrawColoredBar() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetFuncDrawHexagon ( t_BarCode * pBarCode,
fn_DrawHexagon fn )

Sets call-back function for drawing the MaxiCode finder rings. This function informs the TBarCode drawing functions that drawing of the MaxiCode hexagons is done by a callback function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.

See also:
BCGetFuncDrawHexagon() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetFuncDrawRing ( t_BarCode * pBarCode,
fn_DrawRing fn )

Sets call-back function for drawing the MaxiCode finder rings. This function informs the TBarCode drawing functions that drawing of the MaxiCode finders is done by a callback function.
Use this function to implement your custom drawing routines for specialized output requirements. Default: no callback function is used.

See also:
BCGetFuncDrawRing() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetFuncDrawRow ( t_BarCode * pBarCode,
fn_DrawRow fn )

Sets the callback function for drawing a single row of a barcode. these functions informs TBarCode that drawing of a single barcode row (one row for linear barcodes, multiple rows for 2D or stacked codes) is done by the specified function. The specified function will be called from BCDraw() instead of the built-in row-drawing functionality. Default: no callback function is used.
Use this function to implement your custom drawing routines for specialized output requirements.

See also:
BCGetFuncDrawRow() \param[in] pBarCode Pointer to barcode structure. \param[in] fn Callback function.
Return values:
ERRCODE   ErrOk (0) in case of success. Non-zero if error occurred. ----------------------------------------------------------------------------.

ERRCODE BCSetFuncDrawTextA ( t_BarCode * pBarCode,
fn_DrawTextA fn )

ERRCODE BCSetFuncDrawTextW ( t_BarCode * pBarCode,
fn_DrawTextW fn )


© 2019 All rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Sat Jul 13 03:16:06 2019 for TBarCode Library 11 with doxygen 1.1.5