LeechCraft 0.6.70-17335-ge406ffdcaf
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
iwebbrowser.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 <QString>
13#include <QWidget>
14#include <QUrl>
15#include <QtPlugin>
16
23class Q_DECL_EXPORT IWebWidget
24{
25public:
26 virtual ~IWebWidget () = default;
27
34 virtual void Load (const QUrl& url) = 0;
35
45 virtual void SetHtml (const QString& html, const QUrl& base = {}) = 0;
46
54 virtual void SetNavBarVisible (bool visible) = 0;
55
64 virtual void SetEverythingElseVisible (bool visible) = 0;
65
70 virtual QWidget* GetQWidget () = 0;
71
76 virtual void urlChanged (const QUrl&) = 0;
77};
78
79class QWebView;
80
83class Q_DECL_EXPORT IWebBrowser
84{
85public:
86 virtual ~IWebBrowser () = default;
87
93 virtual std::unique_ptr<IWebWidget> CreateWidget () const = 0;
94};
95
96Q_DECLARE_INTERFACE (IWebWidget, "org.Deviant.LeechCraft.IWebWidget/1.0")
97Q_DECLARE_INTERFACE (IWebBrowser, "org.Deviant.LeechCraft.IWebBrowser/1.0")
Base class for plugins that provide a web browser.
Definition iwebbrowser.h:84
virtual ~IWebBrowser()=default
virtual std::unique_ptr< IWebWidget > CreateWidget() const =0
Returns the IWebWidget for use in another modules of LeechCraft.
Common interface for a web widget.
Definition iwebbrowser.h:24
virtual void SetHtml(const QString &html, const QUrl &base={})=0
Sets the contents of the web widget to the specified html.
virtual void SetNavBarVisible(bool visible)=0
Sets whether the navigation bar of the widget (where the address bar and reload/back/forward/etc butt...
virtual QWidget * GetQWidget()=0
Returns the IWebWidget as a QWidget.
virtual void SetEverythingElseVisible(bool visible)=0
Shows or hides every other panel in the browser but navbar.
virtual void Load(const QUrl &url)=0
Loads a given url.
virtual void urlChanged(const QUrl &)=0
Emitted when the URL rendered by the browser changes to @url.
virtual ~IWebWidget()=default