//---------------------------------------------------------------------------

#ifndef TZecH
#define TZecH
//---------------------------------------------------------------------------
#include <System.SysUtils.hpp>
#include <System.Classes.hpp>
#include <map>
#include "DllWrapper.h"
#include "TipoviPoruka.h"
#include "Paketi\Helper\THelper.h"
#include "UpdatePodesavanja.h"
#include <System.Math.hpp>
#include "Paketi\Logger\TLogger.h"
#include "Paketi\Ping\TPinger.h"
//---------------------------------------------------------------------------
class TZec
{
	private:
	protected:
	public:
		static void KonektujSe(NoParamsFunc rekonekcija, int paralelnoPoruka = 1, AnsiString app = "");
		static void PoslajiLog(UnicodeString logPoruka, LoggingLevel nivo, CallbackStatus statusCallback);
		static void PosaljiPoruku(const std::map<AnsiString, AnsiString>& hederi, AnsiString poruka, AnsiString uid, CallbackStatus statusCallback,
			bool naSve = false, AnsiString trajanje = "");
		static void PosaljiTekst(AnsiString uid, AnsiString teskt, bool kratkotrajno, CallbackStatus statusCallback);
		static void Prijem(AnsiString kanal, RcvMsgExternal prijem);
		static void PotvrdiPrijem(int tag);
		static void PokreniUpdate(AnsiString uid, TPodesavanja* updejtPodesavanja, CallbackStatus statusCallback);
		static void Diskonektuj();
		static void PosaljiFajlove(AnsiString uid, CallbackStatus statusCallback);
		static void PosaljiBazu(AnsiString uid, CallbackStatus statusCallback);
		static void PreuzmiFajl(AnsiString uid, AnsiString naziv, AnsiString fajl, CallbackStatus statusCallback);
		static void StatusSinhronizacije(std::map<AnsiString, AnsiString> stanja, CallbackStatus statusCallback);
		static void IzvrsiSql(AnsiString uid, UnicodeString sql, CallbackStatus statusCallback);
		static void PrijaviIzvrsenjeSql(AnsiString uid, UnicodeString sta, bool greska,
			bool rezultat, CallbackStatus statusCallback);
		static void PrijaviOperaciju(AnsiString uid, TipPoruke operacija, bool uspeh,
			AnsiString poruka, CallbackStatus statusCallback);
        static void Prijava(CallbackStatus statusCallback);

		static AnsiString TipPorukeUString(TipPoruke tip);
		static TipPoruke StringUTipPoruke(AnsiString tip);

		static void Bloker();
		static void Provera();
		static void KonekcijaZatvorena();
		static void Konektovan();
		static void Gotov();
		static void StatusKonekcije(bool ok, const char* poruka);
		static void PrijemPorukeInterno(const char** zaglavljeNazivi, const char** zaglavljeVrednosti, const char* poruka, int brPoruke);

		static bool _stopZec;
		static const AnsiString _dan;
		static const AnsiString _8sati;
		static const AnsiString _sat;

		static const char* const* Hederi(const std::map<AnsiString, AnsiString>& hederiMapa, bool vrednosti);
		static void ProveraStatusa();
		static DllWrapper* _dllWrapper;
		static THelper* _helperZec;
		static TLogger* _loggerZec;
		static TPinger* _pingerZec;
		static TCompInfo _info;
		static bool _connUtoku;
		static bool _inError;
		static bool _prijavljen;
		static bool _gotInfo;
		static AnsiString _server;
		static int _port;
        static AnsiString _app;
};

//---------------------------------------------------------------------------
#endif
