summaryrefslogtreecommitdiff
path: root/src/vdr-plugin/history.h
blob: a99909808d3c3f9103bdbb006e18e891353bbe1d (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
55
56
57
58
59
60
61
62
/*
 * history.h: Web video plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#ifndef __WEBVIDEO_HISTORY_H
#define __WEBVIDEO_HISTORY_H

#include <vdr/tools.h>
#include "menudata.h"

// --- cHistoryObject -----------------------------------------------------

class cHistoryObject : public cListObject {
private:
  char *osdxml;
  int id;
  int selected;
  cVector<cQueryData *> editData;
  char *reference;

  cQueryData *GetEditItem(const char *controlName);

public:
  cHistoryObject(const char *xml, const char *reference, int ID);
  ~cHistoryObject();

  int GetID() const { return id; }
  const char *GetOSD() const { return osdxml; }
  const char *GetReference() const { return reference; }
  void RememberSelected(int sel) { selected = sel; }
  int GetSelected() const { return selected; }
  
  int QuerySize() const;
  char *GetQueryFragment(int i, const char *encoding) const;
  cTextFieldData *GetTextFieldData(const char *controlName);
  cItemListData *GetItemListData(const char *controlName,
                                 cStringList &items,
                                 cStringList &itemvalues);
};

// --- cHistory ------------------------------------------------------------

class cHistory : public cList<cHistoryObject> {
private:
  cHistoryObject *current;
public:
  cHistory();

  void Clear();
  void TruncateAndAdd(cHistoryObject *page);
  void Reset();
  cHistoryObject *Current();
  cHistoryObject *Home();
  cHistoryObject *Back();
  cHistoryObject *Forward();
};

#endif // __WEBVIDEO_HISTORY_H