MythTV  master
recStatus.h
Go to the documentation of this file.
1 #ifndef RECSTATUS_H_
2 #define RECSTATUS_H_
3 
4 #include <QtCore>
5 #include <QString>
6 #include <QDateTime>
7 
8 #include "serviceexp.h"
9 #include "programtypes.h"
10 
11 class SERVICE_PUBLIC RecStatus : public QObject
12 {
13  Q_OBJECT
14 
15  public:
16  Q_ENUMS(Type)
17 
18  enum Type {
19  Pending = -15,
20  Failing = -14,
21  //OtherRecording = -13, (obsolete)
22  //OtherTuning = -12, (obsolete)
23  MissedFuture = -11,
24  Tuning = -10,
25  Failed = -9,
26  TunerBusy = -8,
27  LowDiskSpace = -7,
28  Cancelled = -6,
29  Missed = -5,
30  Aborted = -4,
31  Recorded = -3,
32  Recording = -2,
33  WillRecord = -1,
34  Unknown = 0,
35  DontRecord = 1,
36  PreviousRecording = 2,
37  CurrentRecording = 3,
38  EarlierShowing = 4,
39  TooManyRecordings = 5,
40  NotListed = 6,
41  Conflict = 7,
42  LaterShowing = 8,
43  Repeat = 9,
44  Inactive = 10,
45  NeverRecord = 11,
46  Offline = 12
47  //OtherShowing = 13 (obsolete)
48  }; // note stored in int8_t in ProgramInfo
49 
50  static QString toUIState(Type);
51  static QString toString(Type, uint id);
52  static QString toString(Type, const QString &name);
53  static QString toString(Type, RecordingType type = kNotRecording);
54  static QString toDescription(Type, RecordingType,
55  const QDateTime &recstartts);
56  public:
57 
58  static inline void InitializeCustomTypes();
59 
60  Q_INVOKABLE explicit RecStatus(QObject *parent = nullptr) : QObject(parent) {}
61 
62  private:
63  Q_DISABLE_COPY(RecStatus)
64 };
65 
67 {
68  qRegisterMetaType< RecStatus* >();
69 }
70 
71 #endif
QString toDescription(RecordingType rectype)
Converts "rectype" into a human readable description.
QString toString(MarkTypes type)
static bool Recording(const RecordingInfo *p)
Definition: scheduler.cpp:221
unsigned int uint
Definition: compat.h:140
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
Q_INVOKABLE RecStatus(QObject *parent=nullptr)
Definition: recStatus.h:60
const char * name
Definition: ParseText.cpp:328
static void InitializeCustomTypes()
Definition: recStatus.h:66