00001 #ifndef PROGFIND_H_
00002 #define PROGFIND_H_
00003
00004
00005 #include <QDateTime>
00006 #include <QEvent>
00007
00008
00009 #include "mythscreentype.h"
00010 #include "programinfo.h"
00011 #include "mythdialogbox.h"
00012 #include "playercontext.h"
00013
00014
00015 #include "schedulecommon.h"
00016
00017 class TV;
00018 class MythUIText;
00019 class MythUIButtonList;
00020
00021 void RunProgramFinder(TV *player = NULL, bool embedVideo = false, bool allowEPG = true);
00022
00023 class ProgFinder : public ScheduleCommon
00024 {
00025 Q_OBJECT
00026 public:
00027 explicit ProgFinder(MythScreenStack *parentStack, bool allowEPG = true,
00028 TV *player = NULL, bool embedVideo = false);
00029 virtual ~ProgFinder();
00030
00031 bool Create(void);
00032 bool keyPressEvent(QKeyEvent *event);
00033
00034 private slots:
00035 void alphabetListItemSelected(MythUIButtonListItem *item);
00036 void showListTakeFocus(void);
00037 void timesListTakeFocus(void);
00038 void timesListLosingFocus(void);
00039
00040 void showGuide();
00041 void select();
00042 void customEdit();
00043 void upcoming();
00044 void details();
00045 void quickRecord();
00046
00047 void customEvent(QEvent *e);
00048 void updateInfo(void);
00049 void getInfo(bool toggle = false);
00050 void edit(void);
00051
00052 protected:
00053 typedef QMap<QString,QString> ShowName;
00054
00055 virtual void Init(void);
00056
00057 virtual void initAlphabetList(void);
00058 virtual bool formatSelectedData(QString &data);
00059 virtual bool formatSelectedData(QString &data, int charNum);
00060 virtual void restoreSelectedData(QString &data);
00061 virtual void whereClauseGetSearchData(QString &where, MSqlBindings &bindings);
00062
00063 void ShowMenu(void);
00064 void getShowNames(void);
00065 void updateShowList();
00066 void updateTimesList();
00067 void selectShowData(QString, int);
00068
00069 ShowName m_showNames;
00070
00071 QString m_searchStr;
00072 QString m_currentLetter;
00073
00074 TV *m_player;
00075 bool m_embedVideo;
00076 bool m_allowEPG;
00077 bool m_allowKeypress;
00078
00079 ProgramList m_showData;
00080 ProgramList m_schedList;
00081
00082 InfoMap m_infoMap;
00083
00084 MythUIButtonList *m_alphabetList;
00085 MythUIButtonList *m_showList;
00086 MythUIButtonList *m_timesList;
00087
00088 MythUIText *m_searchText;
00089 MythUIText *m_help1Text;
00090 MythUIText *m_help2Text;
00091 };
00092
00093 class JaProgFinder : public ProgFinder
00094 {
00095 public:
00096 explicit JaProgFinder(MythScreenStack *parentStack, bool gg = false,
00097 TV *player = NULL, bool embedVideo = false);
00098
00099 protected:
00100 virtual void initAlphabetList();
00101 virtual bool formatSelectedData(QString &data);
00102 virtual bool formatSelectedData(QString &data, int charNum);
00103 virtual void restoreSelectedData(QString &data);
00104 virtual void whereClauseGetSearchData(QString &where, MSqlBindings &bindings);
00105
00106 private:
00107 static const char* searchChars[];
00108 int numberOfSearchChars;
00109 };
00110
00111 class HeProgFinder : public ProgFinder
00112 {
00113 public:
00114 explicit HeProgFinder(MythScreenStack *parentStack, bool gg = false,
00115 TV *player = NULL, bool embedVideo = false);
00116
00117 protected:
00118 virtual void initAlphabetList();
00119 virtual bool formatSelectedData(QString &data);
00120 virtual bool formatSelectedData(QString &data, int charNum);
00121 virtual void restoreSelectedData(QString &data);
00122 virtual void whereClauseGetSearchData(QString &where, MSqlBindings &bindings);
00123
00124 private:
00125 static const char* searchChars[];
00126 int numberOfSearchChars;
00127 };
00129 class RuProgFinder : public ProgFinder
00130 {
00131 public:
00132 explicit RuProgFinder(MythScreenStack *parentStack, bool gg = false,
00133 TV *player = NULL, bool embedVideo = false);
00134
00135 protected:
00136 virtual void initAlphabetList();
00137 virtual bool formatSelectedData(QString &data);
00138 virtual bool formatSelectedData(QString &data, int charNum);
00139 virtual void restoreSelectedData(QString &data);
00140 virtual void whereClauseGetSearchData(QString &where, MSqlBindings &bindings);
00141
00142 private:
00143 static const char* searchChars[];
00144 int numberOfSearchChars;
00145 };
00147
00148 class SearchInputDialog : public MythTextInputDialog
00149 {
00150 Q_OBJECT
00151
00152 public:
00153 SearchInputDialog(MythScreenStack *parent, const QString &defaultValue);
00154
00155 bool Create(void);
00156
00157 signals:
00158 void valueChanged(QString);
00159
00160 private slots:
00161 void editChanged(void);
00162 };
00163
00164 #endif