LeechCraft 0.6.70-17335-ge406ffdcaf
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
iquarkcomponentprovider.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 <vector>
12#include <utility>
13#include <memory>
14#include <QString>
15#include <QUrl>
16#include <QVariant>
17#include <util/sys/paths.h>
18
19class QQuickImageProvider;
20
21namespace LC
22{
51 {
52 public:
62 QUrl Url_;
63
67
70 std::vector<std::pair<QString, std::unique_ptr<QObject>>> ContextProps_;
71
78
86
89 QuarkComponent () = default;
90
98 QuarkComponent (QuarkComponent&& other) = default;
99
109
125 QuarkComponent (const QString& subdir, const QString& filename)
126 : Url_ (Util::GetSysPathUrl (Util::SysPath::QML, subdir, filename))
127 {
128 }
129 };
130
133 typedef std::shared_ptr<QuarkComponent> QuarkComponent_ptr;
134
138}
139
142class Q_DECL_EXPORT IQuarkComponentProvider
143{
144public:
148
165};
166
167Q_DECLARE_INTERFACE (IQuarkComponentProvider, "org.Deviant.LeechCraft.IQuarkComponentProvider/1.0")
Interface for plugins providing quark components.
virtual LC::QuarkComponents_t GetComponents() const =0
Returns the list of quarks provided by this plugin.
virtual ~IQuarkComponentProvider()
Virtual destructor.
QList< QPair< QString, QVariant > > StaticProps_
Statis properties to be exposed to the engine.
QuarkComponent(QuarkComponent &&other)=default
Move-constructs this quark component from other.
QuarkComponent(const QString &subdir, const QString &filename)
Initializes a quark component for the given file path.
QuarkComponent & operator=(QuarkComponent &&other)=default
Move-assigns this quark component from other.
QuarkComponent()=default
Initializes a null quark component.
QList< QPair< QString, QObject * > > DynamicProps_
Dynamic properties to be exposed to the engine.
QUrl Url_
URL of the main QML of this file.
std::vector< std::pair< QString, std::unique_ptr< QObject > > > ContextProps_
Context-depended properties to be exposed to the engine.
QList< QPair< QString, QQuickImageProvider * > > ImageProviders_
The image providers to be exposed to the engine.
Definition constants.h:15
std::shared_ptr< QuarkComponent > QuarkComponent_ptr
A shared pointer to a quark.
QList< QuarkComponent_ptr > QuarkComponents_t
A list of quarks pointers.