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