// CodeGear C++Builder
// Copyright (c) 1995, 2023 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'uecMBTiles.FireDAC.pas' rev: 36.00 (Windows)

#ifndef Uecmbtiles_FiredacHPP
#define Uecmbtiles_FiredacHPP

#pragma delphiheader begin
#pragma option push
#if defined(__BORLANDC__) && !defined(__clang__)
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#endif
#pragma pack(push,8)
#include <System.hpp>
#include <SysInit.hpp>
#include <System.SysUtils.hpp>
#include <System.Variants.hpp>
#include <System.Math.hpp>
#include <System.Classes.hpp>
#include <FireDAC.Stan.Intf.hpp>
#include <FireDAC.Stan.Option.hpp>
#include <FireDAC.Stan.Error.hpp>
#include <FireDAC.UI.Intf.hpp>
#include <FireDAC.Phys.Intf.hpp>
#include <FireDAC.Stan.Def.hpp>
#include <FireDAC.Stan.Pool.hpp>
#include <FireDAC.Stan.Async.hpp>
#include <FireDAC.Phys.hpp>
#include <FireDAC.VCLUI.Wait.hpp>
#include <FireDAC.Phys.MySQLDef.hpp>
#include <FireDAC.Phys.MySQL.hpp>
#include <Data.DB.hpp>
#include <FireDAC.Comp.Client.hpp>
#include <FireDAC.Stan.ExprFuncs.hpp>
#include <FireDAC.Phys.SQLiteWrapper.Stat.hpp>
#include <FireDAC.Phys.SQLiteDef.hpp>
#include <FireDAC.Phys.SQLite.hpp>
#include <FireDAC.DApt.hpp>
#include <uecNativeMapControl.hpp>
#include <UECMapUtil.hpp>

//-- user supplied -----------------------------------------------------------

namespace Uecmbtiles
{
namespace Firedac
{
//-- forward type declarations -----------------------------------------------
class DELPHICLASS TecMBTiles;
//-- type declarations -------------------------------------------------------
#pragma pack(push,4)
class PASCALIMPLEMENTATION TecMBTiles : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	System::StaticArray<Firedac::Comp::Client::TFDConnection*, 4> FMBTilesConnection;
	System::StaticArray<Firedac::Comp::Client::TFDQuery*, 4> FMBTilesQuery;
	Uecnativemapcontrol::TECNativeMap* FMap;
	Uecmaputil::TTileServer FPrevTileServer;
	System::UnicodeString FSelectQuery;
	System::UnicodeString FFileName;
	System::UnicodeString FServeurName;
	System::UnicodeString FMeta_Name;
	System::UnicodeString FMeta_Format;
	System::UnicodeString FMeta_Type;
	System::UnicodeString FMessageError;
	Uecnativemapcontrol::TECOverlayTileLayer* FOverlay;
	bool FisOverlay;
	bool FIsConnect;
	bool __fastcall isIndex(Firedac::Comp::Client::TFDQuery* const AMBTilesQuery, const System::UnicodeString AIndexName);
	void __fastcall Read_MetaData(Firedac::Comp::Client::TFDQuery* const AMBTilesQuery);
	void __fastcall getTileStream(const int ThreadIndex, System::Classes::TMemoryStream* &TileStream, const int x, const int y, const int z);
	
public:
	__fastcall TecMBTiles(Uecnativemapcontrol::TECNativeMap* AMap);
	__fastcall virtual ~TecMBTiles();
	bool __fastcall Connect(const System::UnicodeString MBTiles_FileName);
	void __fastcall Disconnect();
	__property System::UnicodeString FileName = {read=FFileName};
	__property bool IsConnect = {read=FIsConnect, nodefault};
	__property System::UnicodeString MessageError = {read=FMessageError};
	__property Uecnativemapcontrol::TECNativeMap* Map = {read=FMap};
	__property Uecnativemapcontrol::TECOverlayTileLayer* Overlay = {read=FOverlay};
};

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
static const System::Int8 MAX_THREAD_TILES = System::Int8(0x3);
}	/* namespace Firedac */
}	/* namespace Uecmbtiles */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_UECMBTILES_FIREDAC)
using namespace Uecmbtiles::Firedac;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_UECMBTILES)
using namespace Uecmbtiles;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Uecmbtiles_FiredacHPP
