summaryrefslogtreecommitdiff
path: root/recmenus.h
blob: b51410657136ad17bc9e10aff104a8b6042d53f4 (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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
#ifndef __TVGUIDE_RECMENUS_H
#define __TVGUIDE_RECMENUS_H

#define TEXTINPUTLENGTH 256

#include "services/epgsearch.h"
#include "recmenu.h"
#include "recmanager.h"
#include "timerconflict.h"
#include "switchtimer.h"

// --- cRecMenuMain  ---------------------------------------------------------
class cRecMenuMain : public cRecMenu {
private:
    int intcallback;
    bool boolcallback;
    int stringselectcallback;
    char searchString[TEXTINPUTLENGTH];
    int timecallback;
    time_t daycallback;
public:
    cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive);
    virtual ~cRecMenuMain(void) {};
};

/******************************************************************************************
*   Instant Timer Menus
******************************************************************************************/

// --- cRecMenuConfirmTimer  ---------------------------------------------------------
class cRecMenuConfirmTimer: public cRecMenu {
public:
    cRecMenuConfirmTimer(const cEvent *event);
    virtual ~cRecMenuConfirmTimer(void) {};
};

// --- cRecMenuAskFolder  ---------------------------------------------------------
class cRecMenuAskFolder: public cRecMenu {
private:
    vector<string> folders;
    eRecMenuState nextAction;
public:
    cRecMenuAskFolder(const cEvent *event, eRecMenuState nextAction);
    virtual ~cRecMenuAskFolder(void) {};
    string GetFolder(void);
};

// --- cRecMenuConfirmDeleteTimer  ---------------------------------------------------------
class cRecMenuConfirmDeleteTimer: public cRecMenu {
public:
    cRecMenuConfirmDeleteTimer(const cEvent *event);
    virtual ~cRecMenuConfirmDeleteTimer(void) {};
};

// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
class cRecMenuAskDeleteTimer: public cRecMenu {
public:
    cRecMenuAskDeleteTimer(const cEvent *event);
    virtual ~cRecMenuAskDeleteTimer(void) {};
};

// --- cRecMenuTimerConflicts  ---------------------------------------------------------
class cRecMenuTimerConflicts: public cRecMenu {
public:
    cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts);    
    virtual ~cRecMenuTimerConflicts(void) {};
    int GetTimerConflict(void);
};

// --- cRecMenuTimerConflict  ---------------------------------------------------------
class cRecMenuTimerConflict: public cRecMenu {
private:
    cTVGuideTimerConflict *conflict;
public:
    cRecMenuTimerConflict(cTVGuideTimerConflict *conflict);
    virtual ~cRecMenuTimerConflict(void) {};
    int GetTimerConflictIndex(void);
};

// --- cRecMenuNoTimerConflict ---------------------------------------------------------
class cRecMenuNoTimerConflict: public cRecMenu {
public:
    cRecMenuNoTimerConflict(void);   
    virtual ~cRecMenuNoTimerConflict(void) {};
};

// --- cRecMenuRerunResults  ---------------------------------------------------------
class cRecMenuRerunResults: public cRecMenu {
private:
    const cEvent **reruns;
    int numReruns;
public:
    cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns);
    int GetTotalNumMenuItems(void);
    virtual ~cRecMenuRerunResults(void) {
        delete[] reruns;
    };
    const cEvent *GetEvent(void);
};

// --- cRecMenuNoRerunsFound  ---------------------------------------------------------
class cRecMenuNoRerunsFound: public cRecMenu {
public:
    cRecMenuNoRerunsFound(string searchString);
    virtual ~cRecMenuNoRerunsFound(void) {};
};

// --- cRecMenuConfirmRerunUsed  ---------------------------------------------------------
class cRecMenuConfirmRerunUsed: public cRecMenu {
public:
    cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace);
    virtual ~cRecMenuConfirmRerunUsed(void) {};
};

