#pragma once
#include "telescopinglist.h"

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

	void Add(Location * location);
	void EditAdd(Location * location);
	void Delete(Location * location);
	void EditDelete(Location* location);
	int Create(HWND parent = 0);
	void UpdateActiveCount();

	void OnNotify(int id, int reason);

	void DeepRefresh(int memoize = 1);
	void DeepRefreshEdit(int memoize = 1);
	void ShallowRefreshItem(int locationId);
	void ClearList();
	void ClearEditList();
	
	virtual void OnListSelect(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 location list
	Appearance Nobody;
	Appearance Eventful;
	Appearance Active;
	Appearance Unknown;
	Appearance UserOccupied;
	Appearance EmptyStyle;
	// List item appearances for the editing list
	Appearance Checked;
	Appearance Unchecked;
	Appearance EditEmptyStyle;

	int nActiveLocations;

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

};
