MythTV  master
mythuiwebbrowser.cpp
Go to the documentation of this file.
1 
7 #include "mythuiwebbrowser.h"
8 
9 // c++
10 #include <chrono> // for milliseconds
11 #include <thread> // for sleep_for
12 
13 // qt
14 #include <QApplication>
15 #include <QWebFrame>
16 #include <QWebHistory>
17 #include <QPainter>
18 #include <QDir>
19 #include <QBuffer>
20 #include <QStyle>
21 #include <QKeyEvent>
22 #include <QDomDocument>
23 #include <QNetworkCookieJar>
24 #include <QNetworkConfiguration>
25 
26 // libmythbase
28 #include "libmythbase/mythdb.h"
29 #include "libmythbase/mythdirs.h"
32 
33 //libmythui
34 #include "mythpainter.h"
35 #include "mythimage.h"
36 #include "mythmainwindow.h"
37 #include "mythfontproperties.h"
38 #include "mythuihelper.h"
39 #include "mythdialogbox.h"
40 #include "mythprogressdialog.h"
41 #include "mythuiscrollbar.h"
42 
43 struct MimeType
44 {
45  QString m_mimeType;
46  QString m_extension;
47  bool m_isVideo;
48 };
49 
50 static const std::vector<MimeType> SupportedMimeTypes
51 {
52  { "audio/mpeg3", "mp3", false },
53  { "audio/x-mpeg-3", "mp3", false },
54  { "audio/mpeg", "mp2", false },
55  { "audio/x-mpeg", "mp2", false },
56  { "audio/ogg", "ogg", false },
57  { "audio/ogg", "oga", false },
58  { "audio/flac", "flac", false },
59  { "audio/x-ms-wma", "wma", false },
60  { "audio/wav", "wav", false },
61  { "audio/x-wav", "wav", false },
62  { "audio/ac3", "ac3", false },
63  { "audio/x-ac3", "ac3", false },
64  { "audio/x-oma", "oma", false },
65  { "audio/x-realaudio", "ra", false },
66  { "audio/dts", "dts", false },
67  { "audio/x-dts", "dts", false },
68  { "audio/aac", "aac", false },
69  { "audio/x-aac", "aac", false },
70  { "audio/m4a", "m4a", false },
71  { "audio/x-m4a", "m4a", false },
72  { "video/mpeg", "mpg", true },
73  { "video/mpeg", "mpeg", true },
74  { "video/x-ms-wmv", "wmv", true },
75  { "video/x-ms-wmv", "avi", true },
76  { "application/x-troff-msvideo", "avi", true },
77  { "video/avi", "avi", true },
78  { "video/msvideo", "avi", true },
79  { "video/x-msvideo", "avi", true }
80 };
81 
82 QNetworkReply* MythNetworkAccessManager::createRequest(Operation op, const QNetworkRequest& req, QIODevice* outgoingData)
83 {
84  QNetworkReply* reply = QNetworkAccessManager::createRequest(op, req, outgoingData);
85  reply->ignoreSslErrors();
86  return reply;
87 }
88 
90 
91 static void DestroyNetworkAccessManager(void)
92 {
93  if (networkManager)
94  {
95  delete networkManager;
96  networkManager = nullptr;
97  }
98 }
99 
100 static QNetworkAccessManager *GetNetworkAccessManager(void)
101 {
102  if (networkManager)
103  return networkManager;
104 
106 // This next line prevents seg fault at program exit in
107 // QNetworkConfiguration::~QNetworkConfiguration()
108 // when destructor is called by DestroyNetworkAccessManager
109  networkManager->setConfiguration(networkManager->configuration());
110  LOG(VB_GENERAL, LOG_DEBUG, "Copying DLManager's Cookie Jar");
111  GetMythDownloadManager()->loadCookieJar(GetConfDir() + "/MythBrowser/cookiejar.txt");
112  networkManager->setCookieJar(GetMythDownloadManager()->copyCookieJar());
113 
115 
116  return networkManager;
117 }
118 
124 BrowserApi::BrowserApi(QObject *parent)
125  : QObject(parent)
126 {
127  gCoreContext->addListener(this);
128 }
129 
131 {
133 }
134 
135 void BrowserApi::setWebView(QWebView *view)
136 {
137  QWebPage *page = view->page();
138  m_frame = page->mainFrame();
139 
140  attachObject();
141  connect(m_frame, &QWebFrame::javaScriptWindowObjectCleared, this,
143 }
144 
146 {
147  m_frame->addToJavaScriptWindowObject(QString("MusicPlayer"), this);
148 }
149 
151 {
152  MythEvent me(QString("MUSIC_COMMAND %1 PLAY").arg(gCoreContext->GetHostName()));
153  gCoreContext->dispatch(me);
154 }
155 
157 {
158  MythEvent me(QString("MUSIC_COMMAND %1 STOP").arg(gCoreContext->GetHostName()));
159  gCoreContext->dispatch(me);
160 }
161 
163 {
164  MythEvent me(QString("MUSIC_COMMAND %1 PAUSE %1").arg(gCoreContext->GetHostName()));
165  gCoreContext->dispatch(me);
166 }
167 
168 void BrowserApi::SetVolume(int volumn)
169 {
170  MythEvent me(QString("MUSIC_COMMAND %1 SET_VOLUME %2")
171  .arg(gCoreContext->GetHostName()).arg(volumn));
172  gCoreContext->dispatch(me);
173 }
174 
176 {
177  m_gotAnswer = false;
178 
179  MythEvent me(QString("MUSIC_COMMAND %1 GET_VOLUME")
180  .arg(gCoreContext->GetHostName()));
181  gCoreContext->dispatch(me);
182 
183  QElapsedTimer timer;
184  timer.start();
185 
186  while (!timer.hasExpired(2000) && !m_gotAnswer)
187  {
188  QCoreApplication::processEvents();
189  std::this_thread::sleep_for(10ms);
190  }
191 
192  if (m_gotAnswer)
193  return m_answer.toInt();
194 
195  return -1;
196 }
197 
198 void BrowserApi::PlayFile(const QString& filename)
199 {
200  MythEvent me(QString("MUSIC_COMMAND %1 PLAY_FILE '%2'")
201  .arg(gCoreContext->GetHostName(), filename));
202  gCoreContext->dispatch(me);
203 }
204 
205 void BrowserApi::PlayTrack(int trackID)
206 {
207  MythEvent me(QString("MUSIC_COMMAND %1 PLAY_TRACK %2")
208  .arg(gCoreContext->GetHostName()).arg(trackID));
209  gCoreContext->dispatch(me);
210 }
211 
212 void BrowserApi::PlayURL(const QString& url)
213 {
214  MythEvent me(QString("MUSIC_COMMAND %1 PLAY_URL %2")
215  .arg(gCoreContext->GetHostName(), url));
216  gCoreContext->dispatch(me);
217 }
218 
220 {
221  m_gotAnswer = false;
222 
223  MythEvent me(QString("MUSIC_COMMAND %1 GET_METADATA")
224  .arg(gCoreContext->GetHostName()));
225  gCoreContext->dispatch(me);
226 
227  QElapsedTimer timer;
228  timer.start();
229 
230  while (!timer.hasExpired(2000) && !m_gotAnswer)
231  {
232  QCoreApplication::processEvents();
233  std::this_thread::sleep_for(10ms);
234  }
235 
236  if (m_gotAnswer)
237  return m_answer;
238 
239  return {"unknown"};
240 }
241 
242 void BrowserApi::customEvent(QEvent *e)
243 {
244  if (e->type() == MythEvent::MythEventMessage)
245  {
246  auto *me = dynamic_cast<MythEvent *>(e);
247  if (me == nullptr)
248  return;
249 
250  const QString& message = me->Message();
251 
252  if (!message.startsWith("MUSIC_CONTROL"))
253  return;
254 
255  QStringList tokens = message.simplified().split(" ");
256 
257  if ((tokens.size() >= 4) && (tokens[1] == "ANSWER")
258  && (tokens[2] == gCoreContext->GetHostName()))
259  {
260  m_answer = tokens[3];
261 
262  for (int i = 4; i < tokens.size(); i++)
263  m_answer += QString(" ") + tokens[i];
264 
265  m_gotAnswer = true;
266  }
267  }
268 }
269 
270 MythWebPage::MythWebPage(QObject *parent)
271  : QWebPage(parent)
272 {
273  setNetworkAccessManager(GetNetworkAccessManager());
274 }
275 
277 {
278  LOG(VB_GENERAL, LOG_DEBUG, "Refreshing DLManager's Cookie Jar");
280  GetMythDownloadManager()->saveCookieJar(GetConfDir() + "/MythBrowser/cookiejar.txt");
281 }
282 
283 bool MythWebPage::supportsExtension(Extension extension) const
284 {
285  return extension == QWebPage::ErrorPageExtension;
286 }
287 
288 bool MythWebPage::extension(Extension extension, const ExtensionOption *option,
289  ExtensionReturn *output)
290 {
291  if (extension == QWebPage::ErrorPageExtension)
292  {
293  if (!option || !output)
294  return false;
295 
296  // Using static_cast yields the clang-tidy warning: do not use
297  // static_cast to downcast from a base to a derived class; use
298  // dynamic_cast instead. Using dynamic-cast yields the
299  // compiler error: 'QWebPage::ExtensionOption' is not
300  // polymorphic.
301  //
302  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
303  const auto *erroroption = static_cast<const ErrorPageExtensionOption *>(option);
304  ErrorPageExtensionReturn *erroroutput = nullptr;
305  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
306  erroroutput = static_cast<ErrorPageExtensionReturn *>(output);
307 
308  QString filename = "htmls/notfound.html";
309 
311  return false;
312 
313  QFile file(QLatin1String(qPrintable(filename)));
314  bool isOpened = file.open(QIODevice::ReadOnly);
315 
316  if (!isOpened)
317  return false;
318 
319  QString title = tr("Error loading page: %1").arg(erroroption->url.toString());
320  QString html = QString(QLatin1String(file.readAll()))
321  .arg(title,
322  erroroption->errorString,
323  erroroption->url.toString());
324 
325  QBuffer imageBuffer;
326  imageBuffer.open(QBuffer::ReadWrite);
327  QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxWarning,
328  nullptr, nullptr);
329  QPixmap pixmap = icon.pixmap(QSize(32, 32));
330 
331  if (pixmap.save(&imageBuffer, "PNG"))
332  {
333  html.replace(QLatin1String("IMAGE_BINARY_DATA_HERE"),
334  QString(QLatin1String(imageBuffer.buffer().toBase64())));
335  }
336 
337  erroroutput->content = html.toUtf8();
338 
339  return true;
340  }
341 
342  return false;
343 }
344 
345 QString MythWebPage::userAgentForUrl(const QUrl &url) const
346 {
347  return QWebPage::userAgentForUrl(url).replace("Safari", "MythBrowser");
348 }
349 
355 MythWebView::MythWebView(QWidget *parent, MythUIWebBrowser *parentBrowser)
356  : QWebView(parent),
357  m_webpage(new MythWebPage(this))
358 {
359  setPage(m_webpage);
360 
361  m_parentBrowser = parentBrowser;
362 
363  connect(page(), &QWebPage::unsupportedContent,
365 
366  connect(page(), &QWebPage::downloadRequested,
368 
369  page()->setForwardUnsupportedContent(true);
370 
371  m_api = new BrowserApi(this);
372  m_api->setWebView(this);
373 }
374 
376 {
377  delete m_webpage;
378  delete m_api;
379 }
380 
385 const QString kgetType { QStringLiteral("\
386 function activeElement()\
387 {\
388  var type;\
389  type = document.activeElement.type;\
390  return type;\
391 }\
392 activeElement();") };
393 
394 void MythWebView::keyPressEvent(QKeyEvent *event)
395 {
396  // does an edit have focus?
398  .toString().toLower();
399  bool editHasFocus = (type == "text" || type == "textarea" ||
400  type == "password");
401 
402  // if the QWebView widget has focus then all keypresses from a regular
403  // keyboard get sent here first
404  if (editHasFocus || m_parentBrowser->IsInputToggled())
405  {
406  // input is toggled so pass all keypresses to the QWebView's handler
407  QWebView::keyPressEvent(event);
408  }
409  else
410  {
411  // we need to convert a few keypress events so the QWebView does the
412  // right thing
413  QStringList actions;
414  bool handled = false;
415  handled = GetMythMainWindow()->TranslateKeyPress("Browser", event,
416  actions);
417 
418  for (int i = 0; i < actions.size() && !handled; i++)
419  {
420  QString action = actions[i];
421  handled = true;
422 
423  if (action == "NEXTLINK")
424  {
425  QKeyEvent tabKey(event->type(), Qt::Key_Tab,
426  event->modifiers(), QString(),
427  event->isAutoRepeat(), event->count());
428  *event = tabKey;
429  QWebView::keyPressEvent(event);
430  return;
431  }
432  if (action == "PREVIOUSLINK")
433  {
434  QKeyEvent shiftTabKey(event->type(), Qt::Key_Tab,
435  event->modifiers() | Qt::ShiftModifier,
436  QString(),
437  event->isAutoRepeat(), event->count());
438  *event = shiftTabKey;
439  QWebView::keyPressEvent(event);
440  return;
441  }
442  if (action == "FOLLOWLINK")
443  {
444  QKeyEvent returnKey(event->type(), Qt::Key_Return,
445  event->modifiers(), QString(),
446  event->isAutoRepeat(), event->count());
447  *event = returnKey;
448  QWebView::keyPressEvent(event);
449  return;
450  }
451  }
452 
453  // pass the keyPress event to our main window handler so they get
454  // handled properly by the various mythui handlers
455  QCoreApplication::postEvent(GetMythMainWindow(), new QKeyEvent(*event));
456  }
457 }
458 
459 void MythWebView::handleUnsupportedContent(QNetworkReply *reply)
460 {
461  if (reply->error() == QNetworkReply::NoError)
462  {
463  stop();
464 
465  QVariant header = reply->header(QNetworkRequest::ContentTypeHeader);
466 
467  if (header != QVariant())
468  {
469  LOG(VB_GENERAL, LOG_ERR,
470  QString("MythWebView::handleUnsupportedContent - %1")
471  .arg(header.toString()));
472  }
473 
474  m_downloadReply = reply;
475  m_downloadRequest = reply->request();
476  m_downloadAndPlay = false;
478 
479  return;
480  }
481 }
482 
483 void MythWebView::handleDownloadRequested(const QNetworkRequest &request)
484 {
485  m_downloadReply = nullptr;
486  doDownloadRequested(request);
487 }
488 
489 void MythWebView::doDownloadRequested(const QNetworkRequest &request)
490 {
491  m_downloadRequest = request;
492 
493  // get the filename from the url if available
494  QFileInfo fi(request.url().path());
495  QString basename(fi.completeBaseName());
496  QString extension = fi.suffix().toLower();
497  QString mimetype = getReplyMimetype();
498 
499  // if we have a default filename use that
500  QString saveBaseName = basename;
501 
502  if (!m_parentBrowser->GetDefaultSaveFilename().isEmpty())
503  {
504  QFileInfo savefi(m_parentBrowser->GetDefaultSaveFilename());
505  saveBaseName = savefi.completeBaseName();
506  }
507 
508  // if the filename is still empty use a default name
509  if (saveBaseName.isEmpty())
510  saveBaseName = "unnamed_download";
511 
512  // if we don't have an extension from the filename get one from the mime type
513  if (extension.isEmpty())
514  extension = getExtensionForMimetype(mimetype);
515 
516  if (!extension.isEmpty())
517  extension = '.' + extension;
518 
519  QString saveFilename = QString("%1%2%3")
521  saveBaseName,
522  extension);
523 
524  // dont overwrite an existing file
525  if (QFile::exists(saveFilename))
526  {
527  int i = 1;
528 
529  do
530  {
531  saveFilename = QString("%1%2-%3%4")
533  saveBaseName,
534  QString::number(i++),
535  extension);
536  }
537  while (QFile::exists(saveFilename));
538  }
539 
540  // if we are downloading and then playing the file don't ask for the file name
541  if (m_downloadAndPlay)
542  {
543  doDownload(saveFilename);
544  }
545  else
546  {
547  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
548 
549  QString msg = tr("Enter filename to save file");
550  auto *input = new MythTextInputDialog(popupStack, msg, FilterNone,
551  false, saveFilename);
552 
553  if (input->Create())
554  {
555  input->SetReturnEvent(this, "filenamedialog");
556  popupStack->AddScreen(input);
557  }
558  else
559  delete input;
560  }
561 }
562 
563 void MythWebView::doDownload(const QString &saveFilename)
564 {
565  if (saveFilename.isEmpty())
566  return;
567 
568  openBusyPopup(tr("Downloading file. Please wait..."));
569 
570  // No need to make sure the path to saveFilename exists because
571  // MythDownloadManage takes care of that
573  saveFilename, this);
574 }
575 
576 void MythWebView::openBusyPopup(const QString &message)
577 {
578  if (m_busyPopup)
579  return;
580 
581  QString msg(tr("Downloading..."));
582 
583  if (!message.isEmpty())
584  msg = message;
585 
586  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
587  m_busyPopup = new MythUIBusyDialog(msg, popupStack, "downloadbusydialog");
588 
589  if (m_busyPopup->Create())
590  popupStack->AddScreen(m_busyPopup, false);
591 }
592 
594 {
595  if (m_busyPopup)
596  m_busyPopup->Close();
597 
598  m_busyPopup = nullptr;
599 }
600 
601 void MythWebView::customEvent(QEvent *event)
602 {
603  if (event->type() == DialogCompletionEvent::kEventType)
604  {
605  auto *dce = (DialogCompletionEvent *)(event);
606 
607  // make sure the user didn't ESCAPE out of the dialog
608  if (dce->GetResult() < 0)
609  return;
610 
611  QString resultid = dce->GetId();
612  QString resulttext = dce->GetResultText();
613 
614  if (resultid == "filenamedialog")
615  doDownload(resulttext);
616  else if (resultid == "downloadmenu")
617  {
618  if (resulttext == tr("Play the file"))
619  {
620  QFileInfo fi(m_downloadRequest.url().path());
621  QString extension = fi.suffix();
622  QString mimeType = getReplyMimetype();
623 
624  if (isMusicFile(extension, mimeType))
625  {
626  MythEvent me(QString("MUSIC_COMMAND %1 PLAY_URL %2")
627  .arg(gCoreContext->GetHostName(),
628  m_downloadRequest.url().toString()));
629  gCoreContext->dispatch(me);
630  }
631  else if (isVideoFile(extension, mimeType))
632  {
633  GetMythMainWindow()->HandleMedia("Internal",
634  m_downloadRequest.url().toString());
635  }
636  else
637  {
638  LOG(VB_GENERAL, LOG_ERR,
639  QString("MythWebView: Asked to play a file with "
640  "extension '%1' but don't know how")
641  .arg(extension));
642  }
643  }
644  else if (resulttext == tr("Download the file"))
645  {
647  }
648  else if (resulttext == tr("Download and play the file"))
649  {
650  m_downloadAndPlay = true;
652  }
653  }
654  }
655  else if (event->type() == MythEvent::MythEventMessage)
656  {
657  auto *me = dynamic_cast<MythEvent *>(event);
658  if (me == nullptr)
659  return;
660 
661 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
662  QStringList tokens = me->Message().split(" ", QString::SkipEmptyParts);
663 #else
664  QStringList tokens = me->Message().split(" ", Qt::SkipEmptyParts);
665 #endif
666  if (tokens.isEmpty())
667  return;
668 
669  if (tokens[0] == "DOWNLOAD_FILE")
670  {
671  QStringList args = me->ExtraDataList();
672 
673  if (tokens[1] == "UPDATE")
674  {
675  // could update a progressbar here
676  }
677  else if (tokens[1] == "FINISHED")
678  {
679  int fileSize = args[2].toInt();
680  int errorCode = args[4].toInt();
681  QString filename = args[1];
682 
683  closeBusyPopup();
684 
685  if ((errorCode != 0) || (fileSize == 0))
686  ShowOkPopup(tr("ERROR downloading file."));
687  else if (m_downloadAndPlay)
688  GetMythMainWindow()->HandleMedia("Internal", filename);
689 
690  MythEvent me2(QString("BROWSER_DOWNLOAD_FINISHED"), args);
691  gCoreContext->dispatch(me2);
692  }
693  }
694  }
695 }
696 
698 {
699  QFileInfo fi(m_downloadRequest.url().path());
700  QString extension = fi.suffix();
701  QString mimeType = getReplyMimetype();
702 
703  QString label = tr("What do you want to do with this file?");
704 
705  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
706 
707  auto *menu = new MythDialogBox(label, popupStack, "downloadmenu");
708 
709  if (!menu->Create())
710  {
711  delete menu;
712  return;
713  }
714 
715  menu->SetReturnEvent(this, "downloadmenu");
716 
717  if (isMusicFile(extension, mimeType))
718  menu->AddButton(tr("Play the file"));
719 
720  if (isVideoFile(extension, mimeType))
721  menu->AddButton(tr("Download and play the file"));
722 
723  menu->AddButton(tr("Download the file"));
724  menu->AddButton(tr("Cancel"));
725 
726  popupStack->AddScreen(menu);
727 }
728 
729 QString MythWebView::getExtensionForMimetype(const QString &mimetype)
730 {
731  if (mimetype.isEmpty())
732  return {""};
733 
734  auto it = std::find_if(SupportedMimeTypes.cbegin(), SupportedMimeTypes.cend(),
735  [mimetype] (const MimeType& entry) -> bool
736  { return mimetype == entry.m_mimeType; });
737  if (it != SupportedMimeTypes.cend())
738  return it->m_extension;
739  return {""};
740 }
741 
742 bool MythWebView::isMusicFile(const QString &extension, const QString &mimetype)
743 {
744  return std::any_of(SupportedMimeTypes.cbegin(), SupportedMimeTypes.cend(),
745  [extension, mimetype](const auto &entry){
746  if (entry.m_isVideo)
747  return false;
748  if (!mimetype.isEmpty() &&
749  mimetype == entry.m_mimeType)
750  return true;
751  if (!extension.isEmpty() &&
752  extension.toLower() == entry.m_extension)
753  return true;
754  return false; } );
755 }
756 
757 bool MythWebView::isVideoFile(const QString &extension, const QString &mimetype)
758 {
759  return std::any_of(SupportedMimeTypes.cbegin(), SupportedMimeTypes.cend(),
760  [extension, mimetype](const auto &entry) {
761  if (!entry.m_isVideo)
762  return false;
763  if (!mimetype.isEmpty() &&
764  mimetype == entry.m_mimeType)
765  return true;
766  if (!extension.isEmpty() &&
767  extension.toLower() == entry.m_extension)
768  return true;
769  return false; } );
770 }
771 
773 {
774  if (!m_downloadReply)
775  return {};
776 
777  QString mimeType;
778  QVariant header = m_downloadReply->header(QNetworkRequest::ContentTypeHeader);
779 
780  if (header != QVariant())
781  mimeType = header.toString();
782 
783  return mimeType;
784 }
785 
786 QWebView *MythWebView::createWindow(QWebPage::WebWindowType /* type */)
787 {
788  return (QWebView *) this;
789 }
790 
791 
831 MythUIWebBrowser::MythUIWebBrowser(MythUIType *parent, const QString &name)
832  : MythUIType(parent, name),
833  m_bgColor("White"), m_userCssFile(""),
834  m_defaultSaveDir(GetConfDir() + "/MythBrowser/"),
835  m_defaultSaveFilename(""),
836  m_lastMouseAction("")
837 {
838  SetCanTakeFocus(true);
839  m_scrollAnimation.setDuration(0);
840  m_lastUpdateTime.start();
841 }
842 
847 {
849 
850  Init();
851 }
852 
861 {
862  // only do the initialisation for widgets not being stored in the global object store
863  if (parent() == GetGlobalObjectStore())
864  return;
865 
866  if (m_initialized)
867  return;
868 
871  m_actualBrowserArea.translate(m_area.x(), m_area.y());
872 
873  if (!m_actualBrowserArea.isValid())
875 
876  m_browser = new MythWebView(GetMythMainWindow()->GetPaintWindow(), this);
877  m_browser->setPalette(QApplication::style()->standardPalette());
878  m_browser->setGeometry(m_actualBrowserArea);
879  m_browser->setFixedSize(m_actualBrowserArea.size());
881  m_browser->page()->setLinkDelegationPolicy(QWebPage::DontDelegateLinks);
882 
883  bool err = false;
884  UIUtilW::Assign(this, m_horizontalScrollbar, "horizscrollbar", &err);
885  UIUtilW::Assign(this, m_verticalScrollbar, "vertscrollbar", &err);
887  {
888  QWebFrame* frame = m_browser->page()->currentFrame();
889  frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
894  }
895 
897  {
898  QWebFrame* frame = m_browser->page()->currentFrame();
899  frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
904  }
905 
906  // if we have a valid css URL use that ...
907  if (!m_userCssFile.isEmpty())
908  {
909  QString filename = m_userCssFile;
910 
911  if (GetMythUI()->FindThemeFile(filename))
912  LoadUserStyleSheet(QUrl("file://" + filename));
913  }
914  else
915  {
916  // ...otherwise use the default one
917  QString filename = "htmls/mythbrowser.css";
918 
919  if (GetMythUI()->FindThemeFile(filename))
920  LoadUserStyleSheet(QUrl("file://" + filename));
921  }
922 
923  m_browser->winId();
924 
926 
927  connect(m_browser, &QWebView::loadStarted,
929  connect(m_browser, &QWebView::loadFinished,
931  connect(m_browser, &QWebView::loadProgress,
933  connect(m_browser, &QWebView::titleChanged,
935  connect(m_browser, &QWebView::iconChanged,
937  connect(m_browser, &QWebView::statusBarMessage,
939  connect(m_browser->page(), &QWebPage::linkHovered,
941  connect(m_browser, &QWebView::linkClicked,
943 
944  // find what screen we are on
945  m_parentScreen = nullptr;
946  QObject *parentObject = parent();
947 
948  while (parentObject)
949  {
950  m_parentScreen = qobject_cast<MythScreenType *>(parentObject);
951 
952  if (m_parentScreen)
953  break;
954 
955  parentObject = parentObject->parent();
956  }
957 
958  if (!m_parentScreen && parent() != GetGlobalObjectStore())
959  LOG(VB_GENERAL, LOG_ERR,
960  "MythUIWebBrowser: failed to find our parent screen");
961 
962  // connect to the topScreenChanged signals on each screen stack
963  for (int x = 0; x < GetMythMainWindow()->GetStackCount(); x++)
964  {
966 
967  if (stack)
968  connect(stack, &MythScreenStack::topScreenChanged,
970  }
971 
972  // set up the icon cache directory
973  QString path = GetConfDir();
974  QDir dir(path);
975 
976  if (!dir.exists())
977  dir.mkdir(path);
978 
979  path += "/MythBrowser";
980  dir.setPath(path);
981 
982  if (!dir.exists())
983  dir.mkdir(path);
984 
985  QWebSettings::setIconDatabasePath(path);
986 
987  if (gCoreContext->GetNumSetting("WebBrowserEnablePlugins", 1) == 1)
988  {
989  LOG(VB_GENERAL, LOG_INFO, "MythUIWebBrowser: enabling plugins");
990  QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled,
991  true);
992  }
993  else
994  {
995  LOG(VB_GENERAL, LOG_INFO, "MythUIWebBrowser: disabling plugins");
996  QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled,
997  false);
998  }
999 
1000  if (!gCoreContext->GetBoolSetting("WebBrowserEnableJavascript",true))
1001  {
1002  LOG(VB_GENERAL, LOG_INFO, "MythUIWebBrowser: disabling JavaScript");
1003  QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, false);
1004  }
1005 
1006  QImage image = QImage(m_actualBrowserArea.size(), QImage::Format_ARGB32);
1008  m_image->Assign(image);
1009 
1011 
1012  m_zoom = gCoreContext->GetFloatSetting("WebBrowserZoomLevel", 1.0);
1013 
1014  SetZoom(m_zoom);
1015 
1016  if (!m_widgetUrl.isEmpty() && m_widgetUrl.isValid())
1018 
1019  m_initialized = true;
1020 }
1021 
1026 {
1027  if (m_browser)
1028  {
1029  m_browser->hide();
1030  m_browser->disconnect();
1031  m_browser->deleteLater();
1032  m_browser = nullptr;
1033  }
1034 
1035  if (m_image)
1036  {
1037  m_image->DecrRef();
1038  m_image = nullptr;
1039  }
1040 }
1041 
1046 void MythUIWebBrowser::LoadPage(const QUrl& url)
1047 {
1048  if (!m_browser)
1049  return;
1050 
1051  ResetScrollBars();
1052 
1053  m_browser->setUrl(url);
1054 }
1055 
1062 void MythUIWebBrowser::SetHtml(const QString &html, const QUrl &baseUrl)
1063 {
1064  if (!m_browser)
1065  return;
1066 
1067  ResetScrollBars();
1068 
1069  m_browser->setHtml(html, baseUrl);
1070 }
1071 
1077 {
1078  if (!m_browser)
1079  return;
1080 
1081  LOG(VB_GENERAL, LOG_INFO,
1082  "MythUIWebBrowser: Loading css from - " + url.toString());
1083 
1084  m_browser->page()->settings()->setUserStyleSheetUrl(url);
1085 }
1086 
1094 {
1095  if (!m_browser)
1096  return;
1097 
1098  color.setAlpha(255);
1099  QPalette palette = m_browser->page()->palette();
1100  palette.setBrush(QPalette::Window, QBrush(color));
1101  palette.setBrush(QPalette::Base, QBrush(color));
1102  m_browser->page()->setPalette(palette);
1103 
1104  UpdateBuffer();
1105 }
1106 
1118 {
1119  if (!m_browser)
1120  return;
1121 
1122  if (m_active == active)
1123  return;
1124 
1125  m_active = active;
1126  m_wasActive = active;
1127 
1128  if (m_active)
1129  {
1130  m_browser->setUpdatesEnabled(false);
1131  m_browser->setFocus();
1132  m_browser->show();
1133  m_browser->raise();
1134  if (QGuiApplication::platformName().contains("egl"))
1135  {
1136  m_browser->setParent(nullptr);
1137  m_browser->setFocus();
1138  m_browser->show();
1139  m_browser->raise();
1140  }
1141  m_browser->setUpdatesEnabled(true);
1142  }
1143  else
1144  {
1145  m_browser->clearFocus();
1146  m_browser->hide();
1147  if (QGuiApplication::platformName().contains("egl"))
1148  m_browser->setParent(GetMythMainWindow());
1149  UpdateBuffer();
1150  }
1151 }
1152 
1157 {
1158  SetZoom(m_zoom + 0.1F);
1159 }
1160 
1165 {
1166  SetZoom(m_zoom - 0.1F);
1167 }
1168 
1174 {
1175  if (!m_browser)
1176  return;
1177 
1178  if (zoom < 0.3F)
1179  zoom = 0.3F;
1180 
1181  if (zoom > 5.0F)
1182  zoom = 5.0F;
1183 
1184  m_zoom = zoom;
1185  m_browser->setZoomFactor(m_zoom);
1186  ResetScrollBars();
1187  UpdateBuffer();
1188 
1189  slotStatusBarMessage(tr("Zoom: %1%").arg(m_zoom * 100));
1190 
1191  gCoreContext->SaveSetting("WebBrowserZoomLevel", QString("%1").arg(m_zoom));
1192 }
1193 
1194 void MythUIWebBrowser::SetDefaultSaveDirectory(const QString &saveDir)
1195 {
1196  if (!saveDir.isEmpty())
1197  m_defaultSaveDir = saveDir;
1198  else
1199  m_defaultSaveDir = GetConfDir() + "/MythBrowser/";
1200 }
1201 
1203 {
1204  if (!filename.isEmpty())
1206  else
1207  m_defaultSaveFilename.clear();
1208 }
1209 
1214 float MythUIWebBrowser::GetZoom(void) const
1215 {
1216  return m_zoom;
1217 }
1218 
1225 {
1226  if (!m_browser)
1227  return false;
1228 
1229  return m_browser->history()->canGoForward();
1230 }
1231 
1238 {
1239  if (!m_browser)
1240  return false;
1241 
1242  return m_browser->history()->canGoBack();
1243 }
1244 
1249 {
1250  if (!m_browser)
1251  return;
1252 
1253  m_browser->back();
1254 }
1255 
1260 {
1261  if (!m_browser)
1262  return;
1263 
1264  m_browser->forward();
1265 }
1266 
1272 {
1273  if (m_browser)
1274  {
1275  return QWebSettings::iconForUrl(m_browser->url());
1276  }
1277  return {};
1278 }
1279 
1285 {
1286  if (m_browser)
1287  {
1288  return m_browser->url();
1289  }
1290  return {};
1291 }
1292 
1298 {
1299  if (m_browser)
1300  return m_browser->title();
1301  return {""};
1302 }
1303 
1308 QVariant MythUIWebBrowser::evaluateJavaScript(const QString &scriptSource)
1309 {
1310  if (m_browser)
1311  {
1312  QWebFrame *frame = m_browser->page()->currentFrame();
1313  return frame->evaluateJavaScript(scriptSource);
1314  }
1315  return {};
1316 }
1317 
1318 void MythUIWebBrowser::Scroll(int dx, int dy)
1319 {
1320  if (!m_browser)
1321  return;
1322 
1323  QPoint startPos = m_browser->page()->currentFrame()->scrollPosition();
1324  QPoint endPos = startPos + QPoint(dx, dy);
1325 
1326  if (GetPainter()->SupportsAnimation() && m_scrollAnimation.duration() > 0)
1327  {
1328  // Previous scroll has been completed
1329  if (m_destinationScrollPos == startPos)
1330  m_scrollAnimation.setEasingCurve(QEasingCurve::InOutCubic);
1331  else
1332  m_scrollAnimation.setEasingCurve(QEasingCurve::OutCubic);
1333 
1334  m_destinationScrollPos = endPos;
1335  m_scrollAnimation.setStartValue(startPos);
1338  }
1339  else
1340  {
1341  m_destinationScrollPos = endPos;
1342  m_browser->page()->currentFrame()->setScrollPosition(endPos);
1343  UpdateBuffer();
1344  }
1345 }
1346 
1348 {
1349  ResetScrollBars();
1350  emit loadStarted();
1351 }
1352 
1354 {
1355  UpdateBuffer();
1356  emit loadFinished(ok);
1357 }
1358 
1360 {
1361  emit loadProgress(progress);
1362 }
1363 
1364 void MythUIWebBrowser::slotTitleChanged(const QString &title)
1365 {
1366  emit titleChanged(title);
1367 }
1368 
1370 {
1371  emit statusBarMessage(text);
1372 }
1373 
1375 {
1376  LoadPage(url);
1377 }
1378 
1380 {
1381  emit iconChanged();
1382 }
1383 
1385 {
1386  bool wasActive = (m_wasActive || m_active);
1387  SetActive(false);
1388  m_wasActive = wasActive;
1389 }
1390 
1392 {
1394  slotTopScreenChanged(nullptr);
1395 }
1396 
1398 {
1399  if (IsOnTopScreen())
1401  else
1402  {
1403  bool wasActive = (m_wasActive || m_active);
1404  SetActive(false);
1405  m_wasActive = wasActive;
1406  }
1407 }
1408 
1411 {
1412  if (!m_parentScreen)
1413  return false;
1414 
1415  for (int x = GetMythMainWindow()->GetStackCount() - 1; x >= 0; x--)
1416  {
1418 
1419  // ignore stacks with no screens on them
1420  if (!stack->GetTopScreen())
1421  continue;
1422 
1423  return (stack->GetTopScreen() == m_parentScreen);
1424  }
1425 
1426  return false;
1427 }
1428 
1429 
1431 {
1432  if (!m_browser)
1433  return;
1434 
1435  QPoint position = m_browser->page()->currentFrame()->scrollPosition();
1436  if (m_verticalScrollbar)
1437  {
1438  int maximum =
1439  m_browser->page()->currentFrame()->contentsSize().height() -
1440  m_actualBrowserArea.height();
1441  m_verticalScrollbar->SetMaximum(maximum);
1443  m_verticalScrollbar->SetSliderPosition(position.y());
1444  }
1445 
1447  {
1448  int maximum =
1449  m_browser->page()->currentFrame()->contentsSize().width() -
1450  m_actualBrowserArea.width();
1454  }
1455 }
1456 
1458 {
1459  UpdateScrollBars();
1460 
1461  if (!m_image || !m_browser)
1462  return;
1463 
1464  if (!m_active || (m_active && !m_browser->hasFocus()))
1465  {
1466  QPainter painter(m_image);
1467  m_browser->render(&painter);
1468  painter.end();
1469 
1470  m_image->SetChanged();
1471  Refresh();
1472  }
1473 }
1474 
1479 {
1480  if (!m_browser)
1481  return;
1482 
1483  if (m_scrollAnimation.IsActive() &&
1485  m_browser->page()->currentFrame()->scrollPosition())
1486  {
1488 
1489  QPoint scrollPosition = m_scrollAnimation.currentValue().toPoint();
1490  m_browser->page()->currentFrame()->setScrollPosition(scrollPosition);
1491 
1492  SetRedraw();
1493  UpdateBuffer();
1494  }
1495  else if (m_updateInterval && m_lastUpdateTime.hasExpired(m_updateInterval))
1496  {
1497  UpdateBuffer();
1498  m_lastUpdateTime.start();
1499  }
1500 
1502 }
1503 
1507 void MythUIWebBrowser::DrawSelf(MythPainter *p, int xoffset, int yoffset,
1508  int alphaMod, QRect clipRect)
1509 {
1510  if (!m_image || m_image->isNull() || !m_browser || m_browser->hasFocus())
1511  return;
1512 
1513  QRect area = m_actualBrowserArea;
1514  area.translate(xoffset, yoffset);
1515 
1516  p->SetClipRect(clipRect);
1517  p->DrawImage(area.x(), area.y(), m_image, alphaMod);
1518 }
1519 
1523 bool MythUIWebBrowser::keyPressEvent(QKeyEvent *event)
1524 {
1525  if (!m_browser)
1526  return false;
1527 
1528  QStringList actions;
1529  bool handled = false;
1530  handled = GetMythMainWindow()->TranslateKeyPress("Browser", event, actions);
1531 
1532  for (int i = 0; i < actions.size() && !handled; i++)
1533  {
1534  QString action = actions[i];
1535  handled = true;
1536 
1537  if (action == "TOGGLEINPUT")
1538  {
1540 
1541  if (m_inputToggled)
1542  slotStatusBarMessage(tr("Sending key presses to web page"));
1543  else
1544  slotStatusBarMessage(tr("Sending key presses to MythTV"));
1545 
1546  return true;
1547  }
1548 
1549  // if input is toggled all input goes to the web page
1550  if (m_inputToggled)
1551  {
1552  m_browser->keyPressEvent(event);
1553 
1554  return true;
1555  }
1556 
1557  QWebFrame *frame = m_browser->page()->currentFrame();
1558  if (action == "UP")
1559  {
1560  int pos = frame->scrollPosition().y();
1561 
1562  if (pos > 0)
1563  {
1564  Scroll(0, -m_actualBrowserArea.height() / 10);
1565  }
1566  else
1567  handled = false;
1568  }
1569  else if (action == "DOWN")
1570  {
1571  int pos = frame->scrollPosition().y();
1572  QSize maximum = frame->contentsSize() - m_actualBrowserArea.size();
1573 
1574  if (pos != maximum.height())
1575  {
1576  Scroll(0, m_actualBrowserArea.height() / 10);
1577  }
1578  else
1579  handled = false;
1580  }
1581  else if (action == "LEFT")
1582  {
1583  int pos = frame->scrollPosition().x();
1584 
1585  if (pos > 0)
1586  {
1587  Scroll(-m_actualBrowserArea.width() / 10, 0);
1588  }
1589  else
1590  handled = false;
1591  }
1592  else if (action == "RIGHT")
1593  {
1594  int pos = frame->scrollPosition().x();
1595  QSize maximum = frame->contentsSize() - m_actualBrowserArea.size();
1596 
1597  if (pos != maximum.width())
1598  {
1599  Scroll(m_actualBrowserArea.width() / 10, 0);
1600  }
1601  else
1602  handled = false;
1603  }
1604  else if (action == "PAGEUP")
1605  {
1606  Scroll(0, -m_actualBrowserArea.height());
1607  }
1608  else if (action == "PAGEDOWN")
1609  {
1610  Scroll(0, m_actualBrowserArea.height());
1611  }
1612  else if (action == "ZOOMIN")
1613  {
1614  ZoomIn();
1615  }
1616  else if (action == "ZOOMOUT")
1617  {
1618  ZoomOut();
1619  }
1620  else if (action == "MOUSEUP" || action == "MOUSEDOWN" ||
1621  action == "MOUSELEFT" || action == "MOUSERIGHT" ||
1622  action == "MOUSELEFTBUTTON")
1623  {
1625  }
1626  else if (action == "PAGELEFT")
1627  {
1628  Scroll(-m_actualBrowserArea.width(), 0);
1629  }
1630  else if (action == "PAGERIGHT")
1631  {
1632  Scroll(m_actualBrowserArea.width(), 0);
1633  }
1634  else if ((action == "NEXTLINK") ||
1635  (action == "PREVIOUSLINK") ||
1636  (action == "FOLLOWLINK"))
1637  {
1638  m_browser->keyPressEvent(event);
1639  }
1640  else if (action == "HISTORYBACK")
1641  {
1642  Back();
1643  }
1644  else if (action == "HISTORYFORWARD")
1645  {
1646  Forward();
1647  }
1648  else
1649  handled = false;
1650  }
1651 
1652  return handled;
1653 }
1654 
1656 {
1657  int step = 5;
1658 
1659  // speed up mouse movement if the same key is held down
1660  if (action == m_lastMouseAction &&
1661  m_lastMouseActionTime.isValid() &&
1662  !m_lastMouseActionTime.hasExpired(500))
1663  {
1664  m_lastMouseActionTime.start();
1665  m_mouseKeyCount++;
1666 
1667  if (m_mouseKeyCount > 5)
1668  step = 25;
1669  }
1670  else
1671  {
1673  m_lastMouseActionTime.start();
1674  m_mouseKeyCount = 1;
1675  }
1676 
1677  if (action == "MOUSEUP")
1678  {
1679  QPoint curPos = QCursor::pos();
1680  QCursor::setPos(curPos.x(), curPos.y() - step);
1681  }
1682  else if (action == "MOUSELEFT")
1683  {
1684  QPoint curPos = QCursor::pos();
1685  QCursor::setPos(curPos.x() - step, curPos.y());
1686  }
1687  else if (action == "MOUSERIGHT")
1688  {
1689  QPoint curPos = QCursor::pos();
1690  QCursor::setPos(curPos.x() + step, curPos.y());
1691  }
1692  else if (action == "MOUSEDOWN")
1693  {
1694  QPoint curPos = QCursor::pos();
1695  QCursor::setPos(curPos.x(), curPos.y() + step);
1696  }
1697  else if (action == "MOUSELEFTBUTTON")
1698  {
1699  QPoint curPos = QCursor::pos();
1700  QWidget *widget = QApplication::widgetAt(curPos);
1701 
1702  if (widget)
1703  {
1704  curPos = widget->mapFromGlobal(curPos);
1705 
1706  auto *me = new QMouseEvent(QEvent::MouseButtonPress, curPos,
1707  Qt::LeftButton, Qt::LeftButton,
1708  Qt::NoModifier);
1709  QCoreApplication::postEvent(widget, me);
1710 
1711  me = new QMouseEvent(QEvent::MouseButtonRelease, curPos,
1712  Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
1713  QCoreApplication::postEvent(widget, me);
1714  }
1715  }
1716 }
1717 
1719 {
1720  if (m_verticalScrollbar)
1721  {
1724  }
1725 
1727  {
1730  }
1731 }
1732 
1737  const QString &filename, QDomElement &element, bool showWarnings)
1738 {
1739  if (element.tagName() == "zoom")
1740  {
1741  QString zoom = getFirstText(element);
1742  m_zoom = zoom.toFloat();
1743  }
1744  else if (element.tagName() == "url")
1745  {
1746  m_widgetUrl.setUrl(getFirstText(element));
1747  }
1748  else if (element.tagName() == "userstylesheet")
1749  {
1750  m_userCssFile = getFirstText(element);
1751  }
1752  else if (element.tagName() == "updateinterval")
1753  {
1754  QString interval = getFirstText(element);
1755  m_updateInterval = interval.toInt();
1756  }
1757  else if (element.tagName() == "background")
1758  {
1759  m_bgColor = QColor(element.attribute("color", "#ffffff"));
1760  int alpha = element.attribute("alpha", "255").toInt();
1761  m_bgColor.setAlpha(alpha);
1762  }
1763  else if (element.tagName() == "browserarea")
1764  {
1765  m_browserArea = parseRect(element);
1766  }
1767  else if (element.tagName() == "scrollduration")
1768  {
1769  QString duration = getFirstText(element);
1770  m_scrollAnimation.setDuration(duration.toInt());
1771  }
1772  else if (element.tagName() == "acceptsfocus")
1773  {
1774  SetCanTakeFocus(parseBool(element));
1775  }
1776  else
1777  {
1778  return MythUIType::ParseElement(filename, element, showWarnings);
1779  }
1780 
1781  return true;
1782 }
1783 
1788 {
1789  auto *browser = dynamic_cast<MythUIWebBrowser *>(base);
1790  if (!browser)
1791  {
1792  LOG(VB_GENERAL, LOG_ERR, "ERROR, bad parsing");
1793  return;
1794  }
1795 
1796  MythUIType::CopyFrom(base);
1797 
1798  m_browserArea = browser->m_browserArea;
1799  m_zoom = browser->m_zoom;
1800  m_bgColor = browser->m_bgColor;
1801  m_widgetUrl = browser->m_widgetUrl;
1802  m_userCssFile = browser->m_userCssFile;
1803  m_updateInterval = browser->m_updateInterval;
1804  m_defaultSaveDir = browser->m_defaultSaveDir;
1805  m_defaultSaveFilename = browser->m_defaultSaveFilename;
1806  m_scrollAnimation.setDuration(browser->m_scrollAnimation.duration());
1807 }
1808 
1813 {
1814  auto *browser = new MythUIWebBrowser(parent, objectName());
1815  browser->CopyFrom(this);
1816 }
MythUIWebBrowser::SetActive
void SetActive(bool active)
Toggles the active state of the widget.
Definition: mythuiwebbrowser.cpp:1117
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:274
build_compdb.args
args
Definition: build_compdb.py:11
MythUIWebBrowser::CanGoForward
bool CanGoForward(void)
Can go forward in page history.
Definition: mythuiwebbrowser.cpp:1224
MythUIWebBrowser::Forward
void Forward(void)
Got forward in page history.
Definition: mythuiwebbrowser.cpp:1259
MythEvent::MythEventMessage
static Type MythEventMessage
Definition: mythevent.h:79
MimeType
Definition: mythuiwebbrowser.cpp:43
MythUIWebBrowser::m_mouseKeyCount
int m_mouseKeyCount
Definition: mythuiwebbrowser.h:243
MythUIWebBrowser::SetZoom
void SetZoom(float zoom)
Set the text size to specific size.
Definition: mythuiwebbrowser.cpp:1173
MythUIWebBrowser::SetHtml
void SetHtml(const QString &html, const QUrl &baseUrl=QUrl())
Sets the content of the widget to the specified html.
Definition: mythuiwebbrowser.cpp:1062
MythWebPage
Definition: mythuiwebbrowser.h:69
FilterNone
@ FilterNone
Definition: mythuitextedit.h:21
MythWebPage::extension
bool extension(Extension extension, const ExtensionOption *option=nullptr, ExtensionReturn *output=nullptr) override
Definition: mythuiwebbrowser.cpp:288
MythUIWebBrowser::CreateCopy
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
Definition: mythuiwebbrowser.cpp:1812
mythdb.h
MythWebView::getReplyMimetype
QString getReplyMimetype(void)
Definition: mythuiwebbrowser.cpp:772
MythUIWebBrowser::slotScrollBarShowing
void slotScrollBarShowing(void)
Definition: mythuiwebbrowser.cpp:1384
MythUIWebBrowser::slotTitleChanged
void slotTitleChanged(const QString &title)
Definition: mythuiwebbrowser.cpp:1364
MythUIWebBrowser::GetDefaultSaveDirectory
QString GetDefaultSaveDirectory(void)
Definition: mythuiwebbrowser.h:171
MythUIWebBrowser::m_initialized
bool m_initialized
Definition: mythuiwebbrowser.h:230
MythWebPage::userAgentForUrl
QString userAgentForUrl(const QUrl &url) const override
Definition: mythuiwebbrowser.cpp:345
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:386
MythUIWebBrowser::UpdateBuffer
void UpdateBuffer(void)
Definition: mythuiwebbrowser.cpp:1457
MythWebView::closeBusyPopup
void closeBusyPopup(void)
Definition: mythuiwebbrowser.cpp:593
MythUIWebBrowser::IsInputToggled
bool IsInputToggled(void) const
returns true if all keypresses are to be passed to the web page
Definition: mythuiwebbrowser.h:159
MythUIWebBrowser::statusBarMessage
void statusBarMessage(const QString &text)
a pages title has changed
progress
bool progress
Definition: mythcommflag.cpp:69
BrowserApi::GetVolume
int GetVolume(void)
Definition: mythuiwebbrowser.cpp:175
MythUIWebBrowser::m_horizontalScrollbar
MythUIScrollBar * m_horizontalScrollbar
Definition: mythuiwebbrowser.h:246
MythUIWebBrowser::CanGoBack
bool CanGoBack(void)
Can we go backward in page history.
Definition: mythuiwebbrowser.cpp:1237
MythMainWindow::GetStackCount
int GetStackCount()
Definition: mythmainwindow.cpp:310
MythPainter::GetFormatImage
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
Definition: mythpainter.cpp:540
MythUIWebBrowser::m_browserArea
MythRect m_browserArea
Definition: mythuiwebbrowser.h:223
MythUIWebBrowser::loadProgress
void loadProgress(int progress)
a page has finished loading
MythUIBusyDialog::Create
bool Create(void) override
Definition: mythprogressdialog.cpp:32
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
MythUIWebBrowser::slotScrollBarHiding
void slotScrollBarHiding(void)
Definition: mythuiwebbrowser.cpp:1391
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
MythWebView
Subclass of QWebView.
Definition: mythuiwebbrowser.h:88
MythUIWebBrowser::m_userCssFile
QString m_userCssFile
Definition: mythuiwebbrowser.h:237
GetNetworkAccessManager
static QNetworkAccessManager * GetNetworkAccessManager(void)
Definition: mythuiwebbrowser.cpp:100
MythDownloadManager::queueDownload
void queueDownload(const QString &url, const QString &dest, QObject *caller, bool reload=false)
Adds a url to the download queue.
Definition: mythdownloadmanager.cpp:393
MythWebView::handleUnsupportedContent
void handleUnsupportedContent(QNetworkReply *reply)
Definition: mythuiwebbrowser.cpp:459
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
MythUIType::GetPainter
virtual MythPainter * GetPainter(void)
Definition: mythuitype.cpp:1421
MythWebView::m_parentBrowser
MythUIWebBrowser * m_parentBrowser
Definition: mythuiwebbrowser.h:118
MythUIWebBrowser::m_inputToggled
bool m_inputToggled
Definition: mythuiwebbrowser.h:241
MythUIType::SetCanTakeFocus
void SetCanTakeFocus(bool set=true)
Set whether this widget can take focus.
Definition: mythuitype.cpp:357
BrowserApi::m_gotAnswer
bool m_gotAnswer
Definition: mythuiwebbrowser.h:54
mythuiscrollbar.h
MythUIWebBrowser::SetDefaultSaveDirectory
void SetDefaultSaveDirectory(const QString &saveDir)
Definition: mythuiwebbrowser.cpp:1194
MythWebView::openBusyPopup
void openBusyPopup(const QString &message)
Definition: mythuiwebbrowser.cpp:576
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythWebView::showDownloadMenu
void showDownloadMenu(void)
Definition: mythuiwebbrowser.cpp:697
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythWebView::m_api
BrowserApi * m_api
Definition: mythuiwebbrowser.h:119
XMLParseBase::GetGlobalObjectStore
static MythUIType * GetGlobalObjectStore(void)
Definition: xmlparsebase.cpp:350
MimeType::m_isVideo
bool m_isVideo
Definition: mythuiwebbrowser.cpp:47
MythUIWebBrowser::CopyFrom
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Definition: mythuiwebbrowser.cpp:1787
MythUIWebBrowser::slotLoadProgress
void slotLoadProgress(int progress)
Definition: mythuiwebbrowser.cpp:1359
MythUIWebBrowser::titleChanged
void titleChanged(const QString &title)
% of page loaded
build_compdb.file
file
Definition: build_compdb.py:55
mythdirs.h
BrowserApi::m_answer
QString m_answer
Definition: mythuiwebbrowser.h:55
MythWebView::doDownload
void doDownload(const QString &saveFilename)
Definition: mythuiwebbrowser.cpp:563
MythUIType::Pulse
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:455
mythprogressdialog.h
MythEvent::Message
const QString & Message() const
Definition: mythevent.h:65
MythUIWebBrowser::m_defaultSaveDir
QString m_defaultSaveDir
Definition: mythuiwebbrowser.h:238
MythMainWindow::HandleMedia
bool HandleMedia(const QString &Handler, const QString &Mrl, const QString &Plot="", const QString &Title="", const QString &Subtitle="", const QString &Director="", int Season=0, int Episode=0, const QString &Inetref="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
Definition: mythmainwindow.cpp:1489
SupportedMimeTypes
static const std::vector< MimeType > SupportedMimeTypes
Definition: mythuiwebbrowser.cpp:51
MythWebPage::~MythWebPage
~MythWebPage() override
Definition: mythuiwebbrowser.cpp:276
MimeType::m_extension
QString m_extension
Definition: mythuiwebbrowser.cpp:46
MythObservable::addListener
void addListener(QObject *listener)
Add a listener to the observable.
Definition: mythobservable.cpp:38
BrowserApi::SetVolume
static void SetVolume(int volumn)
Definition: mythuiwebbrowser.cpp:168
BrowserApi::setWebView
void setWebView(QWebView *view)
Definition: mythuiwebbrowser.cpp:135
BrowserApi
Adds a JavaScript object.
Definition: mythuiwebbrowser.h:23
MythUIWebBrowser::GetZoom
float GetZoom(void) const
Get the current zoom level.
Definition: mythuiwebbrowser.cpp:1214
MythUIWebBrowser::LoadPage
void LoadPage(const QUrl &url)
Loads the specified url and displays it.
Definition: mythuiwebbrowser.cpp:1046
MythNetworkAccessManager
Definition: mythuiwebbrowser.h:58
MythUIWebBrowser::m_lastUpdateTime
QElapsedTimer m_lastUpdateTime
Definition: mythuiwebbrowser.h:231
MythUIWebBrowser::evaluateJavaScript
QVariant evaluateJavaScript(const QString &scriptSource)
Evaluates the JavaScript code in scriptSource.
Definition: mythuiwebbrowser.cpp:1308
MythUIWebBrowser::SetDefaultSaveFilename
void SetDefaultSaveFilename(const QString &filename)
Definition: mythuiwebbrowser.cpp:1202
mythfontproperties.h
MythWebView::createWindow
QWebView * createWindow(QWebPage::WebWindowType type) override
Definition: mythuiwebbrowser.cpp:786
mythlogging.h
MythUIWebBrowser::DrawSelf
void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect) override
Definition: mythuiwebbrowser.cpp:1507
MythUIWebBrowser::ZoomOut
void ZoomOut(void)
Decrease the text size.
Definition: mythuiwebbrowser.cpp:1164
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
MythUIWebBrowser::m_zoom
float m_zoom
Definition: mythuiwebbrowser.h:234
MythUIType::Refresh
void Refresh(void)
Definition: mythuitype.cpp:1054
MythUIAnimation::IsActive
bool IsActive() const
Definition: mythuianimation.h:59
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1104
hardwareprofile.config.p
p
Definition: config.py:33
MythUIWebBrowser::m_wasActive
bool m_wasActive
Definition: mythuiwebbrowser.h:229
MythWebView::isMusicFile
static bool isMusicFile(const QString &extension, const QString &mimetype)
Definition: mythuiwebbrowser.cpp:742
MythUIType::Showing
void Showing()
MythWebView::isVideoFile
static bool isVideoFile(const QString &extension, const QString &mimetype)
Definition: mythuiwebbrowser.cpp:757
MythUIWebBrowser::m_destinationScrollPos
QPoint m_destinationScrollPos
Definition: mythuiwebbrowser.h:249
MythUIWebBrowser::ZoomIn
void ZoomIn(void)
Increase the text size.
Definition: mythuiwebbrowser.cpp:1156
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
menu
static MythThemedMenu * menu
Definition: mythtv-setup.cpp:58
MythWebView::m_webpage
MythWebPage * m_webpage
Definition: mythuiwebbrowser.h:117
MythUIWebBrowser::GetIcon
QIcon GetIcon(void)
Gets the current page's fav icon.
Definition: mythuiwebbrowser.cpp:1271
MythScreenStack::topScreenChanged
void topScreenChanged(MythScreenType *screen)
MythUIWebBrowser::UpdateScrollBars
void UpdateScrollBars(void)
Definition: mythuiwebbrowser.cpp:1430
MythUIScrollBar::SetSliderPosition
void SetSliderPosition(int value)
Definition: mythuiscrollbar.cpp:70
MythUIWebBrowser::iconChanged
void iconChanged(void)
link hit test messages
MythWebView::getExtensionForMimetype
static QString getExtensionForMimetype(const QString &mimetype)
Definition: mythuiwebbrowser.cpp:729
MythUIWebBrowser::Finalize
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
Definition: mythuiwebbrowser.cpp:846
BrowserApi::Pause
static void Pause(void)
Definition: mythuiwebbrowser.cpp:162
XMLParseBase::getFirstText
static QString getFirstText(QDomElement &element)
Definition: xmlparsebase.cpp:52
MythUIWebBrowser::m_verticalScrollbar
MythUIScrollBar * m_verticalScrollbar
Definition: mythuiwebbrowser.h:247
MythImage::DecrRef
int DecrRef(void) override
Decrements reference count and deletes on 0.
Definition: mythimage.cpp:52
MythUIWebBrowser::GetUrl
QUrl GetUrl(void)
Gets the current page's url.
Definition: mythuiwebbrowser.cpp:1284
BrowserApi::PlayTrack
static void PlayTrack(int trackID)
Definition: mythuiwebbrowser.cpp:205
MythRect::CalculateArea
void CalculateArea(QRect parentArea)
Definition: mythrect.cpp:64
BrowserApi::BrowserApi
BrowserApi(QObject *parent)
Definition: mythuiwebbrowser.cpp:124
BrowserApi::Stop
static void Stop(void)
Definition: mythuiwebbrowser.cpp:156
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1174
MythUIWebBrowser::slotLinkClicked
void slotLinkClicked(const QUrl &url)
Definition: mythuiwebbrowser.cpp:1374
MythUIBusyDialog
Definition: mythprogressdialog.h:36
MythUIWebBrowser::m_bgColor
QColor m_bgColor
Definition: mythuiwebbrowser.h:235
mythpainter.h
MythUIWebBrowser::Init
void Init(void)
Initializes the widget ready for use.
Definition: mythuiwebbrowser.cpp:860
BrowserApi::GetMetadata
QString GetMetadata(void)
Definition: mythuiwebbrowser.cpp:219
MythWebPage::MythWebPage
MythWebPage(QObject *parent=nullptr)
Definition: mythuiwebbrowser.cpp:270
MythUIWebBrowser::LoadUserStyleSheet
void LoadUserStyleSheet(const QUrl &url)
Sets the specified user style sheet.
Definition: mythuiwebbrowser.cpp:1076
XMLParseBase::parseRect
static MythRect parseRect(const QString &text, bool normalize=true)
Definition: xmlparsebase.cpp:136
MythImage::SetChanged
virtual void SetChanged(bool change=true)
Definition: mythimage.h:50
MythUIType::Hiding
void Hiding()
MythWebView::m_downloadAndPlay
bool m_downloadAndPlay
Definition: mythuiwebbrowser.h:123
MythWebPage::supportsExtension
bool supportsExtension(Extension extension) const override
Definition: mythuiwebbrowser.cpp:283
MythWebView::m_downloadReply
QNetworkReply * m_downloadReply
Definition: mythuiwebbrowser.h:121
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
MythUIWebBrowser::loadStarted
void loadStarted(void)
MythUIWebBrowser::slotStatusBarMessage
void slotStatusBarMessage(const QString &text)
Definition: mythuiwebbrowser.cpp:1369
MythUIWebBrowser::HandleMouseAction
void HandleMouseAction(const QString &action)
Definition: mythuiwebbrowser.cpp:1655
BrowserApi::~BrowserApi
~BrowserApi(void) override
Definition: mythuiwebbrowser.cpp:130
MythMainWindow::GetStackAt
MythScreenStack * GetStackAt(int Position)
Definition: mythmainwindow.cpp:328
MythUIWebBrowser::m_updateInterval
int m_updateInterval
Definition: mythuiwebbrowser.h:232
MythUIWebBrowser::m_defaultSaveFilename
QString m_defaultSaveFilename
Definition: mythuiwebbrowser.h:239
MythUIWebBrowser::GetTitle
QString GetTitle(void)
Gets the current page's title.
Definition: mythuiwebbrowser.cpp:1297
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:912
MythUIWebBrowser::slotTopScreenChanged
void slotTopScreenChanged(MythScreenType *screen)
Definition: mythuiwebbrowser.cpp:1397
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
MythUIType::Hide
void Hide(void)
Definition: mythuitype.cpp:1142
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
MythUIWebBrowser::GetDefaultSaveFilename
QString GetDefaultSaveFilename(void)
Definition: mythuiwebbrowser.h:174
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:906
mythuihelper.h
MythUIWebBrowser::m_actualBrowserArea
MythRect m_actualBrowserArea
Definition: mythuiwebbrowser.h:224
MythUIScrollBar::SetPageStep
void SetPageStep(int value)
Definition: mythuiscrollbar.cpp:46
kgetType
const QString kgetType
Key event handler.
Definition: mythuiwebbrowser.cpp:385
MythUIWebBrowser::loadFinished
void loadFinished(bool ok)
a page is starting to load
mythimage.h
MythWebView::doDownloadRequested
void doDownloadRequested(const QNetworkRequest &request)
Definition: mythuiwebbrowser.cpp:489
MythDownloadManager::loadCookieJar
void loadCookieJar(const QString &filename)
Loads the cookie jar from a cookie file.
Definition: mythdownloadmanager.cpp:1641
MythUIThemeHelper::FindThemeFile
bool FindThemeFile(QString &Path)
Definition: mythuithemehelper.cpp:236
MythUIAnimation::IncrementCurrentTime
void IncrementCurrentTime(void)
Definition: mythuianimation.cpp:97
MythUIWebBrowser::ParseElement
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuiwebbrowser.cpp:1736
mythcorecontext.h
networkManager
static MythNetworkAccessManager * networkManager
Definition: mythuiwebbrowser.cpp:89
MythUIWebBrowser::m_parentScreen
MythScreenType * m_parentScreen
Definition: mythuiwebbrowser.h:220
MythPainter
Definition: mythpainter.h:34
BrowserApi::m_frame
QWebFrame * m_frame
Definition: mythuiwebbrowser.h:52
MythWebView::customEvent
void customEvent(QEvent *e) override
Definition: mythuiwebbrowser.cpp:601
MythUIScrollBar::SetMaximum
void SetMaximum(int value)
Definition: mythuiscrollbar.cpp:58
BrowserApi::PlayURL
static void PlayURL(const QString &url)
Definition: mythuiwebbrowser.cpp:212
MythUIWebBrowser::slotLoadFinished
void slotLoadFinished(bool Ok)
Definition: mythuiwebbrowser.cpp:1353
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
MythUIWebBrowser::m_widgetUrl
QUrl m_widgetUrl
Definition: mythuiwebbrowser.h:236
MythUIWebBrowser::Back
void Back(void)
Got backward in page history.
Definition: mythuiwebbrowser.cpp:1248
MythUIWebBrowser::~MythUIWebBrowser
~MythUIWebBrowser() override
the classes destructor
Definition: mythuiwebbrowser.cpp:1025
MythNetworkAccessManager::createRequest
QNetworkReply * createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData=nullptr) override
Definition: mythuiwebbrowser.cpp:82
MythUIWebBrowser::Scroll
void Scroll(int dx, int dy)
Definition: mythuiwebbrowser.cpp:1318
MythUIWebBrowser::MythUIWebBrowser
MythUIWebBrowser(MythUIType *parent, const QString &name)
the classes constructor
Definition: mythuiwebbrowser.cpp:831
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:102
MythDownloadManager::refreshCookieJar
void refreshCookieJar(QNetworkCookieJar *jar)
Refresh the temporary cookie jar from another cookie jar.
Definition: mythdownloadmanager.cpp:1694
build_compdb.action
action
Definition: build_compdb.py:9
MimeType::m_mimeType
QString m_mimeType
Definition: mythuiwebbrowser.cpp:45
MythUIWebBrowser::m_scrollAnimation
MythUIAnimation m_scrollAnimation
Definition: mythuiwebbrowser.h:248
MythWebView::~MythWebView
~MythWebView(void) override
Definition: mythuiwebbrowser.cpp:375
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:320
MythUIWebBrowser::m_browser
MythWebView * m_browser
Definition: mythuiwebbrowser.h:222
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:838
MythUIWebBrowser::m_active
bool m_active
Definition: mythuiwebbrowser.h:228
MythDownloadManager::saveCookieJar
void saveCookieJar(const QString &filename)
Saves the cookie jar to a cookie file.
Definition: mythdownloadmanager.cpp:1653
MythUIWebBrowser::Pulse
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuiwebbrowser.cpp:1478
MythWebView::m_busyPopup
MythUIBusyDialog * m_busyPopup
Definition: mythuiwebbrowser.h:122
MythThemedMenuState::Create
bool Create(void) override
Definition: myththemedmenu.cpp:34
MythUIWebBrowser::ResetScrollBars
void ResetScrollBars(void)
Definition: mythuiwebbrowser.cpp:1718
MythUIAnimation::Activate
void Activate(void)
Definition: mythuianimation.cpp:49
MythUIWebBrowser
Web browsing widget.
Definition: mythuiwebbrowser.h:132
BrowserApi::customEvent
void customEvent(QEvent *e) override
Definition: mythuiwebbrowser.cpp:242
MythCoreContext::GetFloatSetting
double GetFloatSetting(const QString &key, double defaultval=0.0)
Definition: mythcorecontext.cpp:919
MythTextInputDialog
Dialog prompting the user to enter a text string.
Definition: mythdialogbox.h:314
MythUIWebBrowser::m_lastMouseActionTime
QElapsedTimer m_lastMouseActionTime
Definition: mythuiwebbrowser.h:244
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:881
MythWebView::MythWebView
MythWebView(QWidget *parent, MythUIWebBrowser *parentBrowser)
Definition: mythuiwebbrowser.cpp:355
MythImage::Assign
void Assign(const QImage &img)
Definition: mythimage.cpp:77
DestroyNetworkAccessManager
static void DestroyNetworkAccessManager(void)
Definition: mythuiwebbrowser.cpp:91
MythUIWebBrowser::slotLoadStarted
void slotLoadStarted(void)
a file has been downloaded
Definition: mythuiwebbrowser.cpp:1347
MythWebView::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Definition: mythuiwebbrowser.cpp:394
mythdownloadmanager.h
MythUIType::ParseElement
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitype.cpp:1240
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:66
BrowserApi::Play
static void Play(void)
Definition: mythuiwebbrowser.cpp:150
mythuiwebbrowser.h
MythUIWebBrowser::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythuiwebbrowser.cpp:1523
build_compdb.filename
filename
Definition: build_compdb.py:21
MythWebView::handleDownloadRequested
void handleDownloadRequested(const QNetworkRequest &request)
Definition: mythuiwebbrowser.cpp:483
mythmainwindow.h
MythUIWebBrowser::IsOnTopScreen
bool IsOnTopScreen(void)
is our containing screen the top screen?
Definition: mythuiwebbrowser.cpp:1410
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:308
XMLParseBase::parseBool
static bool parseBool(const QString &text)
Definition: xmlparsebase.cpp:64
MythUIWebBrowser::SetBackgroundColor
void SetBackgroundColor(QColor color)
Sets the default background color.
Definition: mythuiwebbrowser.cpp:1093
MythCoreContext::dispatch
void dispatch(const MythEvent &event)
Definition: mythcorecontext.cpp:1725
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:563
output
#define output
Definition: synaesthesia.cpp:220
MythObservable::removeListener
void removeListener(QObject *listener)
Remove a listener to the observable.
Definition: mythobservable.cpp:55
MythWebView::m_downloadRequest
QNetworkRequest m_downloadRequest
Definition: mythuiwebbrowser.h:120
MythUIWebBrowser::slotIconChanged
void slotIconChanged(void)
Definition: mythuiwebbrowser.cpp:1379
MythUIType::Finalize
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
Definition: mythuitype.cpp:1316
MythUIWebBrowser::m_lastMouseAction
QString m_lastMouseAction
Definition: mythuiwebbrowser.h:242
BrowserApi::attachObject
void attachObject()
Definition: mythuiwebbrowser.cpp:145
MythUIScrollBar::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuiscrollbar.cpp:15
MythUIWebBrowser::m_image
MythImage * m_image
Definition: mythuiwebbrowser.h:226
BrowserApi::PlayFile
static void PlayFile(const QString &filename)
Definition: mythuiwebbrowser.cpp:198
GetMythDownloadManager
MythDownloadManager * GetMythDownloadManager(void)
Gets the pointer to the MythDownloadManager singleton.
Definition: mythdownloadmanager.cpp:145
MythScreenStack::GetTopScreen
virtual MythScreenType * GetTopScreen(void) const
Definition: mythscreenstack.cpp:180