/*******************************************************************************
//
//	ftprn_api.h
//
//	Printer for Remote Desktop
//
//	Implementaion of loading and unloading ftprintapi.dll for dynamic linking
//
//	Copyright (c) FabulaTech
//
*******************************************************************************/

#pragma once

#include <Windows.h>
#include "ftstatus.h"
#include "ftprn_structs.h"


#ifdef __cplusplus
#define FT_EXTERN extern "C" extern
#else
#define FT_EXTERN extern
#endif


FT_EXTERN BOOL __cdecl FtPrnVirtApiLoad();
FT_EXTERN void __cdecl FtPrnVirtApiFree();

typedef ftStatus (__cdecl *FTPRNVIRTAPIINIT)(
	PNOTIFICATION_CALLBACK pCallback,
	LPVOID lpContext
);
FT_EXTERN FTPRNVIRTAPIINIT FtPrnVirtApiInit;

typedef ftStatus(__cdecl *FTPRNVIRTAPICLEANUP)();
FT_EXTERN FTPRNVIRTAPICLEANUP FtPrnVirtApiCleanUp;

typedef ftStatus(__cdecl *FTPRNSELECTPRINTER)(
	__in DWORD dwPrinterID
);
FT_EXTERN FTPRNSELECTPRINTER FtPrnSelectPrinter;

typedef ftStatus(__cdecl *FTPRNGETDEFAULTPRINTER)(
	__out ftPrinter *lpPrinter
	);
FT_EXTERN FTPRNGETDEFAULTPRINTER FtPrnGetDefaultPrinter;

typedef ftStatus(__cdecl *FTPRNAPPLYKEYA)(
	__in LPCSTR lpKey
);
FT_EXTERN FTPRNAPPLYKEYA FtPrnApplyKeyA;

typedef ftStatus(__cdecl *FTPRNAPPLYKEYW)(
	__in LPCWSTR lpKey
);
FT_EXTERN FTPRNAPPLYKEYW FtPrnApplyKeyW;

#ifdef UNICODE
#define FtPrnApplyKey FtPrnApplyKeyW
#else
#define FtPrnApplyKey FtPrnApplyKeyA
#endif // !UNICODE

typedef ftStatus(__cdecl *FTPRNGETKEYDATA)(
	PVOID pData,
	PDWORD pcbSize
);
FT_EXTERN FTPRNGETKEYDATA FtPrnGetKeyData;

typedef ftStatus(__cdecl *FTPRNGETKEYDATAINTA)(
	__in LPCSTR szType,
	__inout INT64 *lpKeydata
);
FT_EXTERN FTPRNGETKEYDATAINTA FtPrnGetKeyDataIntA;

typedef ftStatus(__cdecl *FTPRNGETKEYDATAINTW)(
	__in LPCWSTR szType,
	__inout INT64 *lpKeydata
);
FT_EXTERN FTPRNGETKEYDATAINTW FtPrnGetKeyDataIntW;

#ifdef UNICODE
#define FtPrnGetKeyDataInt FtPrnGetKeyDataIntW
#else
#define FtPrnGetKeyDataInt FtPrnGetKeyDataIntA
#endif // !UNICODE

typedef ftStatus(__cdecl *FTPRNGETKEYDATASTRA)(
	__in LPCSTR szType,
	__inout LPSTR lpszKeyData,
	__inout DWORD *ccSize
);
FT_EXTERN FTPRNGETKEYDATASTRA FtPrnGetKeyDataStrA;

typedef ftStatus(__cdecl *FTPRNGETKEYDATASTRW)(
	__in LPCWSTR szType,
	__inout LPWSTR lpszKeyData,
	__inout DWORD *ccSize
);
FT_EXTERN FTPRNGETKEYDATASTRW FtPrnGetKeyDataStrW;

#ifdef UNICODE
#define FtPrnGetKeyDataStr FtPrnGetKeyDataStrW
#else
#define FtPrnGetKeyDataStr FtPrnGetKeyDataStrA
#endif // !UNICODE

/*
* Use License Server for licensing the product.
*/
typedef ftStatus(__cdecl *FTPRNUSELICENSESERVER)(
	BOOL bUse,
	LPCWSTR szHost,
	USHORT nTcpPort
);
FT_EXTERN FTPRNUSELICENSESERVER FtPrnUseLicenseServer;

/*
* Get if License Server is using for licensing the product.
*/
typedef ftStatus(__cdecl *FTPRNGETUSINGLICENSESERVER)(
	__out PBOOL pbUse,
	__out WCHAR *szHost,
	__out USHORT * lpnTcpPort
);
FT_EXTERN FTPRNGETUSINGLICENSESERVER FtPrnGetUsingLicenseServer;

typedef ftStatus(__cdecl* FTPRNSETLASTUSEDPRINTER)(
	__in DWORD dwPrinterID
	);
FT_EXTERN FTPRNSETLASTUSEDPRINTER FtPrnSetLastUsedPrinter;
