/*************************************************************************

	formZ by autodessys, Inc.
	Copyright c 1994 autodessys, Inc.  All rights reserved.
	
	
	File :	fz_tool_api.h
	
	By :	
	
	Created on :  		17 June 2002
	Last Updated on :  	17 June 2002
	
	Description :	
					
***************************************************************************/

#ifndef _FORMZ_TOOL_API_H
#define _FORMZ_TOOL_API_H 1

#include "fzpl_plugin.h"
#include "fz_iost_api.h"	
#include "fz_model_core_api.h"	
#include "fz_fuim_api.h"
#include "fz_api.h"
#include "fz_proj_api.h"

#ifdef __cplusplus
extern "C" {
#endif

/* @doc EXTERNAL cmds_cbak_tool */


/********************************************************************************************************

	@module

	@desc	Tool plugins are implemented by the call back function set 
			fz_tool_cbak_fset. <nl>

			A tool is a special type of command that responds to graphic and/or numeric input in the active project window. There is 
			one active tool which receives all graphic and numeric input. Tools can be represented in the Modeling, Drafting or Window 
			icon toolbar. A key shortcut for a Tool makes the tool the active tool but does not start its operation.  <nl>
			
			Tools can have options which are shown in the Tool Options palette and in a dialog invoked from the tool icon. Tool options are 
			handled very similar to the tool itself in that the options have there own name and id so that they can have their own key shortcuts assigned to them.  <nl>
			
			For tools, the fz_tool_cbak_select function is called by formZ when its icon is selected or a key shortcut is invoked. The 
			fz_tool_cbak_track function is called as the mouse is moved and the fz_tool_cbak_click function is called when the mouse is clicked. 
			This cycle continues until the tool indicates that it is completed through the return value in the fz_tool_cbak_track or 
			fz_tool_cbak_click functions.

	@toc	cmds_cbak_tool

*********************************************************************************************************/
			
/********************************************************************************************************

	@enum	

	@desc	Defines the kind for a tool. There are two kinds of tools. <nl>
	
			Operator: creates or edits the formZ project data (objects, lights, etc.) through graphic manipulation
			if the formZ project window. <nl>
			
			Modifier: controls a setting that affects a group of operators (tools).  For example, the self/copy modifier
			tools affect how the transformation operator tools function.  Modifiers are never implemented as a single tool,
			but rather a set of tools that have a number of modifiers representing different options and a set of
			operators that are sensitive to the selected modifier.
						
	@avail	5.0.0.0
			
	@see	<auto>

	@toc	cmds_cbak_tool

*********************************************************************************************************/
typedef enum fz_tool_kind_enum
{	
	FZ_TOOL_KIND_OPERATOR=0,		/*	@emem The tool is an operator	*/
	FZ_TOOL_KIND_MODIFIER,			/*	@emem The tool is a modifier	*/
	
	FZ_TOOL_KIND_MAX
} fz_tool_kind_enum;

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool initialization (Required). This function is called once by formZ as soon as the tool 
				is registered. It establishes the level and kind of the tool.
				
				Returning and error other than FZRT_NOERR will cause the tool NOT to be registered

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_finit

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_init_func)(
	void
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool finalization (Optional). This function is called once by formZ when the tool is unregistered at termination.
				This function is useful for finalizing any data that was initialized in fz_tool_cbak_init.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_init

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_finit_func)(
	void 
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool info (Required). This function is called once by formZ as soon as the tool 
				is registered and initialized. It establishes the level and kind of the tool. The level distinguishes the 
				context of the tool (system, modeling, drafting, window etc.). The kind tells formZ if the tool
				is an operator or a modifier. <nl>
				
				Returning and error other than FZRT_NOERR will cause the tool NOT to be registered <nl>
				
				This function is superseeded by fz_tool_cbak_info2

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_info2

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_info_func)(
	fz_tool_kind_enum 		*kind,  			/* @parm	<out> | to be filled with the tool kind 	*/	
	fz_proj_level_enum 		*level 				/* @parm	<out> | to be filled with the tool level 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool name (Recommended). This function is called by formZ to get the name of the tool. It is recommended that 
				the tool name is stored in .fzr file so that it is localizable. If this function is not provided, 
				the name of the plugin, name of the plugin file, name of the script, or name of the script file 
				will be used.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_uuid,fz_tool_cbak_help

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_name_func)(	
	char 		*name, 					/* @parm	<out> | string to be filled with the tool name 	*/		
	fzrt_int		max_len				/* @parm	<in> | length of name parameter	*/
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool id (Recommended). This function is called by formZ to get the id (uuid) of the tool. 
				This unique id is used by formZ to maintain all persistent information about the tool. If this 
				function is not provided, formZ will assign a default id. Note that there are a limited number of 
				default ids and if the number of tools changes from session to session, the id will not be maintained. 
				In this situation, any persistent information (preferences for example) will be lost. 

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_name,fz_tool_cbak_help

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_uuid_func)(
	fzrt_UUID_td 	uuid 				/* @parm	<out> | uuid to be filled with the tool id 	*/	
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool help (Recommended). This function is called by formZ to get the help text of the tool. 
				It is recommended that the help text is stored in .fzr file so that it is localizable. 
				If this function is not provided, no help string is shown. Help text is used in the 
				Help dialogs and the Key shortcuts manager.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_name,fz_tool_cbak_uuid

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_help_func)(	
	char 		*help, 					/* @parm	<out> | string to be filled with the help text 	*/		
	fzrt_int		max_len				/* @parm	<in> | length of help text parameter	*/
	);


/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool active. This function is called by formZ at various times only for FZ_TOOL_KIND_MODIFIER tools to determine 
				if the tool is active. If this function is not provided, the tool is assumed to be inactive.

	@return		Error Codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_avail,fz_tool_cbak_select

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_active_func)(
	fzrt_int			windex,					/* @parm	<in> | 	project window index */
	fzrt_int 			*rv					/* @parm	<out> | TRUE for available, FALSE for not available (dimmed) 	*/		
	);
	
