summaryrefslogtreecommitdiff
path: root/epgsearch/services.h
blob: 902adee0865d5695f02f79f778a1a9cd021aa196 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#ifndef EPGSEARCHSERVICES_INC
#define EPGSEARCHSERVICES_INC

#include <string>
#include <list>
#include <memory>

// Data structure for service "Epgsearch-search-v1.0"
struct Epgsearch_search_v1_0
{
// in
    char* query;               // search term
    int mode;                  // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
    int channelNr;             // channel number to search in (0=any)
    bool useTitle;             // search in title
    bool useSubTitle;          // search in subtitle
    bool useDescription;       // search in description
// out
    cOsdMenu* pResultMenu;   // pointer to the menu of results
};

// Data structure for service "Epgsearch-exttimeredit-v1.0"
struct Epgsearch_exttimeredit_v1_0
{
// in
    cTimer* timer;             // pointer to the timer to edit
    bool bNew;                 // flag that indicates, if this is a new timer or an existing one
    const cEvent* event;             // pointer to the event corresponding to this timer (may be NULL)
// out
    cOsdMenu* pTimerMenu;   // pointer to the menu of results
};

// Data structure for service "Epgsearch-updatesearchtimers-v1.0"
struct Epgsearch_updatesearchtimers_v1_0
{
// in
    bool showMessage;           // inform via osd when finished?
};

// Data structure for service "Epgsearch-osdmessage-v1.0"
struct Epgsearch_osdmessage_v1_0
{
// in
    char* message;             // the message to display
    eMessageType type;
};

// Data structure for service "Epgsearch-searchmenu-v1.0"
struct Epgsearch_searchmenu_v1_0
{
// in
// out
    cOsdMenu* pSearchMenu;   // pointer to the search menu
};

// Data structure for service "Epgsearch-conflictmenu-v1.0"
struct Epgsearch_conflictmenu_v1_0
{
// in
// out
    cOsdMenu* pConflictMenu;   // pointer to the conflict menu
};

// Data structure for service "Epgsearch-lastconflictinfo-v1.0"
struct Epgsearch_lastconflictinfo_v1_0
{
// in
// out
    time_t nextConflict;       // next conflict date, 0 if none
    int relevantConflicts;     // number of relevant conflicts
    int totalConflicts;        // total number of conflicts
};

// Data structure for service "Epgsearch-searchresults-v1.0"
struct Epgsearch_searchresults_v1_0
{
// in
    char* query;               // search term
    int mode;                  // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
    int channelNr;             // channel number to search in (0=any)
    bool useTitle;             // search in title
    bool useSubTitle;          // search in subtitle
    bool useDescription;       // search in description
// out

    class cServiceSearchResult : public cListObject 
	{
	public:
	    const cEvent* event;
	    cServiceSearchResult(const cEvent* Event) : event(Event) {}
	};

    cList<cServiceSearchResult>* pResultList;   // pointer to the results
};

// Data structure for service "Epgsearch-switchtimer-v1.0"
struct Epgsearch_switchtimer_v1_0
{
// in
    	const cEvent* event;
	int mode;                  // mode (0=query existance, 1=add/modify, 2=delete)
// in/out
    	int switchMinsBefore;
    	int announceOnly;
// out   		
    	bool success;              // result
};

// Data structure for service "Epgsearch-quicksearch-v1.0"
struct Epgsearch_quicksearch_v1_0
{
// in
// out
    cOsdMenu* pSearchMenu;   // pointer to the search menu
};

// Data structures for service "Epgsearch-services-v1.0"
class cServiceHandler
{
 public:
    virtual std::list<std::string> SearchTimerList() = 0;
    // returns a list of search timer entries in the same format as used in epgsearch.conf 
    virtual int AddSearchTimer(const std::string&) = 0;
    // adds a new search timer and returns its ID (-1 on error)
    virtual bool ModSearchTimer(const std::string&) = 0;
    // edits an existing search timer and returns success
    virtual bool DelSearchTimer(int) = 0;
    // deletes search timer with given ID and returns success
    virtual std::list<std::string> QuerySearchTimer(int) = 0;
    // returns the search result of the searchtimer with given ID in the same format as used in SVDRP command 'QRYS' (->MANUAL)    
    virtual ~cServiceHandler() {}
};

struct Epgsearch_services_v1_0
{
// in/out
    std::auto_ptr<cServiceHandler> handler;
};
#endif