// File: "TclABTasks.h"
//                        Created: 2003-12-05 10:05:19
//              Last modification: 2009-05-13 15:32:14
// Author: Bernard Desgraupes
// e-mail: <bdesgraupes@users.sourceforge.net>
// 
// (c) Copyright: Bernard Desgraupes, 2003-2009
//         All rights reserved.
// This software is free software with BSD licence.


#ifndef _TCLABTASKS_H
#define _TCLABTASKS_H


// Function prototypes
// ===================

void	TclAB_ReturnRecord(Tcl_Interp *interp, 
						ABAddressBookRef ab, 
						ABRecordRef inRecord, 
						int inRecordType);

Tcl_Obj *	TclAB_BuildValueForResult(Tcl_Interp *interp, 
						ABAddressBookRef ab, 
						CFStringRef theProperty, 
						CFTypeRef theValue, 
						int inRecordType);

Tcl_Obj *	TclAB_MakeTclObjForValue(Tcl_Interp *interp, 
						ABPropertyType inPropType, 
						CFTypeRef inValue);

bool	TclAB_SetValue(Tcl_Interp *interp, 
					    ABRecordRef theRecord, 
						CFStringRef inProperty, 
						Tcl_Obj * inValue, 
						ABPropertyType inPropType);

int		TclAB_CreateRecord(Tcl_Interp *interp, 
						int objc, 
						Tcl_Obj *CONST objv[], 
						int inRecordType);

int		TclAB_ListItems(Tcl_Interp *interp, 
						int objc, 
						Tcl_Obj *CONST objv[], 
						int inRecordType);

int		TclAB_PropertyAdd(Tcl_Interp *interp, 
						int objc, 
						Tcl_Obj *CONST objv[], 
						int inRecordType);

int		TclAB_PropertyNames(Tcl_Interp *interp, 
						int objc, 
						Tcl_Obj *CONST objv[], 
						int inRecordType);

int		TclAB_PropertyRemove(Tcl_Interp *interp, 
						int objc, 
						Tcl_Obj *CONST objv[], 
						int inRecordType);

int		TclAB_PropertyType(Tcl_Interp *interp, 
						int objc, 
						Tcl_Obj *CONST objv[], 
						int inRecordType);

int		TclAB_IdentifierCount(Tcl_Interp *interp,
						int objc,
						Tcl_Obj *CONST objv[]);

int		TclAB_IdentifierGet(Tcl_Interp *interp,
						int objc,
						Tcl_Obj *CONST objv[]);

int		TclAB_IdentifierIndex(Tcl_Interp *interp,
						int objc,
						Tcl_Obj *CONST objv[]);

int		TclAB_IdentifierPrimary(Tcl_Interp *interp,
						int objc,
						Tcl_Obj *CONST objv[]);

int		TclAB_IdentifierSet(Tcl_Interp *interp,
						int objc,
						Tcl_Obj *CONST objv[]);

int		TclAB_GetSearchComparison(Tcl_Interp *interp, 
						Tcl_Obj * inObj, 
						Boolean isNumeric, 
						Boolean noCase, 
						ABSearchComparison * outComparison);


#endif  // _TCLABTASKS_H