/********************************************************************************************************

	@enum	

	@desc	 <nl>
							
	@avail	7.0.0.0
			
	@see	<auto>

	@toc	cmds_cbak_tool

*********************************************************************************************************/
typedef enum fz_tool_avail_enum
{	
	FZ_TOOL_AVAIL,					/*	@emem The action is avaiable  */
	FZ_TOOL_AVAIL_STATIC,			/*	@emem The action is avaiable when a static render is enabled   */
	FZ_TOOL_AVAIL_STATIC_RESET,		/*	@emem The action is avaiable when a static render is enabled, but needs to rest to inrteractive befor execution. */
	FZ_TOOL_AVAIL_INTERACT_DISPLAY,	/*	@emem The action is avaiable when an renderer that is FZ_RNDR_BEHAVE_INTERACT_DISPLAY   */
	
	FZ_TOOL_AVAIL_MAX
} fz_tool_avail_enum;

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool available (Recommended). This function is called by formZ at various times to determine 
				if the tool is available. If your tool is dependent on certain conditions to be usable, then this function can be used 
				to prevent its use when conditions warrant. If this function is not provided, the tool is assumed to be available.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_active,fz_tool_cbak_select,fz_tool_avail_enum

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_avail_func)(
	fzrt_int			windex,					/* @parm	<in> | 	project window index */
	fzrt_int 			*rv					/* @parm	<out> | TRUE for available, FALSE for not available (dimmed) 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool select (Recommended). This function is called by formZ when the tool is selected by the user. 
				The user can select the tool by clicking on its icon or executing a key shortcut.
				For FZ_TOOL_KIND_OPERATOR tools, this is where action is performed.
				For FZ_TOOL_KIND_MODIFIER tools, this is where the state is changed.

				The fz_fuim_prompt_name function can be called to set the name of the tool in the prompts palette. 
				If this function is not called then the tools name is used as the in the prompts palette.
				The fz_fuim_prompt_line function should be called to set the first prompt instruction to the user.
				
	@return		TRUE for handled, FALSE for if not

	@avail		5.0.0.0

	@see		fz_tool_cbak_avail,fz_tool_cbak_active,fz_fuim_prompt_name,fz_fuim_prompt_line

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_select_func)(
	fzrt_int			windex					/* @parm	<in> | 	project window index */
	);



/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool icon from file (Optional). This function is called by formZ to load an icon for the tool from an image file. 
				The image file can be in any supported image file format (or of an image format which is an image file 
				translator plugin). It is recommended to use the TIFF image format as it is a cross platform supported format and 
				is always present. The source graphics are identified in the file by indicating the top left corner of the 
				graphic in the file. In addition to the graphic, a mask can be provided for use when the icon is highlighted. A 
				single file can be used for multiple icons across a variety of plugins by creating a grid of icons in the file 
				and specifying the location for each icon.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_icon_rsrc

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_icon_file_obsolete_func)(
	fz_fuim_icon_enum 			which, 				/* @parm	<in> | which style of icon to load. */		
	fzrt_floc_ptr 			floc,				/* @parm	<out> | file location of file which contains the icon. */
	fzrt_int 					*hpos, 				/* @parm	<in> | left horizontal location of icon data in file. */
	fzrt_int 					*vpos, 				/* @parm	<in> | top vertical location of icon data in file. */
	fzrt_floc_ptr 			floc_mask, 			/* @parm	<out_opt> | file location of file which contains the icon mask data. */
	fzrt_int 					*hpos_mask, 		/* @parm	<in> | left horizontal location of icon mask data in file. */
	fzrt_int 					*vpos_mask			/* @parm	<in> | top vertical location of icon mask data in file. */
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool icon from resource file (Optional). This function is called by formZ to load an 
				icon for the tool from a platform specific resource file. This method of loading an icon 
				is less flexible than fz_tool_cbak_icon_file and requires specific generation of the icon artwork 
				for each platform. This method is only provided as a convenience for developers who already have  
				a library of platform specific icons developed. <nl>
				
				The resource file can be the plugin file (.fzp) or an independent resource file. All icons 
				stored in 32 x 32 pixels resources, however, depending on the type of the icon, only part of 
				the resource will be used. Only the top left 30 x 30 of the 32 x 32 is used for the black and white 
				full icon size. The bottom and right two pixels are NOT used (and will be cropped). The entire 32 x 32 
				is used for the color full icon size. 
				For the alternate size icon, formZ uses the bottom left 20 x 16 pixels. The top 16 and right 12 pixels 
				are NOT used (and will be cropped). <nl>
								
				Macintosh: The back and white source graphic is stored in a 'ICON' resource. The color source is read 
				from a 32 x 32 'cicn' resource.  <nl>
				
				Windows: The back and white and color source graphics are stored in a 'Icon' resource.  <nl>

	@return		Error codes

	@avail		5.0.0.0

	@see		fzrt_rlib_get_resource,fz_tool_cbak_icon_file

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_icon_rsrc_func)(
	fz_fuim_icon_enum 			which, 				/* @parm	<in> | which style of icon to load. */		
	fzrt_icon_ptr 			*icon				/* @parm	<out> | icon handle. */
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Preference file I/O (Optional). This function is called by formZ to read and write the tools preference information 
				when a preference file or the defaults file is read or written. The preference files use an IFF type of file format. 
				A block is read or written for each tool which has a fz_tool_cbak_icon_rsrc registered. This is useful for storing 
				the any user settings used by a tool such as the options for a tool. <nl>
				
				Version control is handled through the version parameter. When writing a block you should set the version variable to
				the variant of data that you are writing. The default is zero. It is recommended that you increment this number each time
				when you change the format of the data that you write to the stream. When reading the block, the version parameter
				contains the version which was used to write the block. You can then take the appropriate action to read the variant 
				of data in the block. 

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_iost_ptr, fz_tool_cbak_pref_io

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_pref_io_func)(
	fz_iost_ptr 			iost, 				/* @parm	<in> | io stream point for current stream. */		
	fz_iost_dir_td_enum 			dir,				/* @parm	<in> | io direction for current stream. */		
	fzpl_vers_td * const version, 			/* @parm	<in_out> | 	if dir == FZ_IOST_READ then this is the version of the block being read. 
																		if dir == FZ_IOST_WRITE then this is the version of the block that was written (default == 0). */
	fzrt_unsigned_int 			size 				/* @parm	<in> | if dir == FZ_IOST_READ then this is the size of the block being read */
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Preference file I/O (Optional). This function is called by formZ to read and write the tools preference information 
				when a preference file or the defaults file is read or written. The preference files use an IFF type of file format. 
				A block is read or written for each tool which has a fz_tool_cbak_icon_rsrc registered. This is useful for storing 
				the any user settings used by a tool such as the options for a tool. <nl>
				
				Version control is handled through the version parameter. When writing a block you should set the version variable to
				the variant of data that you are writing. The default is zero. It is recommended that you increment this number each time
				when you change the format of the data that you write to the stream. When reading the block, the version parameter
				contains the version which was used to write the block. You can then take the appropriate action to read the variant 
				of data in the block. 

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_iost_ptr,fz_tool_cbak_pref_io

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_io_func)(
	fzrt_int					windex,				/* @parm	<in> | project window index */
	fz_iost_ptr 			iost, 				/* @parm	<in> | io stream point for current stream. */		
	fz_iost_dir_td_enum 			dir,				/* @parm	<in> | io direction for current stream. */		
	fzpl_vers_td * const version, 			/* @parm	<in_out> | 	if dir == FZ_IOST_READ then this is the version of the block being read. 
																		if dir == FZ_IOST_WRITE then this is the version of the block that was written (default == 0). */
	fzrt_unsigned_int 			size 				/* @parm	<in> | if dir == FZ_IOST_READ then this is the size of the block being read */
	);


