#ifndef __UTILS_H
#define __UTILS_H

// lista dei tipi di installazione 0=non si sa, 1=standalone, 2=server, 3=client
enum InstallationType { it_none, it_standalone, it_server, it_client, it_upgrade = 9 };

enum LurchMode { lm_none, lm_service, lm_autostart };
////////////////////////////////////////////////////////////////////////////////////////////
//Classe per la gestione dei files di configurazione tipo campo.ini
class CampoIniFile : public wxObject
{
  wxString m_strIniName, m_strGroup;
  wxArrayString m_asGroups, m_asEntries;

public:
  bool GetFirstGroup(wxString& strGroup, long& nIndex);
  bool GetNextGroup(wxString& strGroup, long& nIndex);
  bool DeleteGroup(const wxString strGroup);
  bool GetFirstEntry(wxString& strEntry, long& nIndex);
  bool GetNextEntry(wxString& strEntry, long& nIndex);

  wxString Get(const wxString strVariable) const;
  bool GetBool(const wxString strVariable) const;
  int GetInt (const wxString strVariable) const;
  bool Set(const wxString strVariable, const wxString strValue);
  InstallationType GetInstallationType() const;
  bool Set(const wxString strVariable, const int uValue);

  CampoIniFile(const wxString strIniPath, wxString strGroup);
};
/*
class CampoIniFile   : public wxFileConfig
{
protected:
public:
  wxString Get(const wxString strVariable) const;
  bool GetBool(const wxString strVariable) const;
  int GetInt (const wxString strVariable) const;
  bool Set(const wxString strVariable, const wxString strValue);
  InstallationType GetInstallationType() const;
  bool Set(const wxString strVariable, const int uValue);

  CampoIniFile(const wxString strIniPath, wxString strValue);
};
*/

//progind
class CampoProgressDialog : public wxProgressDialog
{
public:
  CampoProgressDialog(const wxString& strTitle, int nMaximum = 100, wxWindow* pParent = NULL);
};

//metodi generici
//finestre messaggio,errore,ecc...
bool ErrorBox(const wxString str);
bool WarningBox(const wxString str);
bool YesNoBox(const wxString str);

//trattamento files
void CheckAndMakeDir(const wxString& strDir, const wxString& strMsg);
bool UnzipFile(const char* strZipFile, const char* strDestdir);
bool CopiaFile(const wxString& file1, const wxString& file2);

//interfaccia con windows
wxString GetWindowsProgramDirectory();
int GetSessionId();

size_t ListNetworkDisks(wxArrayString& asList);
size_t ListSharedDirectories(wxArrayString& asList);
bool IsSharedDirectory (const wxString& strDir);

#endif