#include <windows.h>

#ifndef __OPTIONSCLASS
#define __OPTIONSCLASS

#define	OPTIONS_STRING				1
#define	OPTIONS_NUMBER				2

struct OPTIONS_CONNECTION
{
	char *host,*host_ip,*dbname,*user,*password;
	DWORD port, timeout, ssl;
};

struct OPTIONS_EDITOR
{
	char *fontName;
	DWORD fontSize;
};

struct OPTIONS_WINDOWS
{
	DWORD sepHor, sepVer;
};

class COptions
{
	private:
		HANDLE hFile;

		void SetDefault();//nastavi defaultne hodnoty
		void LoadOptions(bool error);//nacita nastavenie, v priapde, ze neexistuje subor s nastavenim chceme chybu? -> error?
		void SaveOptions();//ulozi nastavenie
		static char *ReadText(HWND hwnd, DWORD controlID);//vrati pointer na text - treba ho uvolnit
		static BOOL CALLBACK DialogProc(HWND,UINT,WPARAM,LPARAM);
		static void SelectFont(HWND,DWORD);

		void WriteData(void*data,int type);
		void ReadData(void*data,int type);

	public:
		COptions();
		~COptions();

		char *appDir;//adresar aplikacie
		void SetSettings();//zobrazi dialog s nastaveniami

		//nastavenie pripojenia na server
		OPTIONS_CONNECTION connection;
		//nastavenie editora
		OPTIONS_EDITOR editor;
		//nastavenie html
		OPTIONS_EDITOR html;
		//nastavenie okien separatorov (neuklada sa)
		OPTIONS_WINDOWS win;
};

#endif __OPTIONSCLASS
