MythTV  master
mythbrowser.h
Go to the documentation of this file.
1 #ifndef MYTHBROWSER_H
2 #define MYTHBROWSER_H
3 
4 #include <QUrl>
5 
6 #include <mythuiwebbrowser.h>
7 #include <mythuibuttonlist.h>
8 #include <mythuibutton.h>
9 #include <mythscreentype.h>
10 #include <mythdialogbox.h>
11 #include <mythuiprogressbar.h>
12 
13 #include "bookmarkmanager.h"
14 
15 class WebPage;
16 
18 {
19  Q_OBJECT
20 
21  public:
22  MythBrowser(MythScreenStack *parent, QStringList &urlList);
23  ~MythBrowser() override;
24 
25  bool Create(void) override; // MythScreenType
26  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
27 
28  void setDefaultSaveDirectory(const QString &saveDir) { m_defaultSaveDir = saveDir; }
29  void setDefaultSaveFilename(const QString &saveFile) { m_defaultSaveFilename = saveFile; }
30 
32  {
33  if (m_defaultFavIcon)
35  return m_defaultFavIcon;
36  }
37 
38  public slots:
39  void slotOpenURL(const QString &url);
40 
41  protected slots:
42  void slotZoomIn();
43  void slotZoomOut();
44 
45  void slotBack();
46  void slotForward();
47 
48  void slotEnterURL(void) const;
49 
50  void slotAddTab(const QString &url, bool doSwitch = true);
51  void slotAddTab() { slotAddTab(""); }
52  void slotDeleteTab(void);
53 
54  void slotAddBookmark(void);
55 
56  void slotLoadStarted(void);
57  void slotLoadFinished(bool OK);
58  void slotLoadProgress(int progress);
59  void slotTitleChanged(const QString &title);
60  void slotStatusBarMessage(const QString &text);
62  void slotTabLosingFocus(void);
63 
64  private:
66 
67  void switchTab(int newTab);
68 
69  QStringList m_urlList;
70 
72  QList<WebPage*> m_browserList;
74  MythUIText *m_titleText {nullptr};
79 
80  int m_currentBrowser {-1};
81  QUrl m_url;
84 
86 
88 
90 
91  friend class WebPage;
92 };
93 
94 #endif
MythBrowser::slotLoadProgress
void slotLoadProgress(int progress)
Definition: mythbrowser.cpp:288
mythuiprogressbar.h
MythBrowser::m_browserList
QList< WebPage * > m_browserList
Definition: mythbrowser.h:72
MythBrowser::slotZoomOut
void slotZoomOut()
Definition: mythbrowser.cpp:231
MythBrowser::activeBrowser
MythUIWebBrowser * activeBrowser(void)
Definition: mythbrowser.cpp:128
MythBrowser::slotTitleChanged
void slotTitleChanged(const QString &title)
Definition: mythbrowser.cpp:294
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
progress
bool progress
Definition: mythtv/programs/mythcommflag/main.cpp:73
bookmarkmanager.h
MythBrowser::m_exitButton
MythUIButton * m_exitButton
Definition: mythbrowser.h:78
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:15
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
MythBrowser::slotTabSelected
void slotTabSelected(MythUIButtonListItem *item)
Definition: mythbrowser.cpp:307
MythBrowser::m_progressBar
MythUIProgressBar * m_progressBar
Definition: mythbrowser.h:73
MythBrowser::GetDefaultFavIcon
MythImage * GetDefaultFavIcon(void)
Definition: mythbrowser.h:31
mythuibuttonlist.h
MythBrowser::slotLoadStarted
void slotLoadStarted(void)
Definition: mythbrowser.cpp:267
MythBrowser::slotBack
void slotBack()
Definition: mythbrowser.cpp:241
MythBrowser::m_menuPopup
MythDialogBox * m_menuPopup
Definition: mythbrowser.h:87
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
MythBrowser::slotOpenURL
void slotOpenURL(const QString &url)
Definition: mythbrowser.cpp:221
MythBrowser::setDefaultSaveFilename
void setDefaultSaveFilename(const QString &saveFile)
Definition: mythbrowser.h:29
MythBrowser::m_url
QUrl m_url
Definition: mythbrowser.h:81
MythBrowser::~MythBrowser
~MythBrowser() override
Definition: mythbrowser.cpp:25
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:12
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
MythBrowser::slotLoadFinished
void slotLoadFinished(bool OK)
Definition: mythbrowser.cpp:274
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
MythBrowser::m_editBookmark
Bookmark m_editBookmark
Definition: mythbrowser.h:85
MythBrowser::m_forwardButton
MythUIButton * m_forwardButton
Definition: mythbrowser.h:77
MythBrowser::MythBrowser
MythBrowser(MythScreenStack *parent, QStringList &urlList)
Definition: mythbrowser.cpp:18
Bookmark
Definition: bookmarkmanager.h:13
MythBrowser::m_urlList
QStringList m_urlList
Definition: mythbrowser.h:69
MythBrowser::slotStatusBarMessage
void slotStatusBarMessage(const QString &text)
Definition: mythbrowser.cpp:301
MythBrowser::setDefaultSaveDirectory
void setDefaultSaveDirectory(const QString &saveDir)
Definition: mythbrowser.h:28
MythImage::IncrRef
int IncrRef(void) override
Increments reference count.
Definition: mythimage.cpp:46
MythBrowser::m_backButton
MythUIButton * m_backButton
Definition: mythbrowser.h:76
MythBrowser::slotForward
void slotForward()
Definition: mythbrowser.cpp:246
MythBrowser::m_statusText
MythUIText * m_statusText
Definition: mythbrowser.h:75
MythBrowser::Create
bool Create(void) override
Definition: mythbrowser.cpp:37
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
MythBrowser
Definition: mythbrowser.h:17
MythBrowser::slotZoomIn
void slotZoomIn()
Definition: mythbrowser.cpp:236
MythBrowser::m_titleText
MythUIText * m_titleText
Definition: mythbrowser.h:74
MythImage
Definition: mythimage.h:36
MythBrowser::slotAddBookmark
void slotAddBookmark(void)
Definition: mythbrowser.cpp:251
MythBrowser::slotDeleteTab
void slotDeleteTab(void)
Definition: mythbrowser.cpp:181
MythBrowser::slotEnterURL
void slotEnterURL(void) const
Definition: mythbrowser.cpp:135
MythBrowser::m_currentBrowser
int m_currentBrowser
Definition: mythbrowser.h:80
MythBrowser::slotAddTab
void slotAddTab()
Definition: mythbrowser.h:51
MythBrowser::slotTabLosingFocus
void slotTabLosingFocus(void)
Definition: mythbrowser.cpp:316
MythBrowser::m_pageList
MythUIButtonList * m_pageList
Definition: mythbrowser.h:71
mythuibutton.h
WebPage
Definition: webpage.h:16
MythUIWebBrowser
Web browsing widget.
Definition: mythuiwebbrowser.h:132
MythBrowser::switchTab
void switchTab(int newTab)
Definition: mythbrowser.cpp:200
MythBrowser::m_defaultSaveFilename
QString m_defaultSaveFilename
Definition: mythbrowser.h:83
MythBrowser::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythbrowser.cpp:321
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:151
mythuiwebbrowser.h
OK
#define OK
Definition: dvbci.cpp:69
MythBrowser::m_defaultFavIcon
MythImage * m_defaultFavIcon
Definition: mythbrowser.h:89
mythscreentype.h
MythBrowser::m_defaultSaveDir
QString m_defaultSaveDir
Definition: mythbrowser.h:82