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  explicit NetSearch(MythScreenStack *parent, const char *name = nullptr);
26  ~NetSearch() override;
27 
28  bool Create(void) override; // MythScreenType
29  bool keyPressEvent(QKeyEvent *event) 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
mythuiprogressbar.h
NetSearch::SlotItemChanged
void SlotItemChanged(void)
Definition: netsearch.cpp:485
NetSearch::FillGrabberButtonList
void FillGrabberButtonList(void)
Definition: netsearch.cpp:244
mythrssmanager.h
NetSearch::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: netsearch.cpp:123
NetSearch::SearchTimeout
void SearchTimeout(Search *item)
Definition: netsearch.cpp:401
NetSearch::m_okPopup
MythConfirmationDialog * m_okPopup
Definition: netsearch.h:47
NetSearch::m_pagenum
uint m_pagenum
Definition: netsearch.h:55
NetSearch::m_noSites
MythUIText * m_noSites
Definition: netsearch.h:44
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
NetSearch::SetTextAndThumbnail
void SetTextAndThumbnail(MythUIButtonListItem *btn, ResultItem *item)
Definition: netsearch.cpp:519
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:33
slots
unsigned int slots[4]
Definition: element.cpp:38
mythuistatetype.h
NetSearch::m_rssList
RSSSite::rssList m_rssList
Definition: netsearch.h:59
NetSearch::ShowMenu
void ShowMenu(void) override
Definition: netsearch.cpp:169
NetSearch::m_prevPageToken
QString m_prevPageToken
Definition: netsearch.h:62
NetSearch::Load
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
NetSearch::m_currentGrabber
int m_currentGrabber
Definition: netsearch.h:53
mythuibuttonlist.h
mythprogressdialog.h
NetSearch::m_siteList
MythUIButtonList * m_siteList
Definition: netsearch.h:40
NetSearch::LoadData
void LoadData(void) override
Definition: netsearch.cpp:110
NetSearch::Create
bool Create(void) override
Definition: netsearch.cpp:42
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
NetSearch::m_mythXML
QString m_mythXML
Definition: netsearch.h:57
NetSearch::SearchFinished
void SearchFinished(void)
Definition: netsearch.cpp:358
NetSearch::SkipPagesForward
void SkipPagesForward()
Definition: netsearch.cpp:351
NetSearch::m_progress
MythUIProgressBar * m_progress
Definition: netsearch.h:46
NetSearch::m_pageText
MythUIText * m_pageText
Definition: netsearch.h:43
NetSearch::~NetSearch
~NetSearch() override
Definition: netsearch.cpp:100
NetSearch::customEvent
void customEvent(QEvent *levent) override
Definition: netsearch.cpp:546
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:13
netgrabbermanager.h
NetSearch::GetMoreResults
void GetMoreResults()
Definition: netsearch.cpp:322
NetSearch::GetStreamItem
ResultItem * GetStreamItem() override
Definition: netsearch.cpp:454
NetSearch::m_searchResultList
MythUIButtonList * m_searchResultList
Definition: netsearch.h:39
NetSearch::m_nextPageToken
QString m_nextPageToken
Definition: netsearch.h:61
NetSearch::m_netSearch
QNetworkAccessManager * m_netSearch
Definition: netsearch.h:49
NetSearch::m_maxpage
uint m_maxpage
Definition: netsearch.h:56
uint
unsigned int uint
Definition: compat.h:140
Search
Definition: netgrabbermanager.h:138
NetSearch::DoListRefresh
void DoListRefresh()
Definition: netsearch.cpp:476
NetSearch::NetSearch
NetSearch(MythScreenStack *parent, const char *name=nullptr)
Definition: netsearch.cpp:36
NetSearch
Definition: netsearch.h:20
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
NetSearch::PopulateResultList
void PopulateResultList(const ResultItem::resultList &list)
Definition: netsearch.cpp:422
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:222
mythuitextedit.h
ResultItem
Definition: rssparse.h:110
NetSearch::SkipPagesBack
void SkipPagesBack()
Definition: netsearch.cpp:341
NetSearch::SetThumbnail
void SetThumbnail(MythUIButtonListItem *btn)
Definition: netsearch.cpp:528
NetSearch::m_currentSearch
QString m_currentSearch
Definition: netsearch.h:52
NetSearch::m_search
MythUITextEdit * m_search
Definition: netsearch.h:41
NetSearch::RunSearchEditor
void RunSearchEditor()
Definition: netsearch.cpp:459
ResultItem::resultList
QList< ResultItem * > resultList
Definition: rssparse.h:114
mythuibutton.h
netbase.h
NetBase
Definition: netbase.h:19
NetSearch::m_currentCmd
QString m_currentCmd
Definition: netsearch.h:54
mythdownloadmanager.h
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:144
NetSearch::m_reply
QNetworkReply * m_reply
Definition: netsearch.h:50
NetSearch::DoSearch
void DoSearch(void)
Definition: netsearch.cpp:259
mythscreentype.h
NetSearch::GetLastResults
void GetLastResults()
Definition: netsearch.cpp:303
RSSSite::rssList
QList< RSSSite * > rssList
Definition: mythrssmanager.h:51