/********************************************************************************************************

	@enum	

	@desc	 <nl>
							
	@avail	7.0.0.0
			
	@see	<auto>

	@toc	cmds_cbak_tool

*********************************************************************************************************/
typedef enum fz_tool_info_enum
{	
	FZ_TOOL_INFO_LEVEL=0,				/*	@emem The tool level	*/
	FZ_TOOL_INFO_KIND,					/*	@emem The tool kind	*/
	FZ_TOOL_INFO_DRAW_STATE,			/*	@emem 0 for no drawing else fz_tool_info_draw_bits_enum	*/
	FZ_TOOL_INFO_PICK_STATE,			/*	@emem 0 for no picking else fzrt_int value for number of sets that can be picked	*/
	FZ_TOOL_INFO_CEDT_CONTSTRAIN,		/*	@emem The tool can handle constrained controls	*/
	FZ_TOOL_INFO_CEDT_FREE,				/*	@emem The tool can handle free controls	*/
	FZ_TOOL_INFO_PICK_NO_CLEAR,			/*	@emem The tool should not celar the pick buffer after operation (TRUE/FALSE)	*/
	FZ_TOOL_INFO_CAN_UNDO,				/*	@emem The tool can process an undo command	*/
	FZ_TOOL_INFO_LINKED_ACTION,			/*	@emem The tool should not cancel when the action specified by info_data is executed 	*/
	FZ_TOOL_INFO_NO_SNAP,				/*	@emem The snapping should not be performed, if otherwise it would 	*/
	FZ_TOOL_INFO_YES_SNAP,				/*	@emem The snapping should be performed, if otherwise it would not 	*/
	FZ_TOOL_INFO_XTRA_CLICK,			/*	@emem The tool requires an extra click after picking (ie base point) 	*/
	FZ_TOOL_INFO_PICK_ONLY,				/*	@emem The tool only picks (ie no mi or max, works with pick reuls and results) 	*/
	FZ_TOOL_INFO_PICK_GHOST_ONLY,		/*	@emem The tool only picks ghosted objects 	*/
	FZ_TOOL_INFO_NO_ABORT,				/*	@emem The tool does not require cancel of current tool 	*/
	FZ_TOOL_INFO_LIVE_ON_SELECT,		/*	@emem The tool is live when selected (ie click not nessessary 	*/
	FZ_TOOL_INFO_NO_PRE_PICK,			/*	@emem The tool does not support pre picking. Thus, when the tool is activated the pick buffer is cleared. */
	FZ_TOOL_INFO_NO_OBJCNTL_FROM_RESBUF,/*	@emem The tool does not want object controls displayed for objects which are in the result buffer. */
	FZ_TOOL_INFO_ALLOW_REF_OBJECTS,		/*	@emem If the tool handles returns TRUE, it handles reference obejcts. If this action
												  is not implemented, or the tool answers FALSE, reference objects are not pickable
												  by this tool	*/
	FZ_TOOL_INFO_STATIC_TRACK	,		/*	@emem Tool is currently staticly tracking	*/
	FZ_TOOL_INFO_CEDT_NO_OPER_START,	/*	@emem Tool does not want oper_start to be called, when a cedt item is clicked and tracking of the cedt item is starting.
												  It is assumed that the cedt item code handles init of the operation (itself)	*/
	FZ_TOOL_INFO_PICK_DYNAMIC,			/*	@emem Tool uses dymanic picking where from clcik to clik the min/max may chnage when this is set, the min max is 
													re-checked after the click and if satisified, will execute the tool	*/
	FZ_TOOL_INFO_CLICK_NO_PICK,			/*	@emem For pick tools, call click function even when min not met and nothing picked. Special uses, use with caution	*/
	FZ_TOOL_INFO_ALLOW_REF_GROUPS,		/*	@emem For pick tools, allow picking of parts of groups and componete for reference only THE TOOL MAY NOT ACTUALLY CHNAGE THE OBJECT< JUST FOR REFERENCE	*/
	FZ_TOOL_INFO_LAYOUT,				/*	@emem Tool is compatible with layout (2D) mode (return 1 if layout, 2 if layout only, else defaults to FALSE no layout	*/
	FZ_TOOL_INFO_ALLOW_XREFS,			/*	@emem Allow picking of XREF objects for mofification	*/
	FZ_TOOL_INFO_FORCE_CANCEL,			/*	@emem Alwas call cancel function even if already returned as done (handle cleanup) 	*/
	FZ_TOOL_INFO_MAX
} fz_tool_info_enum;

/********************************************************************************************************

	@enum	

	@desc	 <nl>
							
	@avail	7.0.0.0
			
	@see	<auto>

	@toc	fz_tool_action_enum

*********************************************************************************************************/
typedef enum fz_tool_action_enum
{	
	FZ_TOOL_ACTION_DESCRIPTION=0,		/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_PICK,				/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_CLICK,				/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_CLICK_2X,			/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_CLICK_3X,			/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_CLICK_SHIFT,			/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_CLICK_CMD_CNTL,		/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_SHIFT,				/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_CMD_CNTL,			/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_MISC_MESSAGE,		/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_MISC_MESSAGE2,		/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_MISC_MESSAGE3,		/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_OPT_ALT,				/*	@emem string for pressing option key (mac) or alt key (windows)	*/
	FZ_TOOL_ACTION_HOLD_SHIFT,			/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_HOLD_CMD_CNTL,		/*	@emem string for clicking	*/
	FZ_TOOL_ACTION_HOLD_OPT_ALT,		/*	@emem string for pressing option key (mac) or alt key (windows)	*/
	FZ_TOOL_ACTION_SHORT_NAME,			/*	@emem string for the abbreviation that appears in the tool palette */

	FZ_TOOL_ACTION_MAX
} fz_tool_action_enum;

