LeechCraft  0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
selectablebrowser.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <memory>
12 #include <variant>
13 #include <QWidget>
14 #include <QTextBrowser>
15 #include <interfaces/iwebbrowser.h>
16 #include "guiconfig.h"
17 
18 namespace LC::Util
19 {
33  class UTIL_GUI_API SelectableBrowser : public QWidget
34  {
35  bool NavBarVisible_ = true;
36  bool EverythingElseVisible_ = true;
37 
38  using QTextBrowser_ptr = std::unique_ptr<QTextBrowser>;
39  using IWebWidget_ptr = std::unique_ptr<IWebWidget>;
40  std::variant<QTextBrowser_ptr, IWebWidget_ptr> Browser_;
41  public:
53  explicit SelectableBrowser (QWidget *parent = nullptr);
54 
68  void Construct (IWebBrowser *browser);
69 
76  void SetHtml (const QString& html, const QUrl& base = QUrl ());
77 
89  void SetNavBarVisible (bool visible);
90 
102  void SetEverythingElseVisible (bool visible);
103  private:
104  void PrepareInternal ();
105  };
106 }
A "browser" that shows HTML either via QTextBrowser or a browser plugin.
Base class for plugins that provide a web browser.
Definition: iwebbrowser.h:83
#define UTIL_GUI_API
Definition: guiconfig.h:16