summaryrefslogtreecommitdiff
path: root/browserGrid.h
blob: 36fac5cd38f855c61c8a5ceb5f855b42614e1e76 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef CBROWSERGRID_H
#define CBROWSERGRID_H

#include <memory>
#include <vector>
#include "Plexservice.h"
#include "plexgdm.h"
#include "PlexServer.h"
#include "viewGridNavigator.h"
#include "libskindesigner/osdelements.h"

class cDummyElement : public cGridElement
{
public:
	virtual std::string GetTitle();
	virtual void AddTokens(std::shared_ptr<cViewGrid> grid);
};

class cServerElement : public cGridElement
{
private:
	plexclient::PlexServer* m_pServer;
	std::string m_sStartPath;
	std::string m_sStartName;
public:
	cServerElement(plexclient::PlexServer* server, std::string startPath, std::string startName);
	virtual std::string GetTitle();
	virtual void AddTokens(std::shared_ptr<cViewGrid> grid);
	std::string StartPath() { return m_sStartPath; }
	plexclient::PlexServer* Server() { return m_pServer; }
};

class cBrowserGrid : public cViewGridNavigator
{
private:	
	bool m_bServersAreRoot;
	std::vector<cServerElement> m_vServerElements;
	
	std::shared_ptr<plexclient::MediaContainer> m_pContainer;
	std::shared_ptr<plexclient::Plexservice> m_pService;
	cDummyElement m_Dummy;

	void ProcessData();
	void SetServerElements();
	
public:
	cBrowserGrid(cViewGrid* viewGrid);
	cBrowserGrid(cViewGrid* viewGrid, std::shared_ptr<plexclient::Plexservice> service);
	
	virtual eOSState NavigateSelect();
	virtual eOSState NavigateBack();
};

#endif // CBROWSERGRID_H