LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
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>
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
}
IWebBrowser
Base class for plugins that provide a web browser.
Definition
iwebbrowser.h:84
LC::Util::SelectableBrowser::SetHtml
void SetHtml(const QString &html, const QUrl &base=QUrl())
Sets the HTML content to display.
Definition
selectablebrowser.cpp:43
LC::Util::SelectableBrowser::SetEverythingElseVisible
void SetEverythingElseVisible(bool visible)
Sets whether other UI elements should be visible.
Definition
selectablebrowser.cpp:58
LC::Util::SelectableBrowser::SetNavBarVisible
void SetNavBarVisible(bool visible)
Sets whether navigation bar should be visible.
Definition
selectablebrowser.cpp:50
LC::Util::SelectableBrowser::SelectableBrowser
SelectableBrowser(QWidget *parent=nullptr)
Constructs the browser with the given parent.
Definition
selectablebrowser.cpp:15
LC::Util::SelectableBrowser::Construct
void Construct(IWebBrowser *browser)
Initialize the widget with the browser plugin.
Definition
selectablebrowser.cpp:26
guiconfig.h
UTIL_GUI_API
#define UTIL_GUI_API
Definition
guiconfig.h:16
iwebbrowser.h
LC::Util
Definition
icoreproxy.h:34
src
util
gui
selectablebrowser.h
Generated by
1.17.0