typedef enum	fz_tool_info_draw_bits_enum
{	
	FZ_TOOL_INFO_DRAW = 0				/*  @emem	tool draws (else dowes not draw)			*/
} fz_tool_info_draw_bits_enum;


typedef enum	fz_tool_info_pick_objt_bits_enum
{	
	FZ_OBJT_PICK_LEVEL_OBJT = 0,	/*  @emem	Picks Objects/lights/views as whole entity			*/
	FZ_OBJT_PICK_LEVEL_FACE,		/*  @emem	Picks Faces 			*/
	FZ_OBJT_PICK_LEVEL_CURV,		/*  @emem	Picks Curves	*/
	FZ_OBJT_PICK_LEVEL_SEGT,		/*  @emem	Picks Segments 			*/
	FZ_OBJT_PICK_LEVEL_CORD,		/*  @emem	Picks Point  			*/
	FZ_OBJT_PICK_LEVEL_HOLE,		/*  @emem	Picks Holes  			*/
	FZ_OBJT_PICK_LEVEL_GRUP,		/*  @emem	Picks Groups as single entities. If FZ_OBJT_PICK_LEVEL_OBJT is set, tool will also pick groups, but
												will look at the objects in the group as if they were picked together. The FZ_OBJT_PICK_LEVEL_GRUP bit
												shoukd be used for those tools that work on groups explicitely (such as the UnGroup tool). */
	
	
	FZ_ELEM_PICK_LEVEL_DOBJT,
	FZ_ELEM_PICK_LEVEL_DSEGT,
	FZ_ELEM_PICK_LEVEL_DPNT,
	FZ_ELEM_PICK_LEVEL_DFENCE,
	FZ_ELEM_PICK_LEVEL_DCPND
	
} fz_tool_info_pick_objt_bits_enum;

/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool info (Required if fz_tool_cbak_info not defined, else Recommended). The function is called at various times for formZ to get 
				information about the characteristics of the tool. This function is called once by formZ as soon as the tool 
				is registered and initialized with which == FZ_TOOL_INFO_LEVEL and which == FZ_TOOL_INFO_KIND. 
				Returning and error other than TRUE will cause the tool NOT to be registered
				It establishes the level and kind of the tool. The level distinguishes the 
				context of the tool (system, modeling, drafting, window etc.). The kind tells formZ if the tool
				is an operator or a modifier. 				
				
	@return		TRUE if handled which, else FALSE

	@avail		7.0.0.0

	@see		fz_tool_cbak_info,fz_tool_cbak_pick_set,fz_tool_cbak_pick_valid

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_boolean (*fz_tool_cbak_info2_func)(
	fzrt_int				windex,		/* @parm	<in> | project window index 	*/
	fz_tool_info_enum	which,		/* @parm	<in> | parameter identifier					*/
	fz_type_td			*info_data,	/* @parm	<in> | parameter data		 				*/
	fz_type_td			*value		/* @parm	<out> | parameter data		 				*/
	);
	
/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool info (Required if fz_tool_cbak_info not defined, else Recommended). The function is called at various times for formZ to get 
				information about the characteristics of the tool. This function is called once by formZ as soon as the tool 
				is registered and initialized with which == FZ_TOOL_INFO_LEVEL and which == FZ_TOOL_INFO_KIND. 
				Returning and error other than TRUE will cause the tool NOT to be registered
				It establishes the level and kind of the tool. The level distinguishes the 
				context of the tool (system, modeling, drafting, window etc.). The kind tells formZ if the tool
				is an operator or a modifier. 				
				
	@return		TRUE if handled which, else FALSE

	@avail		7.0.0.0

	@see		fz_tool_cbak_info,fz_tool_cbak_pick_set,fz_tool_cbak_pick_valid

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_boolean (*fz_tool_cbak_action_func)(
	fzrt_int				windex,					/* @parm	<in> | project window index 	*/
	fz_tool_action_enum	which,					/* @parm	<in> | parameter identifier					*/
	fzrt_int				set_id,				/* @parm	<in> | pick set id 	*/
	fzrt_int			 	click_count,			/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	char				*action_string,			/* @parm	<in> | parameter data		 				*/
	fzrt_int				action_string_length	/* @parm	<in> | parameter data		 				*/
	);
	
/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool pick valid filter (Recommended). For the tool this function is called for each item in 
				the pick buffer or items that could be added via post pick to determine if they are valid for the tool. If
				this function is not provided, all visible, pickable ettities can be picked by the user.			
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_info,fz_tool_cbak_pick_valid

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_pick_valid_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index 	*/
	fzrt_int				set_id,				/* @parm	<in> | pick set id 	*/
	fzrt_UUID_td		type,				/* @parm	<in> | pick canidate type 	*/
	fz_tag_td			*item_tag,			/* @parm	<in> | pick canidate tag 	*/
	fzrt_UUID_td		part_class,			/* @parm	<in> | pick canidate part type 	*/
	fzrt_int				part_id,			/* @parm	<in> | pick canidate part id 	*/
	fzrt_UUID_td		sub_part_class,		/* @parm	<in> | pick canidate sub part type 	*/
    fzrt_int				sub_part_id,		/* @parm	<in> | pick canidate sub part id 	*/
    fzrt_boolean		*valid				/* @parm	<out> | pick canidate is vbalie (TRUE/FALSE) 	*/
	);
	
/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool pick valid filter (Recommended). For the tool this function is called for each item in 
				the pick buffer or items that could be added via post pick to determine if they are valid for the tool. If
				this function is not provided, all visible, pickable ettities can be picked by the user.			
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_info,fz_tool_cbak_pick_valid

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_pick_valid2_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index 	*/
	fzrt_int				set_id,				/* @parm	<in> | pick set id 	*/
	fzrt_UUID_td		type,				/* @parm	<in> | pick canidate type 	*/
	fz_tag_td			*item_tag,			/* @parm	<in> | pick canidate tag 	*/
	fzrt_UUID_td		part_class,			/* @parm	<in> | pick canidate part type 	*/
	fzrt_int				part_id,			/* @parm	<in> | pick canidate part id 	*/
	fzrt_UUID_td		sub_part_class,		/* @parm	<in> | pick canidate sub part type 	*/
    fzrt_int				sub_part_id,		/* @parm	<in> | pick canidate sub part id 	*/
    fzrt_boolean		*valid,				/* @parm	<out> | pick canidate is vbalie (TRUE/FALSE) 	*/
    fz_string_td 		nvalid_reason		/* @parm	<out> | reason for invalid (if !valid) 	*/
	);
	
