/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   Copyright 1989-2018 by AutoDesSys, Inc.                                                 *
 *                                                                                           *
 *   This software and its associated documentation contains proprietary,                    *
 *   confidential, and trade secret information of AutoDesSys Inc. and may not be            *
 *   disclosed, copied in any form, or used for any purpose except as specifically           *
 *   permitted in writing by AutoDesSys, Inc.                                                *
 *                                                                                           *
 *   AutoDesSys, Inc. grants permission to use the software to those who purchase            *
 *   a license.  Such a usage will be made according to the terms and conditions             *
 *   specified in the license agreement to which a licensee agrees before installing         *
 *   and commencing usage of the software.  The license agreement can be found               *
 *   on the envelop that contains the software CD.                                           *
 *                                                                                           *
 *   AutoDesSys, Inc. also grants permission to licensees to develop extensions to           *
 *   the software, which can be in the form of scripts or plugins.  The permission           *
 *   includes calling the API and call back functions provided by AutoDesSys, Inc.           *
 *   and accessing information relevant to these functions and the general workings          *
 *   of form.Z, but only up to the point to which AutoDesSys, Inc. has chosen to             *
 *   expose, through its form.Z SDK Manual.  All extensions developed by third               *
 *   parties will include a copy of this copyright note in an easily accessible place or     *
 *   a clear instruction to read this original note by AutoDesSys, Inc.                      *
 *                                                                                           *
 *   All the software distributed under a license, either for the purpose of using it or     *
 *   for the purpose of developing extensions, is distributed AS IS, WITHOUT                 *
 *   WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND                                    *
 *   AutoDesSys, Inc. HEREBY DISCLAIMS ALL SUCH WARRANTIES,                                  *
 *   INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF                                         *
 *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.                                    *
 *                                                                                           *
 *   formZ, RenderZone, and RadioZity are registered trademarks of AutoDesSys, Inc.          *
 *                                                                                           *
 *   form.Z SDK, Version 8.6.3, Dec 03, 2018                                                 *
 *                                                                                           *
 *                                                                                           *
 *********************************************************************************************/



#ifndef __FZ_UTIL_API_H
#define __FZ_UTIL_API_H 1


#include "fzpl_plugin.h"

