00001 #ifndef IMPORTNATIVE_H_ 00002 #define IMPORTNATIVE_H_ 00003 00004 #include <iostream> 00005 #include <stdint.h> 00006 00007 // qt 00008 #include <QString> 00009 #include <QStringList> 00010 #include <QKeyEvent> 00011 #include <QList> 00012 #include <QDateTime> 00013 00014 // myth 00015 #include <mythscreentype.h> 00016 00017 // mytharchive 00018 #include "fileselector.h" 00019 00020 typedef struct 00021 { 00022 bool directory; 00023 bool selected; 00024 QString filename; 00025 int64_t size; 00026 } FileInfo; 00027 00028 typedef struct 00029 { 00030 QString title; 00031 QString subtitle; 00032 QDateTime startTime; 00033 QString description; 00034 QString chanID; 00035 QString chanNo; 00036 QString chanName; 00037 QString callsign; 00038 } FileDetails; 00039 00040 00041 class MythUIText; 00042 class MythUIButton; 00043 class MythUIButtonList; 00044 class MythUIButtonListItem; 00045 00046 class ArchiveFileSelector : public FileSelector 00047 { 00048 Q_OBJECT 00049 00050 public: 00051 ArchiveFileSelector(MythScreenStack *parent); 00052 ~ArchiveFileSelector(void); 00053 00054 bool Create(void); 00055 00056 private slots: 00057 void nextPressed(void); 00058 void prevPressed(void); 00059 void cancelPressed(void); 00060 void itemSelected(MythUIButtonListItem *item); 00061 00062 private: 00063 FileDetails m_details; 00064 QString m_xmlFile; 00065 00066 MythUIButton *m_nextButton; 00067 MythUIButton *m_prevButton; 00068 MythUIText *m_progTitle; 00069 MythUIText *m_progSubtitle; 00070 MythUIText *m_progStartTime; 00071 }; 00072 00073 class ImportNative : public MythScreenType 00074 { 00075 Q_OBJECT 00076 00077 public: 00078 ImportNative(MythScreenStack *parent, MythScreenType *m_previousScreen, 00079 const QString &xmlFile, FileDetails details); 00080 ~ImportNative(); 00081 00082 bool Create(void); 00083 bool keyPressEvent(QKeyEvent *e); 00084 00085 private slots: 00086 void finishedPressed(); 00087 void prevPressed(); 00088 void cancelPressed(); 00089 void searchChanID(void); 00090 void searchChanNo(void); 00091 void searchName(void); 00092 void searchCallsign(void); 00093 void gotChanID(QString value); 00094 void gotChanNo(QString value); 00095 void gotName(QString value); 00096 void gotCallsign(QString value); 00097 00098 private: 00099 void findChannelMatch(const QString &chanid, const QString &chanNo, 00100 const QString &name, const QString &callsign); 00101 void fillSearchList(const QString &field); 00102 void showList(const QString &caption, QString &value, const char *slot); 00103 00104 QString m_xmlFile; 00105 FileDetails m_details; 00106 MythScreenType *m_previousScreen; 00107 00108 QStringList m_searchList; 00109 00110 MythUIText *m_progTitle_text; 00111 MythUIText *m_progDateTime_text; 00112 MythUIText *m_progDescription_text; 00113 00114 MythUIText *m_chanID_text; 00115 MythUIText *m_chanNo_text; 00116 MythUIText *m_chanName_text; 00117 MythUIText *m_callsign_text; 00118 00119 MythUIText *m_localChanID_text; 00120 MythUIText *m_localChanNo_text; 00121 MythUIText *m_localChanName_text; 00122 MythUIText *m_localCallsign_text; 00123 00124 MythUIButton *m_searchChanID_button; 00125 MythUIButton *m_searchChanNo_button; 00126 MythUIButton *m_searchChanName_button; 00127 MythUIButton *m_searchCallsign_button; 00128 00129 MythUIButton *m_finishButton; 00130 MythUIButton *m_prevButton; 00131 MythUIButton *m_cancelButton; 00132 00133 bool m_isValidXMLSelected; 00134 }; 00135 00136 #endif
1.6.3