/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool pick set information (Recommended). For the tool this function is called for each set in the pick. 
				If this function is not provided, all sets will be unrestricted in the number of entities in the sat and topological levels			
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_pick_valid,fz_tool_cbak_info2

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_pick_set_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index 	*/
	fzrt_int				set_id,				/* @parm	<in> | pick set id 	*/
	fzrt_int				*set_count_min,		/* @parm	<out> | minimum number of entities in set (-1 for no limit)	*/
	fzrt_int				*set_count_max,		/* @parm	<out> | maxiumum number of entities in se (-1 for no limit)	*/
	fzrt_int				*set_topo_mask		/* @parm	<out> | mask of fz_tool_info_pick_objt_bits_enum	*/
	);
	
/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool pick set information (Recommended). For the tool this function is called for each set in the pick. 
				If this function is not provided, all sets will be unrestricted in the number of entities in the sat and topological levels			
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_pick_valid,fz_tool_cbak_info2

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_pick_set2_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index 	*/
	fzrt_int				set_id,				/* @parm	<in> | pick set id 	*/
	fzrt_int				*set_count_min,		/* @parm	<out> | minimum number of entities in set (-1 for no limit)	*/
	fzrt_int				*set_count_max,		/* @parm	<out> | maxiumum number of entities in se (-1 for no limit)	*/
	fzrt_int				*set_topo_mask,		/* @parm	<out> | mask of fz_tool_info_pick_objt_bits_enum	*/
	fzrt_int				*set_type_count,		/* @parm	<out> | how many type of data can be handled	*/
	fzrt_UUID_td		*set_type_list		/* @parm	<out> | list form 0 to set_type_count-1 of types that can be handled	*/
	);

/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool pick set information (Recommended). For the tool this function is called for each set in the pick. 
				If this function is not provided, all sets will be unrestricted in the number of entities in the sat and topological levels			
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_pick_valid,fz_tool_cbak_info2

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_pick_set3_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index 	*/
	fzrt_int				set_id,				/* @parm	<in> | pick set id 	*/
	fzrt_int				*set_count_min,		/* @parm	<out> | minimum number of entities in set (-1 for no limit)	*/
	fzrt_int				*set_count_max,		/* @parm	<out> | maxiumum number of entities in se (-1 for no limit)	*/
	fzrt_int				*set_topo_mask,		/* @parm	<out> | mask of fz_tool_info_pick_objt_bits_enum	*/
	fzrt_int				*set_type_count,	/* @parm	<out> | how many type of data can be handled	*/
	fzrt_UUID_td		*set_type_list,		/* @parm	<out> | list from 0 to set_type_count-1 of types that can be handled	*/
	fzrt_int				*set_flags			/* @parm	<out> | bit encoded pick set flags	*/
	);

	