// --- cRecMenuEditTimer  ---------------------------------------------------------
class cRecMenuEditTimer: public cRecMenu {
private:
    const cTimer *originalTimer;
    bool timerActive;
    time_t day;
    int start;
    int stop;
    int prio;
    int lifetime;
    char folder[TEXTINPUTLENGTH];
public:
    cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState);
    virtual ~cRecMenuEditTimer(void) {};
    cTimer *GetTimer(void);
    const cTimer *GetOriginalTimer(void);
};

/******************************************************************************************
*   Series Timer Menus
******************************************************************************************/

// --- cRecMenuSeriesTimer ---------------------------------------------------------
class cRecMenuSeriesTimer: public cRecMenu {
    string folder;
    bool timerActive;
    int channel;
    time_t tstart;
    int start;
    int stop;
    int dayOfWeek;
    int priority;
    int lifetime;
    void CalculateTimes(const cEvent *event);
public:
    cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, string folder);
    virtual ~cRecMenuSeriesTimer(void) {};
    cTimer *GetTimer(void);
};

// --- cRecMenuConfirmSeriesTimer  ---------------------------------------------------------
class cRecMenuConfirmSeriesTimer: public cRecMenu {
public:
    cRecMenuConfirmSeriesTimer(cTimer *seriesTimer);    
    virtual ~cRecMenuConfirmSeriesTimer(void) {};
};

/******************************************************************************************
*   SearchTimer Menus
******************************************************************************************/

// --- cRecMenuSearchTimer  ---------------------------------------------------------
class cRecMenuSearchTimer: public cRecMenu {
private:
    char searchString[TEXTINPUTLENGTH];
public:
    cRecMenuSearchTimer(const cEvent *event);
    virtual ~cRecMenuSearchTimer(void) {};
    string GetSearchString(void) { return searchString; };
};

// --- cRecMenuSearchTimerTemplates  ---------------------------------------------------------
class cRecMenuSearchTimerTemplates: public cRecMenu {
private:
    int numTemplates;
    cTVGuideSearchTimer searchTimer;
    vector<TVGuideEPGSearchTemplate> templates;
public:
    cRecMenuSearchTimerTemplates(cTVGuideSearchTimer searchTimer, vector<TVGuideEPGSearchTemplate> templates);
    virtual ~cRecMenuSearchTimerTemplates(void) {};
    cTVGuideSearchTimer GetSearchTimer(void) { return searchTimer; };
    TVGuideEPGSearchTemplate GetTemplate(void);
};

// --- cRecMenuSearchTimers  ---------------------------------------------------------
class cRecMenuSearchTimers: public cRecMenu {
private:
    int numSearchTimers;
    vector<cTVGuideSearchTimer> searchTimers;
    void SetMenuItems(void);
public:
    cRecMenuSearchTimers(vector<cTVGuideSearchTimer> searchTimers);
    virtual ~cRecMenuSearchTimers(void) {};
    cTVGuideSearchTimer GetSearchTimer(void);
};

// --- cRecMenuSearchTimerEdit  ---------------------------------------------------------
class cRecMenuSearchTimerEdit: public cRecMenu {
private:
    bool advancedOptions;
    cTVGuideSearchTimer searchTimer;
    char searchString[TEXTINPUTLENGTH];
    bool timerActive;
    int mode;
    bool useTitle;
    bool useSubtitle;
    bool useDescription;
    bool useChannel;
    int startChannel;
    int stopChannel;
    bool useTime;
    int startTime;
    int stopTime;
    bool useDayOfWeek;
    int dayOfWeek;
    int priority;
    int lifetime;
    bool useEpisode;
    char directory[TEXTINPUTLENGTH];
    int marginStart;
    int marginStop;
    bool useVPS;
    bool avoidRepeats;
    int allowedRepeats;
    bool compareTitle;
    bool compareSubtitle;
    bool compareSummary;
    bool useInFavorites;
    void CreateMenuItems(void);
public:
    cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions);
    virtual ~cRecMenuSearchTimerEdit(void) {};
    cTVGuideSearchTimer GetSearchTimer(void);
};

