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  enum Type {
17  Pending = -15,
18  Failing = -14,
19  //OtherRecording = -13, (obsolete)
20  //OtherTuning = -12, (obsolete)
21  MissedFuture = -11,
22  Tuning = -10,
23  Failed = -9,
24  TunerBusy = -8,
25  LowDiskSpace = -7,
26  Cancelled = -6,
27  Missed = -5,
28  Aborted = -4,
29  Recorded = -3,
30  Recording = -2,
31  WillRecord = -1,
32  Unknown = 0,
33  DontRecord = 1,
34  PreviousRecording = 2,
35  CurrentRecording = 3,
36  EarlierShowing = 4,
37  TooManyRecordings = 5,
38  NotListed = 6,
39  Conflict = 7,
40  LaterShowing = 8,
41  Repeat = 9,
42  Inactive = 10,
43  NeverRecord = 11,
44  Offline = 12
45  //OtherShowing = 13 (obsolete)
46  }; // note stored in int8_t in ProgramInfo
47  Q_ENUM(Type)
48 
49  static QString toUIState(Type);
50  static QString toString(Type, uint id);
51  static QString toString(Type, const QString &name);
52  static QString toString(Type, RecordingType type = kNotRecording);
53  static QString toDescription(Type, RecordingType,
54  const QDateTime &recstartts);
55  public:
56 
57  static inline void InitializeCustomTypes();
58 
59  Q_INVOKABLE explicit RecStatus(QObject *parent = nullptr) : QObject(parent) {}
60 
61  private:
62  Q_DISABLE_COPY(RecStatus)
63 };
64 
66 {
67  qRegisterMetaType< RecStatus* >();
68 }
69 
70 #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
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
Q_INVOKABLE RecStatus(QObject *parent=nullptr)
Definition: recStatus.h:59
unsigned int uint
Definition: compat.h:140
static void InitializeCustomTypes()
Definition: recStatus.h:65