/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool click. This function is called by formZ for FZ_TOOL_KIND_OPERATOR tools when the tool 
				is the active tool and the mouse is clicked.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_click_up,fz_tool_cbak_track,fz_tool_cbak_prompt,fz_tool_cbak_cancel,fz_fuim_prompt_line

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_click_func)(
	fzrt_int						windex,				/* @parm	<in> | project window index */
	fzrt_point 					*where, 			/* @parm	<in> | point on screen where mouse was clicked */
	fz_xyz_td	 				*where_3d, 			/* @parm	<in> | point in world space (on active reference plane or snapped location) */
	fz_map_plane_td				*map_plane,			/* @parm	<in> | active map plane */
	fz_fuim_click_enum 			clicks, 			/* @parm	<in> | current clicks */
	fzrt_int			 			click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fzrt_boolean 				*click_handled,		/* @parm	<out> | TRUE for clicked handled, FALSE if NOT 	*/		
	fz_fuim_click_wait_enum		*click_wait,		/* @parm	<out> | wait status for next click (default = FZ_FUIM_CLICK_WAIT_NOT)  	*/		
	fzrt_boolean 				*done				/* @parm	<out> | TRUE for tool complete, FALSE if not complete 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	 

	@desc		Tool click. This function is called by formZ for FZ_TOOL_KIND_OPERATOR tools when the tool 
				is the active tool and the mouse is clicked.

	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_click,fz_tool_cbak_track,fz_tool_cbak_prompt,fz_tool_cbak_cancel,fz_fuim_prompt_line

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_click_up_func)(
	fzrt_int						windex,				/* @parm	<in> | project window index */
	fzrt_point 					*where, 			/* @parm	<in> | point on screen where mouse was clicked */
	fz_xyz_td	 				*where_3d, 			/* @parm	<in> | point in world space (on active reference plane or snapped location) */
	fz_map_plane_td				*map_plane,			/* @parm	<in> | active map plane */
	fz_fuim_click_enum 			clicks, 			/* @parm	<in> | current clicks */
	fzrt_int			 			click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fzrt_boolean 				*click_handled,		/* @parm	<out> | TRUE for clicked handled, FALSE if NOT 	*/		
	fz_fuim_click_wait_enum		*click_wait,		/* @parm	<out> | wait status for next click (default = FZ_FUIM_CLICK_WAIT_NOT)  	*/		
	fzrt_boolean 				*done				/* @parm	<out> | TRUE for tool complete, FALSE if not complete 	*/		
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		TODO

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_click,fz_tool_cbak_track,fz_tool_cbak_cancel,fz_fuim_prompt_line

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_prompt_func)(
	fzrt_int						windex,				/* @parm	<in> | 	project window index */
	fz_xyz_td 					*prompt_value,		/* @parm	<in> | TRUE for available, FALSE for not available (dimmed) 	*/		
	char 						*prompt_string,		/* @parm	<in> | TRUE for available, FALSE for not available (dimmed) 	*/		
	fz_map_plane_td				*map_plane,			/* @parm	<in> | active map plane */
	fzrt_int			 			click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fzrt_boolean 				*prompt_handled,	/* @parm	<out> | TRUE for prompt handled, FALSE if NOT 	*/		
	fz_fuim_click_wait_enum		*click_wait,		/* @parm	<out> | wait status for next click (default = FZ_FUIM_CLICK_WAIT_NOT)  	*/		
	fzrt_boolean 				*done				/* @parm	<out> | TRUE for tool complete, FALSE if not complete 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		This function is called by formZ for FZ_TOOL_KIND_OPERATOR tools when the tool is the active tool and the mouse is moved.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_click,fz_tool_cbak_cancel,fz_tool_cbak_prompt,fz_fuim_prompt_line,fz_tool_cbak_track_done,fz_tool_cbak_click_up

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_track_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index */
	fzrt_point 			*where, 			/* @parm	<in> | point on screen where is currently located */
	fz_xyz_td	 		*where_3d, 			/* @parm	<in> | point in world space (on active reference plan or snapped location) */
	fz_map_plane_td		*map_plane,			/* @parm	<in> | active map plane */
	fzrt_int			 	click_count 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		This function is called by formZ for FZ_TOOL_KIND_OPERATOR tools when the tool is the active tool and the mouse is moved.

	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_click,fz_tool_cbak_cancel,fz_tool_cbak_prompt,fz_fuim_prompt_line,fz_tool_cbak_track,fz_tool_cbak_click_up

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_track_done_func)(
	fzrt_int				windex,				/* @parm	<in> | project window index */
	fzrt_point 			*where, 			/* @parm	<in> | point on screen where is currently located */
	fz_xyz_td	 		*where_3d, 			/* @parm	<in> | point in world space (on active reference plan or snapped location) */
	fz_map_plane_td		*map_plane,			/* @parm	<in> | active map plane */
	fzrt_int			 	click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fzrt_boolean 		*done				/* @parm	<out> | TRUE for tool complete, FALSE if not complete 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Undo (Optional). This function is called by formZ when the user selects the undo menu
				item from the Edit menu during the execution of the tool.  This function is used to back the input
				up to the state of the previous click.  If this function is not provided, the tool does not perform undos
				during the use of the tool.
				
				The click_count parameter is the number of clicks which will be one less than the last call to the
				click or prompt functions.  The click_wait parameter tells formZ to wait until a specific type of 
				click happens before calling the click function again.  The done parameter determines the completion
				of the tool.  A value of TRUE indicates that the tool is done, a value of FALSE indicates that the tool
				expects more clicks.  The default is FALSE.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_redo

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_undo_func)(
	fzrt_int						windex,				/* @parm	<in> | 	project window index */
	fzrt_point					*where, 			/* @parm	<in> | point on screen where is currently located */
	fz_xyz_td					*where_3d, 			/* @parm	<in> | point in world space (on active reference plan or snapped location) */
	fz_map_plane_td				*map_plane,			/* @parm	<in> | active map plane */
	fzrt_int			 			click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fz_fuim_click_wait_enum		*click_wait,		/* @parm	<out> | wait status for next click (default = FZ_FUIM_CLICK_WAIT_NOT)  	*/		
	fzrt_boolean 				*done				/* @parm	<out> | TRUE for tool complete, FALSE if not complete 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Redo (Optional). This function is called by formZ when the user selects the redo menu
				item from the Edit menu during the execution of the tool.  This function is used to move the input
				up to the state of the previously undone click.  If this function is not provided, the tool does not perform redos
				during the use of the tool.  This function is only called immediately after a call to the undo function.  Once a
				click or prompt entry occurs, the redo is reset.
				
				The click_count parameter is the number of clicks which will be one more than the last call to the
				undo function.  The click_wait parameter tells formZ to wait until a specific type of 
				click happens before calling the click function again.  The done parameter determines the completion
				of the tool.  A value of TRUE indicates that the tool is done, a value of FALSE indicates that the tool
				expects more clicks.  The default is FALSE.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_undo

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_redo_func)(
	fzrt_int						windex,				/* @parm	<in> | 	project window index */
	fzrt_int			 			click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fz_fuim_click_wait_enum		*click_wait,		/* @parm	<out> | wait status for next click (default = FZ_FUIM_CLICK_WAIT_NOT)  	*/		
	fzrt_boolean 				*done				/* @parm	<out> | TRUE for tool complete, FALSE if not complete 	*/		
	);
	
/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Cancel (Optional). This function is called by formZ if the operation is canceled before the 
				fz_tool_cbak_click_func has returned TRUE for done. A Tool can be cancelled by the user selecting a 
				different tool or pressing the cancel key shortcut.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_click,fz_tool_cbak_track,fz_tool_cbak_prompt

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_cancel_func)(
	fzrt_int				windex,				/* @parm	<in> | 	project window index */
	fzrt_int			 	click_count 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	);
	
typedef enum
{
	FZ_MODF_KEY_DOWN_RAW=0,		/*  @emem modifier key down message			*/
	FZ_MODF_KEY_UP_RAW,			/*  @emem modifier key up message			*/
	FZ_MODF_KEY_DOWN_UP,		/*  @emem modifier key pressed and released message			*/
	FZ_MODF_KEY_MAX,
} fz_modf_key_action;

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Cancel (Optional). This function is called by formZ if a modifier key (command, shift, option ...)
				was pressed down, let go (up), or tabbed (down and up quickly). The tool may use this action
				for certain behavior modification or shortcut actions (see other formZ tools for examples).

	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_click,fz_tool_cbak_track,fz_tool_cbak_prompt

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_modf_key_func)(
	fzrt_int				windex,				/* @parm	<in> | 	project window index */
	fzrt_int			 	click_count, 		/* @parm	<in> | count of clicks for tool (1 for first click, 2 for second etc...) */
	fzrt_int			 	modifiers,			/* @parm	<in> | modifier key state (see fzrt_evnt_modifier_enum) */
	fz_modf_key_action 	modf_key_action		/* @parm	<in> | modifier key action indicator  */
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Deselect (Optional). This function is called by formZ when another tool is selected by the user 
				indicating that the tool is no longer the active tool.
				The user can select the tool by clicking on an icon or executing a key shortcut.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_cmnd_cbak_syst_select,fz_cmnd_cbak_proj_select

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_deselect_func)(
	fzrt_int				windex				/* @parm	<in> | 	project window index */
	);



