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