MythTV  master
netsearch.h
Go to the documentation of this file.
1 #ifndef NETSEARCH_H
2 #define NETSEARCH_H
3 
4 #include "netbase.h"
5 
6 // libmythui
7 #include <mythuibutton.h>
8 #include <mythuibuttonlist.h>
9 #include <mythuitextedit.h>
10 #include <mythuiprogressbar.h>
11 #include <mythprogressdialog.h>
12 #include <mythuistatetype.h>
13 #include <mythscreentype.h>
14 #include <mythdialogbox.h>
15 #include <netgrabbermanager.h>
16 #include <mythrssmanager.h>
17 #include <mythdownloadmanager.h>
18 
19 class NetSearch : public NetBase
20 {
21  Q_OBJECT
22 
23  public:
24 
25  NetSearch(MythScreenStack *parent, const char *name = nullptr);
26  ~NetSearch();
27 
28  bool Create(void) override; // MythScreenType
29  bool keyPressEvent(QKeyEvent *) override; // MythScreenType
30 
32 
33  protected:
34  ResultItem *GetStreamItem() override; // NetBase
35 
36  private:
37  void Load() override; // MythScreenType
38 
42 
43  MythUIText *m_pageText {nullptr};
44  MythUIText *m_noSites {nullptr};
45 
48 
49  QNetworkAccessManager *m_netSearch {nullptr};
50  QNetworkReply *m_reply {nullptr};
51 
52  QString m_currentSearch;
54  QString m_currentCmd;
57  QString m_mythXML;
58 
60 
61  QString m_nextPageToken;
62  QString m_prevPageToken;
63 
64  private slots:
65  void ShowMenu(void) override; // MythScreenType
66  void GetMoreResults();
67  void GetLastResults();
68  void SkipPagesBack();
69  void SkipPagesForward();
70  void RunSearchEditor();
71  void DoListRefresh();
72 
73  void DoSearch(void);
74  void SearchFinished(void);
75  void SearchTimeout(Search *item);
76  void LoadData(void) override; // NetBase
77  void FillGrabberButtonList(void);
78  void SlotItemChanged(void);
81  void customEvent(QEvent *levent) override; // NetBase
82 };
83 
84 #endif
MythConfirmationDialog * m_okPopup
Definition: netsearch.h:47
unsigned int slots[4]
Definition: element.c:38
uint m_maxpage
Definition: netsearch.h:56
MythUIText * m_noSites
Definition: netsearch.h:44
void DoSearch(void)
Definition: netsearch.cpp:257
Dialog asking for user confirmation.
void SetTextAndThumbnail(MythUIButtonListItem *btn, ResultItem *item)
Definition: netsearch.cpp:517
void SearchTimeout(Search *item)
Definition: netsearch.cpp:397
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
int m_currentGrabber
Definition: netsearch.h:53
QNetworkReply * m_reply
Definition: netsearch.h:50
void ShowMenu(void) override
Definition: netsearch.cpp:169
MythUIText * m_pageText
Definition: netsearch.h:43
QList< RSSSite * > rssList
unsigned int uint
Definition: compat.h:140
MythUITextEdit * m_search
Definition: netsearch.h:41
void SearchFinished(void)
Definition: netsearch.cpp:356
uint m_pagenum
Definition: netsearch.h:55
void PopulateResultList(ResultItem::resultList list)
Definition: netsearch.cpp:418
QString m_nextPageToken
Definition: netsearch.h:61
void DoListRefresh()
Definition: netsearch.cpp:474
void GetMoreResults()
Definition: netsearch.cpp:320
void Load() override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: netsearch.cpp:95
A text entry and edit widget.
MythUIProgressBar * m_progress
Definition: netsearch.h:46
const char * name
Definition: ParseText.cpp:328
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void customEvent(QEvent *levent) override
Definition: netsearch.cpp:544
void LoadData(void) override
Definition: netsearch.cpp:110
QString m_mythXML
Definition: netsearch.h:57
QString m_currentSearch
Definition: netsearch.h:52
void SkipPagesBack()
Definition: netsearch.cpp:339
MythUIButtonList * m_siteList
Definition: netsearch.h:40
void SetThumbnail(MythUIButtonListItem *btn)
Definition: netsearch.cpp:526
bool Create(void) override
Definition: netsearch.cpp:42
void SlotItemChanged(void)
Definition: netsearch.cpp:483
QString m_prevPageToken
Definition: netsearch.h:62
QString m_currentCmd
Definition: netsearch.h:54
void GetLastResults()
Definition: netsearch.cpp:301
NetSearch(MythScreenStack *parent, const char *name=nullptr)
Definition: netsearch.cpp:36
MythUIButtonList * m_searchResultList
Definition: netsearch.h:39
bool keyPressEvent(QKeyEvent *) override
Key event handler.
Definition: netsearch.cpp:123
Progress bar widget.
QNetworkAccessManager * m_netSearch
Definition: netsearch.h:49
void SkipPagesForward()
Definition: netsearch.cpp:349
QList< ResultItem * > resultList
Definition: rssparse.h:114
void RunSearchEditor()
Definition: netsearch.cpp:457
void FillGrabberButtonList(void)
Definition: netsearch.cpp:240
RSSSite::rssList m_rssList
Definition: netsearch.h:59
ResultItem * GetStreamItem() override
Definition: netsearch.cpp:452