/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool options name (Recommended). This function is called by formZ to get the name of the options for a tool. 
				It is recommended that the tool name is stored in .fzr file so that it is localizable. If this function is not provided, 
				the name of the plugin, name of the plugin file, name of the script, or name of the script file 
				will be used.

	@return		FZRT_NOERR for success

	@avail		5.0.0.0

	@see		fz_tool_cbak_opts_uuid,fz_tool_cbak_opts_help

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_opts_name_func)(	
	char 		*name, 				/* @parm	<out> | string to be filled with the tool name 	*/		
	fzrt_int 		max_len				/* @parm	<in> | length of name parameter	*/			
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool options id (Recommended). This function is called by formZ to get the id (uuid) of the options 
				for a tool. This unique id is used by formZ to maintain all persistent information about the tool. 
				If this function is not provided, formZ will assign a default id. Note that there are a limited number of 
				default ids and if the number of tools changes from session to session, the id will not be maintained. 
				In this situation, any persistent information (preferences for example) will be lost. 

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_opts_name,fz_tool_cbak_opts_help

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_opts_uuid_func)(
	fzrt_UUID_td 	uuid				/* @parm	<out> | uuid to be filled with the tool id 	*/		
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Help (Recommended) This function is called by formZ to get the help text of the options 
				for a tool. It is recommended that the help text is stored in .fzr file so that it is localizable. 
				If this function is not provided, no help string is shown. Help text is used in the Help dialogs and the Key shortcuts manager.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_opts_name,fz_tool_cbak_opts_uuid

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_opts_help_func)(	
	char 		*help, 				/* @parm	<out> | string to be filled with the help text 	*/		
	fzrt_int		max_len				/* @parm	<in> | length of help text parameter	*/			
	);

/********************************************************************************************************

	@fsfunc_t

	@desc		Tool options interface template function (Recommended)
				This function is called by formZ to generate the interface for the options for a tool. 
				This interface appears in the tool options palette when the tool icon is selected from the tool bar. 
				The interface is also used in a dialog when the icon is double clicked, option-clicked or right clicked. <nl>
				
				The interface is constructed by calls to FUIM template functions

	@return		-1 for failure, ! = -1 for success

	@avail		5.0.0.0

	@see		

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_opts_iface_tmpl_func)(
	fz_fuim_tmpl_ptr 				tmpl_ptr,			/* @parm	<in> | pointer to formZ fuim template manager 	*/		
	fzrt_ptr						tmpl_data			/* @parm	<in> | pointer to formZ fuim template data 	*/	
	);


/********************************************************************************************************

	@fsfunc_t	 

	@desc		Adds the tool icon to a toolbar (Optional). This function is called by formZ to add the tool icon to the icon toolbar.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_icon_menu_adjacent,fz_fuim_exts_icon_group	

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_icon_menu_func)(
	const fzrt_UUID_td 			icon_bar_uuid,			/* @parm	<in> | id of the icon tool bar */ 
	fzrt_UUID_td 				group_uuid,				/* @parm	<out> | id of the icon group (row) to insert the icon
																			if NULL, then a default Extensions group at the bottom of the toolbar is used */ 
	fz_fuim_icon_group_enum 	*group_pos, 			/* @parm	<out> | position to insert the tool in the group (row) */ 
	fzrt_int 						*group_row, 			/* @parm	<out> | specifies exact row when group_pos is FZ_FUIM_ICON_GROUP_CUSTOM */ 
	fzrt_int 						*group_col				/* @parm	<out> | specifies exact column when group_pos is FZ_FUIM_ICON_GROUP_CUSTOM */ 
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Adds the tool icon to a toolbar, adjacent to another tool. This function is called by formZ to add the tool  
				icon to the icon toolbar. The position of the icon is adjacent to an existing icon.

	@return		Error codes

	@avail		5.0.0.0

	@see		fz_tool_cbak_icon_menu

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_icon_menu_adjacent_func)(
	const fzrt_UUID_td 		icon_bar_uuid, 		/* @parm	<in> | id of the icon tool bar */ 
	fzrt_UUID_td 			adjacent_uuid, 		/* @parm	<out> | id of the adjecant tool */ 
	fz_fuim_icon_adjacent_enum *where				/* @parm	<out> | relationship to the adjacent tool */ 
	);

/************************************************************************

	@fsfunc_t

	@desc		Instructs a formZ extension to register its help data.
							
	@avail		6.0.0.0

	@toc		cmds_cbak_tool

*************************************************************************/
typedef fzrt_error_td  (FZRT_SPEC *fz_tool_cbak_pdf_help_func)(void);



/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool can activate (Optional). This function is called by formZ BEFORE this tool is made the active tool by the user.
				The user can activate the tool by clicking on an icon or executing a key shortcut. <nl>
				
				This function should be used when it is possible that a tool can not execute because of some condition.  
				An alert should be posted to notify the user of this condition and/or offer a automatic remedy. This is 
				different than fz_tool_cbak_avail which will dimm the inteface (and not give allow for an alert posting)
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_activate,fz_tool_cbak_avail

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_can_activate_func)(
	fzrt_int				windex,				/* @parm	<in> | 	project window index */
    fzrt_boolean		*can_activate		/* @parm	<out> | toll can be activated (TRUE/FALSE) 	*/
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Activate (Optional). This function is called by formZ when this tool is made the active tool by the user.
				The user can activate the tool by clicking on an icon or executing a key shortcut. <nl>
				
				This tool is a variant of fz_tool_cbak_select which is also called when the tool is made active, however,
				fz_tool_cbak_select is called before the start of each iteration of the tool, not just when the
				tool is made active.
				
	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_deactivate,fz_tool_cbak_select,fz_tool_cbak_deselect

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_activate_func)(
	fzrt_int				windex				/* @parm	<in> | 	project window index */
	);


/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool Deactivate (Optional). This function is called by formZ when another tool is activateed by the user 
				indicating that the tool is no longer the active tool.
				The user can activate the tool by clicking on an icon or executing a key shortcut. <nl>
				
				This tool is a variant of fz_tool_cbak_deselect which is also called when another tool is made active, however,
				fz_tool_cbak_deselect is also called at the end of each iteration of the tool (ie when it is "done"), not just when the
				another tool is made active.

	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_activate,fz_tool_cbak_select,fz_tool_cbak_deselect

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_deactivate_func)(
	fzrt_int				windex				/* @parm	<in> | 	project window index */
	);

/********************************************************************************************************

	@fsfunc_t	

	@desc		Tool icon from file (Optional). This function is called by formZ to load an icon for the tool from an image file. 
				The image file can be in any supported image file format (or of an image format which is an image file 
				translator plugin). It is recommended to use the TIFF image format as it is a cross platform supported format and 
				is always present. The source graphics are identified in the file by indicating the top left corner of the 
				graphic in the file. In addition to the graphic, a mask can be provided for use when the icon is highlighted. A 
				single file can be used for multiple icons across a variety of plugins by creating a grid of icons in the file 
				and specifying the location for each icon.

	@return		Error codes

	@avail		7.0.0.0

	@see		fz_tool_cbak_icon_rsrc

	@exfile		

	@toc		cmds_cbak_tool

*********************************************************************************************************/
typedef fzrt_error_td (*fz_tool_cbak_icon_file2_func)(
	fzrt_floc_ptr 			floc				/* @parm	<out> | file location of file which contains the icon. */
	);


