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 slotDeleteTab(void);
52 
53  void slotAddBookmark(void);
54 
55  void slotLoadStarted(void);
56  void slotLoadFinished(bool OK);
57  void slotLoadProgress(int progress);
58  void slotTitleChanged(const QString &title);
59  void slotStatusBarMessage(const QString &text);
61  void slotTabLosingFocus(void);
62 
63  private:
65 
66  void switchTab(int newTab);
67 
68  QStringList m_urlList;
69 
71  QList<WebPage*> m_browserList;
73  MythUIText *m_titleText {nullptr};
78 
79  int m_currentBrowser {-1};
80  QUrl m_url;
83 
85 
87 
89 
90  friend class WebPage;
91 };
92 
93 #endif
MythBrowser::slotLoadProgress
void slotLoadProgress(int progress)
Definition: mythbrowser.cpp:288
mythuiprogressbar.h
MythBrowser::m_browserList
QList< WebPage * > m_browserList
Definition: mythbrowser.h:71
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:77
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythBrowser::slotTabSelected
void slotTabSelected(MythUIButtonListItem *item)
Definition: mythbrowser.cpp:307
MythBrowser::slotAddTab
void slotAddTab(const QString &url="", bool doSwitch=true)
Definition: mythbrowser.cpp:151
MythBrowser::m_progressBar
MythUIProgressBar * m_progressBar
Definition: mythbrowser.h:72
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:86
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
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:80
MythBrowser::~MythBrowser
~MythBrowser() override
Definition: mythbrowser.cpp:25
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:13
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:138
MythBrowser::slotLoadFinished
void slotLoadFinished(bool OK)
Definition: mythbrowser.cpp:274
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
MythBrowser::m_editBookmark
Bookmark m_editBookmark
Definition: mythbrowser.h:84
MythBrowser::m_forwardButton
MythUIButton * m_forwardButton
Definition: mythbrowser.h:76
MythBrowser::MythBrowser
MythBrowser(MythScreenStack *parent, QStringList &urlList)
Definition: mythbrowser.cpp:18
Bookmark
Definition: bookmarkmanager.h:14
MythBrowser::m_urlList
QStringList m_urlList
Definition: mythbrowser.h:68
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:75
MythBrowser::slotForward
void slotForward()
Definition: mythbrowser.cpp:246
MythBrowser::m_statusText
MythUIText * m_statusText
Definition: mythbrowser.h:74
MythBrowser::Create
bool Create(void) override
Definition: mythbrowser.cpp:37
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
MythBrowser
Definition: mythbrowser.h:18
MythBrowser::slotZoomIn
void slotZoomIn()
Definition: mythbrowser.cpp:236
MythBrowser::m_titleText
MythUIText * m_titleText
Definition: mythbrowser.h:73
MythImage
Definition: mythimage.h:37
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:79
MythBrowser::slotTabLosingFocus
void slotTabLosingFocus(void)
Definition: mythbrowser.cpp:316
MythBrowser::m_pageList
MythUIButtonList * m_pageList
Definition: mythbrowser.h:70
mythuibutton.h
WebPage
Definition: webpage.h:17
MythUIWebBrowser
Web browsing widget.
Definition: mythuiwebbrowser.h:133
MythBrowser::switchTab
void switchTab(int newTab)
Definition: mythbrowser.cpp:200
MythBrowser::m_defaultSaveFilename
QString m_defaultSaveFilename
Definition: mythbrowser.h:82
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:144
mythuiwebbrowser.h
OK
#define OK
Definition: dvbci.cpp:69
MythBrowser::m_defaultFavIcon
MythImage * m_defaultFavIcon
Definition: mythbrowser.h:88
mythscreentype.h
MythBrowser::m_defaultSaveDir
QString m_defaultSaveDir
Definition: mythbrowser.h:81