#ifdef __cplusplus
extern "C" {
#endif



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

	Utility (Extension)


	Description
		A utility is an extension which is not loaded at startup and is only loaded and executed by selecting it 
		from the Run Utility menu item (in the Extensions menu) or by running it via an API function.  Utilities 
		are best used on tasks that are linear in nature (like batch processing).  Utilities are not loaded by formZ 
		at startup and do not show up in the Extensions Manager.
 ****************************************************************/

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

	System Utility


	Description
		A system utility is an extension which is not loaded at startup and is only loaded and executed by selecting it 
		from the Run Utility menu item (in the Extensions menu) or by calling it via the fz_syst_plugin_exec_util or 
		fz_syst_script_exec_util API functions.

		System utilities differ from project utilities in that they don't need a particular project on which to operate. 
		They perform more general, project-independent tasks.
 ****************************************************************/


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

	fz_util_cbak_syst_main



	Description
		The main function for a System Utility. When the extension is invoked, this function is called. 
		All execution for the extension is done inside this function (or local functions called from 
		this function). When execution flow exits this function, the extension is unloaded from memory.

	Returns
		Error codes


	Availability	5.0.0.0

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

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

	fz_util_cbak_syst_name



	Description
		Utility name (Recommended/Required). This function is called by formZ to get the name of the utility. 
		It is recommended that the utility name is stored in an .fzr file so that it is localizable. 
		This function is recommended for all utility plugins, however, it is required if the plugin file 
		contains multiple utility plugins. The name is presented to the user when the plugin file is selected so that 
		the user can select which plugin should be executed.

	Parameters
		name  [Result]
			string to be filled with the utility name
		max_len  [Input]
			length of name parameter

	Returns
		Error codes


	Availability	5.0.0.0


	See Also
		fz_util_cbak_syst_uuid

 ****************************************************************/
typedef fzrt_error_td  (*fz_util_cbak_syst_name_func)(
	char 		*name,
	fzrt_int		max_len
	);


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

	fz_util_cbak_syst_uuid



	Description
		Utility uuid (Recommended/Required). This function is called by formZ to get the id (uuid) of the utility. 
		This unique id is used by formZ to maintain all persistent information about the utility. This function 
		is recommended for all utility plugins, however, it is required if the plugin file 
		contains multiple utility plugins. The UUID is used to determine which plugin to execute when the 
		plugin file is invoked.

	Parameters
		uuid  [Result]
			uuid to be filled with the utility id

	Returns
		Error codes


	Availability	5.0.0.0


	See Also
		fz_util_cbak_syst_name

 ****************************************************************/
typedef fzrt_error_td  (*fz_util_cbak_syst_uuid_func)(
	fzrt_UUID_td 	uuid
	);

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

	fz_util_cbak_syst_fset


	FZ_UTIL_CBAK_SYST_FSET_TYPE
		System Utility function set UUID.

	FZ_UTIL_CBAK_SYST_FSET_NAME
		System Utility function set name.

	FZ_UTIL_CBAK_SYST_FSET_VERSION
		System Utility function set version.

	Description
		formZ System Utility callback function set. 
		The functions in this set need to be supplied by an extension to create 
		a project-independent (system) utility.

	Availability	5.0.0.0

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


#define FZ_UTIL_CBAK_SYST_FSET_TYPE		"\xb2\x56\x22\x92\xa8\x75\x44\x26\x90\x26\x22\xb0\xfe\x82\x0b\x91"

#define FZ_UTIL_CBAK_SYST_FSET_NAME		"System Utility"

#define FZ_UTIL_CBAK_SYST_FSET_VERSION	FZPL_VERS_MAKE(5,0,0,0)

typedef struct fz_util_cbak_syst_fset
{
	fzpl_fset_prvt_data_td				prvt_data;
		
	fz_util_cbak_syst_main_func			fz_util_cbak_syst_main;
	fz_util_cbak_syst_name_func			fz_util_cbak_syst_name;
	fz_util_cbak_syst_uuid_func			fz_util_cbak_syst_uuid;
	
	

}  fz_util_cbak_syst_fset;




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

	Project Utility 


	Description
		A project utility is an extension which is not loaded at startup and is only loaded and executed by selecting it 
		from the Run Utility menu item (in the Extensions menu) or by calling it via the fz_proj_plugin_exec_util or 
		fz_proj_script_exec_util API functions.

		Project utilities differ from system utilities in that they are provided a project window on which to operate. 
		They usually perform tasks within the scope a project, like automatically creating hundreds of objects.
 ****************************************************************/


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

	fz_util_cbak_proj_main



	Description
		The main function for a Project Utility. When the extension is invoked, this function is called. 
		All execution for the extension is done inside this function (or local functions called from 
		this function). When execution flow exits this function, the extension is unloaded from memory.

	Parameters
		windex  [Input]
			project

	Returns
		Error codes


	Availability	5.0.0.0

 ****************************************************************/
typedef fzrt_error_td  (*fz_util_cbak_proj_main_func)(
	fzrt_int			windex
	);

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

	fz_util_cbak_proj_name



	Description
		Utility name (Recommended/Required). This function is called by formZ to get the name of the utility. 
		It is recommended that the utility name is stored in an .fzr file so that it is localizable. 
		This function is recommended for all utility plugins, however, it is required if the plugin file 
		contains multiple utility plugins. The name is presented to the user when the plugin file is selected so that 
		the user can select which plugin should be executed.

	Parameters
		name  [Result]
			string to be filled with the utility name
		max_len  [Input]
			length of name parameter

	Returns
		Error codes


	Availability	5.0.0.0


	See Also
		fz_util_cbak_proj_uuid

 ****************************************************************/
typedef fzrt_error_td  (*fz_util_cbak_proj_name_func)(
	char 		*name,
	fzrt_int		max_len
	);


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

	fz_util_cbak_proj_uuid



	Description
		Utility uuid (Recommended/Required). This function is called by formZ to get the id (uuid) of the utility. 
		This unique id is used by formZ to maintain all persistent information about the utility. This function 
		is recommended for all utility plugins, however, it is required if the plugin file 
		contains multiple utility plugins. The UUID is used to determine which plugin to execute when the 
		plugin file is invoked.

	Parameters
		uuid  [Result]
			uuid to be filled with the utility id

	Returns
		Error codes


	Availability	5.0.0.0


	See Also
		fz_util_cbak_proj_name

 ****************************************************************/
typedef fzrt_error_td  (*fz_util_cbak_proj_uuid_func)(
	fzrt_UUID_td 	uuid
	);

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

	fz_util_cbak_proj_fset


	FZ_UTIL_CBAK_PROJ_FSET_TYPE
		Project Utility function set UUID.

	FZ_UTIL_CBAK_PROJ_FSET_NAME
		Project Utility function set name.

	FZ_UTIL_CBAK_PROJ_FSET_VERSION
		Project Utility function set version.

	Description
		formZ Project Utility callback function set. 
		The functions in this set need to be supplied by an extension to create 
		a project-dependent utility.

	Availability	5.0.0.0

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


#define FZ_UTIL_CBAK_PROJ_FSET_TYPE		"\xc1\x29\xc9\x71\x87\x16\x43\x19\xb9\xa5\x96\xe4\x1d\xe1\x7e\xb9"

#define FZ_UTIL_CBAK_PROJ_FSET_NAME		"Project Utility"

#define FZ_UTIL_CBAK_PROJ_FSET_VERSION	FZPL_VERS_MAKE(5,0,0,0)

typedef struct fz_util_cbak_proj_fset
{
	fzpl_fset_prvt_data_td				prvt_data;
		
	fz_util_cbak_proj_main_func			fz_util_cbak_proj_main;
	fz_util_cbak_proj_name_func			fz_util_cbak_proj_name;
	fz_util_cbak_proj_uuid_func			fz_util_cbak_proj_uuid;
	
	


}  fz_util_cbak_proj_fset;

#ifdef __cplusplus
}
#endif

#endif

