MythTV  master
progfind.h
Go to the documentation of this file.
1 #ifndef PROGFIND_H_
2 #define PROGFIND_H_
3 
4 // Qt
5 #include <QDateTime>
6 #include <QEvent>
7 
8 // MythTV
9 #include "mythscreentype.h"
10 #include "programinfo.h"
11 #include "mythdialogbox.h"
12 #include "playercontext.h"
13 
14 // mythfrontend
15 #include "schedulecommon.h"
16 
17 class TV;
18 class MythUIText;
19 class MythUIButtonList;
20 
21 void RunProgramFinder(TV *player = nullptr, bool embedVideo = false, bool allowEPG = true);
22 
23 class ProgFinder : public ScheduleCommon
24 {
25  Q_OBJECT
26  public:
27  explicit ProgFinder(MythScreenStack *parentStack, bool allowEPG = true,
28  TV *player = nullptr, bool embedVideo = false);
29  ~ProgFinder() override;
30 
31  bool Create(void) override; // MythScreenType
32  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
33 
34  private slots:
36  void showListTakeFocus(void);
37  void timesListTakeFocus(void);
38  void timesListLosingFocus(void);
39 
40  void ShowGuide() const override; // ScheduleCommon
41  void select();
42 
43  void customEvent(QEvent *e) override; // ScheduleCommon
44  void updateInfo(void);
45 
46  protected:
47  using ShowName = QMap<QString,QString>;
48 
49  void Init(void) override; // MythScreenType
50 
51  virtual void initAlphabetList(void);
52  virtual bool formatSelectedData(QString &data);
53  virtual bool formatSelectedData(QString &data, int charNum);
54  virtual void restoreSelectedData(QString &data);
55  virtual void whereClauseGetSearchData(QString &where, MSqlBindings &bindings);
56  ProgramInfo *GetCurrentProgram(void) const override; // ScheduleCommon
57 
58  void ShowMenu(void) override; // MythScreenType
59  void getShowNames(void);
60  void updateShowList();
61  void updateTimesList();
62  void selectShowData(QString progTitle, int newCurShow);
63 
65 
66  QString m_searchStr;
67  QString m_currentLetter;
68 
69  TV *m_player {nullptr};
70  bool m_embedVideo {false};
71  bool m_allowEPG {true};
72  bool m_allowKeypress {true};
73 
76 
78 
82 
84  MythUIText *m_help1Text {nullptr};
85  MythUIText *m_help2Text {nullptr};
86 };
87 
88 class JaProgFinder : public ProgFinder
89 {
90  public:
91  explicit JaProgFinder(MythScreenStack *parentStack, bool gg = false,
92  TV *player = nullptr, bool embedVideo = false)
93  : ProgFinder(parentStack, gg, player, embedVideo) {}
94 
95  protected:
96  void initAlphabetList() override; // ProgFinder
97  bool formatSelectedData(QString &data) override; // ProgFinder
98  bool formatSelectedData(QString &data, int charNum) override; // ProgFinder
99  void restoreSelectedData(QString &data) override; // ProgFinder
100  void whereClauseGetSearchData(QString &where, MSqlBindings &bindings) override; // ProgFinder
101 
102  private:
103  static const std::vector<QChar> kSearchChars;
104 };
105 
106 class HeProgFinder : public ProgFinder
107 {
108  public:
109  explicit HeProgFinder(MythScreenStack *parentStack, bool gg = false,
110  TV *player = nullptr, bool embedVideo = false)
111  : ProgFinder(parentStack, gg, player, embedVideo) {}
112 
113  protected:
114  void initAlphabetList() override; // ProgFinder
115  bool formatSelectedData(QString &data) override; // ProgFinder
116  bool formatSelectedData(QString &data, int charNum) override; // ProgFinder
117  void restoreSelectedData(QString &data) override; // ProgFinder
118  void whereClauseGetSearchData(QString &where, MSqlBindings &bindings) override; // ProgFinder
119 
120  private:
121  static const std::vector<QChar> kSearchChars;
122 };
124 class RuProgFinder : public ProgFinder
125 {
126  public:
127  explicit RuProgFinder(MythScreenStack *parentStack, bool gg = false,
128  TV *player = nullptr, bool embedVideo = false)
129  : ProgFinder(parentStack, gg, player, embedVideo) {}
130 
131  protected:
132  void initAlphabetList() override; // ProgFinder
133  bool formatSelectedData(QString &data) override; // ProgFinder
134  bool formatSelectedData(QString &data, int charNum) override; // ProgFinder
135  void restoreSelectedData(QString &data) override; // ProgFinder
136  void whereClauseGetSearchData(QString &where, MSqlBindings &bindings) override; // ProgFinder
137 
138  private:
139  static const std::vector<QChar> kSearchChars;
140 };
142 
144 {
145  Q_OBJECT
146 
147  public:
148  SearchInputDialog(MythScreenStack *parent, const QString &defaultValue)
149  : MythTextInputDialog(parent, "", FilterNone, false, defaultValue) {}
150 
151  bool Create(void) override; // MythTextInputDialog
152 
153  signals:
154  void valueChanged(QString);
155 
156  private slots:
157  void editChanged(void);
158 };
159 
160 #endif
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:98
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
ProgFinder::ShowGuide
void ShowGuide() const override
Definition: progfind.cpp:413
FilterNone
@ FilterNone
Definition: mythuitextedit.h:19
ProgFinder::m_help1Text
MythUIText * m_help1Text
Definition: progfind.h:84
false
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
HeProgFinder::restoreSelectedData
void restoreSelectedData(QString &data) override
Definition: progfind.cpp:902
ProgFinder::~ProgFinder
~ProgFinder() override
Definition: progfind.cpp:126
ProgFinder::alphabetListItemSelected
void alphabetListItemSelected(MythUIButtonListItem *item)
Definition: progfind.cpp:140
ProgFinder::m_schedList
ProgramList m_schedList
Definition: progfind.h:75
JaProgFinder::initAlphabetList
void initAlphabetList() override
Definition: progfind.cpp:728
ProgFinder::formatSelectedData
virtual bool formatSelectedData(QString &data)
Definition: progfind.cpp:617
RuProgFinder::kSearchChars
static const std::vector< QChar > kSearchChars
Definition: progfind.h:139
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:15
ProgFinder::m_searchStr
QString m_searchStr
Definition: progfind.h:66
schedulecommon.h
ProgFinder::updateShowList
void updateShowList()
Definition: progfind.cpp:502
ProgFinder::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: progfind.cpp:167
ProgFinder
Definition: progfind.h:23
ProgFinder::m_timesList
MythUIButtonList * m_timesList
Definition: progfind.h:81
ProgFinder::select
void select()
Definition: progfind.cpp:436
ProgFinder::m_player
TV * m_player
Definition: progfind.h:69
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
ProgFinder::m_alphabetList
MythUIButtonList * m_alphabetList
Definition: progfind.h:79
ProgFinder::ProgFinder
ProgFinder(MythScreenStack *parentStack, bool allowEPG=true, TV *player=nullptr, bool embedVideo=false)
Definition: progfind.cpp:55
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
JaProgFinder::JaProgFinder
JaProgFinder(MythScreenStack *parentStack, bool gg=false, TV *player=nullptr, bool embedVideo=false)
Definition: progfind.h:91
ProgFinder::timesListTakeFocus
void timesListTakeFocus(void)
Definition: progfind.cpp:161
ProgFinder::initAlphabetList
virtual void initAlphabetList(void)
Definition: progfind.cpp:542
programinfo.h
JaProgFinder::kSearchChars
static const std::vector< QChar > kSearchChars
Definition: progfind.h:103
ProgFinder::showListTakeFocus
void showListTakeFocus(void)
Definition: progfind.cpp:156
ProgFinder::m_allowEPG
bool m_allowEPG
Definition: progfind.h:71
ProgFinder::Create
bool Create(void) override
Definition: progfind.cpp:66
ProgFinder::updateTimesList
void updateTimesList()
Definition: progfind.cpp:446
HeProgFinder::formatSelectedData
bool formatSelectedData(QString &data) override
Definition: progfind.cpp:889
HeProgFinder::whereClauseGetSearchData
void whereClauseGetSearchData(QString &where, MSqlBindings &bindings) override
Definition: progfind.cpp:849
ProgFinder::m_help2Text
MythUIText * m_help2Text
Definition: progfind.h:85
ProgFinder::m_showNames
ShowName m_showNames
Definition: progfind.h:64
SearchInputDialog::SearchInputDialog
SearchInputDialog(MythScreenStack *parent, const QString &defaultValue)
Definition: progfind.h:148
ProgFinder::updateInfo
void updateInfo(void)
Definition: progfind.cpp:348
ProgFinder::m_infoMap
InfoMap m_infoMap
Definition: progfind.h:77
ScheduleCommon
Definition: schedulecommon.h:15
ProgFinder::m_showList
MythUIButtonList * m_showList
Definition: progfind.h:80
SearchInputDialog::editChanged
void editChanged(void)
Definition: progfind.cpp:1081
JaProgFinder::whereClauseGetSearchData
void whereClauseGetSearchData(QString &where, MSqlBindings &bindings) override
Definition: progfind.cpp:740
ProgFinder::Init
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: progfind.cpp:99
SearchInputDialog
Definition: progfind.h:143
ProgFinder::m_searchText
MythUIText * m_searchText
Definition: progfind.h:83
SearchInputDialog::valueChanged
void valueChanged(QString)
HeProgFinder::kSearchChars
static const std::vector< QChar > kSearchChars
Definition: progfind.h:121
ProgFinder::ShowName
QMap< QString, QString > ShowName
Definition: progfind.h:47
JaProgFinder::restoreSelectedData
void restoreSelectedData(QString &data) override
Definition: progfind.cpp:815
RuProgFinder::initAlphabetList
void initAlphabetList() override
Definition: progfind.cpp:942
ProgFinder::ShowMenu
void ShowMenu(void) override
Definition: progfind.cpp:224
AutoDeleteDeque< ProgramInfo * >
JaProgFinder::formatSelectedData
bool formatSelectedData(QString &data) override
Definition: progfind.cpp:802
ProgFinder::whereClauseGetSearchData
virtual void whereClauseGetSearchData(QString &where, MSqlBindings &bindings)
Definition: progfind.cpp:555
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
RuProgFinder::restoreSelectedData
void restoreSelectedData(QString &data) override
Definition: progfind.cpp:1033
ProgFinder::m_currentLetter
QString m_currentLetter
Definition: progfind.h:67
ProgFinder::timesListLosingFocus
void timesListLosingFocus(void)
Definition: progfind.cpp:151
playercontext.h
HeProgFinder
Definition: progfind.h:106
ProgFinder::selectShowData
void selectShowData(QString progTitle, int newCurShow)
Definition: progfind.cpp:520
RuProgFinder
Definition: progfind.h:124
ProgFinder::customEvent
void customEvent(QEvent *e) override
Definition: progfind.cpp:257
HeProgFinder::initAlphabetList
void initAlphabetList() override
Definition: progfind.cpp:839
RunProgramFinder
void RunProgramFinder(TV *player=nullptr, bool embedVideo=false, bool allowEPG=true)
Definition: progfind.cpp:35
HeProgFinder::HeProgFinder
HeProgFinder(MythScreenStack *parentStack, bool gg=false, TV *player=nullptr, bool embedVideo=false)
Definition: progfind.h:109
ProgFinder::GetCurrentProgram
ProgramInfo * GetCurrentProgram(void) const override
Definition: progfind.cpp:1038
RuProgFinder::RuProgFinder
RuProgFinder(MythScreenStack *parentStack, bool gg=false, TV *player=nullptr, bool embedVideo=false)
Definition: progfind.h:127
RuProgFinder::formatSelectedData
bool formatSelectedData(QString &data) override
Definition: progfind.cpp:1020
MythTextInputDialog
Dialog prompting the user to enter a text string.
Definition: mythdialogbox.h:313
SearchInputDialog::Create
bool Create(void) override
Definition: progfind.cpp:1046
ProgFinder::m_embedVideo
bool m_embedVideo
Definition: progfind.h:70
ProgFinder::m_showData
ProgramList m_showData
Definition: progfind.h:74
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:151
JaProgFinder
Definition: progfind.h:88
RuProgFinder::whereClauseGetSearchData
void whereClauseGetSearchData(QString &where, MSqlBindings &bindings) override
Definition: progfind.cpp:952
ProgFinder::m_allowKeypress
bool m_allowKeypress
Definition: progfind.h:72
ProgFinder::getShowNames
void getShowNames(void)
Definition: progfind.cpp:474
mythscreentype.h
ProgFinder::restoreSelectedData
virtual void restoreSelectedData(QString &data)
Definition: progfind.cpp:706
TV
Control TV playback.
Definition: tv_play.h:152