LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
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>
16#include "guiconfig.h"
17
18namespace 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}
Base class for plugins that provide a web browser.
Definition iwebbrowser.h:84
void SetHtml(const QString &html, const QUrl &base=QUrl())
Sets the HTML content to display.
void SetEverythingElseVisible(bool visible)
Sets whether other UI elements should be visible.
void SetNavBarVisible(bool visible)
Sets whether navigation bar should be visible.
SelectableBrowser(QWidget *parent=nullptr)
Constructs the browser with the given parent.
void Construct(IWebBrowser *browser)
Initialize the widget with the browser plugin.
#define UTIL_GUI_API
Definition guiconfig.h:16