// --- cRecMenuSearchTimerDeleteConfirm ---------------------------------------------
class cRecMenuSearchTimerDeleteConfirm: public cRecMenu {
private:
    cTVGuideSearchTimer searchTimer;
public:
    cRecMenuSearchTimerDeleteConfirm(cTVGuideSearchTimer searchTimer);
    virtual ~cRecMenuSearchTimerDeleteConfirm(void) {};
    cTVGuideSearchTimer GetSearchTimer(void);
};

// --- cRecMenuSearchTimerCreateConfirm  ---------------------------------------------------------
class cRecMenuSearchTimerCreateConfirm: public cRecMenu {
private:
public:
    cRecMenuSearchTimerCreateConfirm(bool success);
    virtual ~cRecMenuSearchTimerCreateConfirm(void) {};
};

// --- cRecMenuSearchTimerTemplatesCreate  ---------------------------------------------------------
class cRecMenuSearchTimerTemplatesCreate: public cRecMenu {
private:
    TVGuideEPGSearchTemplate templ;
    cTVGuideSearchTimer searchTimer;
public:
    cRecMenuSearchTimerTemplatesCreate(TVGuideEPGSearchTemplate templ, cTVGuideSearchTimer searchTimer);
    virtual ~cRecMenuSearchTimerTemplatesCreate(void) {};
    cTVGuideSearchTimer GetSearchTimer(void) { return searchTimer; };
    TVGuideEPGSearchTemplate GetTemplate(void) { return templ; };
};

// --- cRecMenuSearchTimerResults ---------------------------------------------------------
class cRecMenuSearchTimerResults: public cRecMenu {
private:
    const cEvent **searchResults;
    int numResults;
    eRecMenuState action2;
public:
    cRecMenuSearchTimerResults(string searchString, const cEvent **searchResults, int numResults, string templateName = "", eRecMenuState action2 = rmsDisabled);
    virtual ~cRecMenuSearchTimerResults(void) {
        delete[] searchResults;
    };
    const cEvent *GetEvent(void);
};

// --- cRecMenuSearchTimerNothingFound  ---------------------------------------------------------
class cRecMenuSearchTimerNothingFound: public cRecMenu {
public:
    cRecMenuSearchTimerNothingFound(string searchString);
    virtual ~cRecMenuSearchTimerNothingFound(void) {};
};

/******************************************************************************************
*   SwitchTimer Menus
******************************************************************************************/

// --- cRecMenuSwitchTimer  ---------------------------------------------------------
class cRecMenuSwitchTimer: public cRecMenu {
private:
    int switchMinsBefore;
    int announceOnly;
public:
    cRecMenuSwitchTimer(void);
    virtual ~cRecMenuSwitchTimer(void) {};
    cSwitchTimer GetSwitchTimer(void);
};

// --- cRecMenuSwitchTimerConfirm  ---------------------------------------------------------
class cRecMenuSwitchTimerConfirm: public cRecMenu {
private:
public:
    cRecMenuSwitchTimerConfirm(bool success);
    virtual ~cRecMenuSwitchTimerConfirm(void) {};
};

// --- cRecMenuSwitchTimerDelete  ---------------------------------------------------------
class cRecMenuSwitchTimerDelete: public cRecMenu {
private:
public:
    cRecMenuSwitchTimerDelete(void);
    virtual ~cRecMenuSwitchTimerDelete(void) {};
};

/******************************************************************************************
*   Search Menus
******************************************************************************************/

// --- cRecMenuSearch  ---------------------------------------------------------
class cRecMenuSearch: public cRecMenu {
private:
    char searchString[TEXTINPUTLENGTH];
    int mode;
    int channelNr;
    bool useTitle;
    bool useSubTitle;
    bool useDescription;
public:
    cRecMenuSearch(string searchString, bool withOptions);
    virtual ~cRecMenuSearch(void) {};
    string GetSearchString(void) { return searchString; };
    Epgsearch_searchresults_v1_0 GetEPGSearchStruct(void);
};

