aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.h
blob: f94803c7f4a2946933465a42fca86be9de53ac4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef EPISODELISTVIEW_H
#define EPISODELISTVIEW_H

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

#include "data.h"
#include "listview.h"

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

extern CfgA& g_cfg;

struct EpisodeListView : public ListView
{
	EpisodeListView(HWND hWndParent);
	void EnsureFocusVisible();
	void HandleContextMenu(WORD);
	LRESULT HandleNotify(LPARAM lParam);
	void Redraw();
	void ResizeColumns(int w) override;
	void RestoreFocus();
	void SaveFocus();
	void SetTop(int iItem);
	/* Select next/previous unwatched episode. */
	void SelectUnwatched(int dir);
	void ShowFocus();
	void Sort();
	/* Update episode list. */
	void Update();
	LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
private:
	signed char m_iSortCol;
	static int CALLBACK SortProc(LPARAM lParam1, LPARAM lParam2, LPARAM extra);
	FileView<ElvDataA> m_fv{L"elvdata.dat", g_cfg.cEp+128u};
};

#endif