#ifndef EPISODELISTVIEW_H
#define EPISODELISTVIEW_H

#include <windows.h>
#include <commctrl.h>

#include "listview.h"

#define ELVSIEPISODE 0
#define ELVSITITLE 1
#define ELVSIRATING 2

struct EpisodeListView : public ListView
{
	EpisodeListView(HWND hWndParent);
	void DoSort();
	void EnsureFocusVisible();
	LRESULT HandleNotify(LPARAM lParam);
	void Redraw();
	void SaveFocus();
	void SetTop(int iItem);
	void RestoreFocus();
	void SelectUnwatched(int iDir);
	void ShowFocus();
	void Update();
	void UpdateItem(const LVITEM* pLvi);
	LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
private:
	int m_iSort;
	LVITEM m_lviFocus;
	friend int CALLBACK ElvSort(LPARAM lParam1, LPARAM lParam2, LPARAM lExtra);
};

#endif