#pragma once
#include "telescopinglist.h"

class EventList :
	public TelescopingList
{
public:
	EventList(void);
	~EventList(void);

	void Add(Event * event);
	void EditAdd(Event * event);
	void Delete(Event * event);
	void EditDelete(Event* event);
	int Create(HWND parent = 0);
	void UpdateEvent(ListItem * item);

	void OnNotify(int id, int reason);

	void DeepRefresh(int memoize = 1);
	void DeepRefreshEdit(int memoize = 1);
	void ClearList();
	void ClearEditList();
	int Exists(int id);
	int EditExists(int id);
	
	virtual void OnListSelect(HWND h, HWND hItem);
	virtual void OnListDblSelect(HWND h, HWND hItem);
	virtual void OnPopupStart(WPARAM wParam, LPARAM lParam);
	virtual void OnPopupEnd(WPARAM wParam, LPARAM lParam);
	virtual void OnTimer();
	virtual void OnButton(HWND h);
	virtual void OnListDeleteItem(WPARAM wParam, LPARAM lParam);
	virtual void OnCustomNotify(int id, Notification& n);

	// List Item appearances for the active event list
	Appearance ActivePublic;
	Appearance PendingPublic;
	Appearance ActivePrivate;
	Appearance PendingPrivate;
	Appearance EmptyStyle;
	// List item appearances for the editing list
	Appearance CheckedPublic;
	Appearance UncheckedPublic;
	Appearance CheckedPrivate;
	Appearance UncheckedPrivate;
	Appearance EditEmptyStyle;

	Vector<int> SubscribedEventIds;
	Vector<int> SubscribableEventIds;

	int nActiveEvents;

private:
	int NeedRefresh; // does the list need to call DeepRefresh before displaying?
	int NeedEditRefresh; // does the edit list need to call DeepRefreshEdit before displaying?
};
