// Options.h
//

#pragma once

#include "MarkupSTL.h"

#define OPTIONS_NUM 30

class COptions
{
public:
	static bool Init(LPCTSTR pszConfigFile);

	static void SetOption(int OptionID,CString sValue);
	static void SetOption(int OptionID,int     nValue);

	static CString GetOption(int nOptionID);
	static int     GetOptionVal(int nOptionID);

	static class CCriticalSection m_csSync;

protected:
	static CString m_sConfigFile;

	enum OPTION_TYPE {
		OT_STRING = 0,
		OT_NUMBER,
	};

	typedef struct {
		bool        bCached;
		OPTION_TYPE type;
		CString     sValue;
		int         nValue;
	} OPTIONCACHE_STRUCT;

	static bool m_bInitialized;
	static CMarkupSTL m_markup;

	static OPTIONCACHE_STRUCT m_aoc[OPTIONS_NUM];
};

enum OPTIONS {
    OPTION_WINDOWSPOS = 0,
	OPTION_SPLITTERSIZE,
	OPTION_REMOTETREESIZE,
	OPTION_LOCALTREESIZE,
	OPTION_SHOWREMOTETREE,
	OPTION_SHOWLOCALTREE,
	OPTION_REMOTELISTSTYLE,
	OPTION_LOCALLISTSTYLE,
	OPTION_SHOWREMOTESTATUS,
	OPTION_SHOWLOCALSTATUS,		// 10
	OPTION_REMOTECOLUMNWIDTHS,
	OPTION_LOCALCOLUMNWIDTHS,
	OPTION_REMOTECOLUMNSORT,
	OPTION_LOCALCOLUMNSORT,
	OPTION_SHOWTOPTOOLBAR,
	OPTION_SHOWMIDTOOLBAR,
	OPTION_USERID,
	OPTION_PASSWORD,
	OPTION_AUTOCONNECT,
	OPTION_SAVEPASSWORD,		// 20
	OPTION_FILEEXISTSACTION,
	OPTION_AFTEREXEC,
	OPTION_SEARCHSUBURL,
	OPTION_URLTAGTYPE,
	OPTION_URLSTAG,
	OPTION_URLETAG,
	OPTION_PROXYHOST,
	OPTION_PROXYPORT,
	OPTION_USEIEPROXY,
	OPTION_WRITEPOLICY,
};