/************************************************************************

	@plfset	fz_tool_cbak_fset

	@desc	Function set for tools. The functions in this set are supplied by the plugin or script to enable tools.  
			Tools are tools actions or states that are selected or invoked by an icon or key shortcut.

	@avail	5.0.0.0

	@toc	cmds_cbak_tool

*************************************************************************/

/********************************************************************************************************

	@fsdef	formZ Tool callback function set id.

*********************************************************************************************************/
/* UUID : {5d51cb36-beb9-4617-bec8-4aae9524ed14} */
#define FZ_TOOL_CBAK_FSET_TYPE		"\x5d\x51\xcb\x36\xbe\xb9\x46\x17\xbe\xc8\x4a\xae\x95\x24\xed\x14"	/* Reference 2553 */
/********************************************************************************************************

	@fsdef	formZ Tool callback function set name.

*********************************************************************************************************/
#define FZ_TOOL_CBAK_FSET_NAME		"formZ Tool Callback Functions"
/********************************************************************************************************

	@fsdef	formZ Tool callback function set version.

*********************************************************************************************************/
#define FZ_TOOL_CBAK_FSET_VERSION	FZPL_VERS_MAKE(6,0,0,0)


typedef struct fz_tool_cbak_fset
{	
	fzpl_fset_prvt_data_td					prvt_data;

	fz_tool_cbak_init_func					fz_tool_cbak_init;					/* @fsfunc */
	fz_tool_cbak_finit_func					fz_tool_cbak_finit;					/* @fsfunc */
	fz_tool_cbak_info_func					fz_tool_cbak_info;					/* @fsfunc */
	fz_tool_cbak_name_func					fz_tool_cbak_name;					/* @fsfunc */
	fz_tool_cbak_uuid_func					fz_tool_cbak_uuid;					/* @fsfunc */
	fz_tool_cbak_help_func					fz_tool_cbak_help;					/* @fsfunc */
	
	fz_tool_cbak_avail_func					fz_tool_cbak_avail;					/* @fsfunc */
	fz_tool_cbak_select_func				fz_tool_cbak_select_obsolete;		/* @fsfunc */
	fz_tool_cbak_active_func				fz_tool_cbak_active;				/* @fsfunc */
	
	fz_tool_cbak_click_func					fz_tool_cbak_click;					/* @fsfunc */
	fz_tool_cbak_track_func					fz_tool_cbak_track;					/* @fsfunc */
	fz_tool_cbak_prompt_func				fz_tool_cbak_prompt_obsolete;		/* @fsfunc */
	fz_tool_cbak_undo_func					fz_tool_cbak_undo;					/* @fsfunc */
	fz_tool_cbak_redo_func					fz_tool_cbak_redo;					/* @fsfunc */
	fz_tool_cbak_cancel_func				fz_tool_cbak_cancel;				/* @fsfunc */
	fz_tool_cbak_deselect_func				fz_tool_cbak_deselect_obsolete;		/* @fsfunc */

	fz_tool_cbak_icon_menu_func				fz_tool_cbak_icon_menu;				/* @fsfunc */
	fz_tool_cbak_icon_menu_adjacent_func	fz_tool_cbak_icon_menu_adjacent;	/* @fsfunc */
	fz_tool_cbak_icon_rsrc_func				fz_tool_cbak_icon_rsrc;				/* @fsfunc */
	fz_tool_cbak_icon_file_obsolete_func	fz_tool_cbak_icon_file_obsolete;				/* @fsfunc */
	
	fz_tool_cbak_pref_io_func				fz_tool_cbak_pref_io;				/* @fsfunc */	

	fz_tool_cbak_opts_name_func				fz_tool_cbak_opts_name;				/* @fsfunc */
	fz_tool_cbak_opts_uuid_func				fz_tool_cbak_opts_uuid;				/* @fsfunc */
	fz_tool_cbak_opts_help_func				fz_tool_cbak_opts_help;				/* @fsfunc */
	fz_tool_cbak_opts_iface_tmpl_func		fz_tool_cbak_opts_iface_tmpl;		/* @fsfunc */
	
	/************************************************************************************
	 *																					*
	 *		DO NOT MAKE ANY CHANGES TO THE ABOVE FUNCTIONS!!!							*
	 *		DO NOT ADD ANY FUNCTION ABOVE THIS LINE!!!									*
	 *		@comm  End of version 5.0.0.0 functions.									*
	 *																					*
	 ************************************************************************************/

	fz_tool_cbak_pdf_help_func				fz_tool_cbak_pdf_help;				/* @fsfunc */

	/************************************************************************************
	 *																					*
	 *		DO NOT MAKE ANY CHANGES TO THE ABOVE FUNCTIONS!!!							*
	 *		DO NOT ADD ANY FUNCTION ABOVE THIS LINE!!!									*
	 *		@comm  End of version 7.0.0.0 functions.									*
	 *																					*
	 ************************************************************************************/

	fz_tool_cbak_click_up_func				fz_tool_cbak_click_up;				/* @fsfunc */
	fz_tool_cbak_info2_func					fz_tool_cbak_info2;					/* @fsfunc */
	fz_tool_cbak_action_func				fz_tool_cbak_action;				/* @fsfunc */
	fz_tool_cbak_pick_valid2_func			fz_tool_cbak_pick_valid;			/* @fsfunc */
	fz_tool_cbak_pick_set3_func				fz_tool_cbak_pick_set;				/* @fsfunc */
	fz_tool_cbak_modf_key_func				fz_tool_cbak_modf_key;				/* @fsfunc */
	fz_tool_cbak_can_activate_func			fz_tool_cbak_can_activate;			/* @fsfunc */
	fz_tool_cbak_activate_func				fz_tool_cbak_activate;				/* @fsfunc */
	fz_tool_cbak_deactivate_func			fz_tool_cbak_deactivate;			/* @fsfunc */
	fz_tool_cbak_icon_file2_func			fz_tool_cbak_icon_file;				/* @fsfunc */
	
} fz_tool_cbak_fset;


#ifdef __cplusplus
}
#endif




#endif /* _FORMZ_TOOL_API_H  */