// --- cRecMenuSearchResults  ---------------------------------------------------------
class cRecMenuSearchResults: public cRecMenu {
private:
    string searchString;
    const cEvent **searchResults;
    int numResults;
public:
    cRecMenuSearchResults(string searchString, const cEvent **searchResults, int numResults);
    virtual ~cRecMenuSearchResults(void) {
        delete[] searchResults;
    };
    string GetSearchString(void) { return searchString; };
    const cEvent *GetEvent(void);
};

// --- cRecMenuSearchNothingFound  ---------------------------------------------------------
class cRecMenuSearchNothingFound: public cRecMenu {
public:
    cRecMenuSearchNothingFound(string searchString, bool tooShort = false);
    virtual ~cRecMenuSearchNothingFound(void) {};
};

// --- cRecMenuSearchConfirmTimer  ---------------------------------------------------------
class cRecMenuSearchConfirmTimer: public cRecMenu {
public:
    cRecMenuSearchConfirmTimer(const cEvent *event);
    virtual ~cRecMenuSearchConfirmTimer(void) {};
};

/******************************************************************************************
*   Timeline
******************************************************************************************/

// --- cRecMenuTimeline  ---------------------------------------------------------
class cRecMenuTimeline: public cRecMenu {
private:
    vector<const cTimer*> timersToday;
    int numTimersToday;
    time_t today;
    time_t timeStart;
    time_t timeStop;
    cRecMenuItemTimelineHeader *timelineHeader;
    cRecMenuItem *timelineFooter;
    void SetStartStop(void);
    void GetTimersForDay(void);
    void SetTimers(void);
    void PrevDay(void);
    void NextDay(void);
    void ClearMenu(void);
public:
    cRecMenuTimeline(void);
    virtual ~cRecMenuTimeline(void) {};
    eRecMenuState ProcessKey(eKeys Key);
    void SetHeaderTimer(void);
    const cTimer *GetTimer(void);
};

/******************************************************************************************
*   Recording Search Menus
******************************************************************************************/

// --- cRecMenuRecordingSearch  ---------------------------------------------------------
class cRecMenuRecordingSearch: public cRecMenu {
private:
    char searchString[TEXTINPUTLENGTH];
public:
    cRecMenuRecordingSearch(string search);
    virtual ~cRecMenuRecordingSearch(void) {};
    string GetSearchString(void) { return searchString; };
};

// --- cRecMenuRecordingSearchResults  ---------------------------------------------------------
class cRecMenuRecordingSearchResults: public cRecMenu {
private:
    string searchString;
    const cRecording **searchResults;
    int numResults;
public:
    cRecMenuRecordingSearchResults(string searchString, const cRecording **searchResults, int numResults);
    virtual ~cRecMenuRecordingSearchResults(void) {
        delete[] searchResults;
    };
    string GetSearchString(void) { return searchString; };
};

// --- cRecMenuRecordingSearchNotFound  ---------------------------------------------------------
class cRecMenuRecordingSearchNotFound: public cRecMenu {
public:
    cRecMenuRecordingSearchNotFound(string searchString);
    virtual ~cRecMenuRecordingSearchNotFound(void) {};
};

/******************************************************************************************
*   Favorites
******************************************************************************************/

// --- cRecMenuFavorites  ---------------------------------------------------------
class cRecMenuFavorites: public cRecMenu {
private:
    vector<cTVGuideSearchTimer> favorites;
    int numFavorites;
    void CreateFavoritesMenuItems(void);
    string NiceTime(int favTime);
public:
    cRecMenuFavorites(vector<cTVGuideSearchTimer> favorites);
    virtual ~cRecMenuFavorites(void) {};
    cTVGuideSearchTimer GetFavorite(void);
};

#endif //__TVGUIDE_RECMENUS_H