#pragma once

#define	WEBSVC_GEN_URLS		0x0001
#define	WEBSVC_FILE_URLS	0x0002

class CMenuXP; //>>> WiZaRd::XPMenu [TPT]
class CWebServices
{
public:
	CWebServices();

	CString GetDefaultServicesFile() const;
	int ReadAllServices();
	void RemoveAllServices();

//>>> shadow2004::XPMenu [TPT]
	int GetFileMenuEntries(CMenuXP* rMenu);
	int GetGeneralMenuEntries(CMenuXP* rMenu);
	int GetAllMenuEntries(CMenuXP* rMenu, DWORD dwFlags = WEBSVC_GEN_URLS | WEBSVC_FILE_URLS);
//<<< shadow2004::XPMenu [TPT]
	bool RunURL(const CAbstractFile* file, UINT uMenuID);
	void Edit();

protected:
	struct SEd2kLinkService
	{
		UINT uMenuID;
		CString strMenuLabel;
		CString strUrl;
		BOOL bFileMacros;
	};
	CArray<SEd2kLinkService> m_aServices;
	time_t m_tDefServicesFileLastModified;
};

extern CWebServices theWebServices;
