LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
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 
19 class QQuickImageProvider;
20 
21 namespace 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 
108  QuarkComponent& operator= (QuarkComponent&& other) = default;
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 
142 class Q_DECL_EXPORT IQuarkComponentProvider
143 {
144 public:
148 
164  virtual LC::QuarkComponents_t GetComponents () const = 0;
165 };
166 
167 Q_DECLARE_INTERFACE (IQuarkComponentProvider, "org.Deviant.LeechCraft.IQuarkComponentProvider/1.0")
IQuarkComponentProvider::~IQuarkComponentProvider
virtual ~IQuarkComponentProvider()
Virtual destructor.
Definition: iquarkcomponentprovider.h:147
LC::Util::SysPath
SysPath
Describes various root paths recognized by GetSysPath().
Definition: paths.h:25
QList
Definition: ianrulesstorage.h:14
LC::QuarkComponent::Url_
QUrl Url_
URL of the main QML of this file.
Definition: iquarkcomponentprovider.h:62
LC::QuarkComponent::StaticProps_
QList< QPair< QString, QVariant > > StaticProps_
Statis properties to be exposed to the engine.
Definition: iquarkcomponentprovider.h:77
IQuarkComponentProvider
Interface for plugins providing quark components.
Definition: iquarkcomponentprovider.h:142
LC::QuarkComponents_t
QList< QuarkComponent_ptr > QuarkComponents_t
A list of quarks pointers.
Definition: iquarkcomponentprovider.h:137
LC::QuarkComponent::QuarkComponent
QuarkComponent()=default
Initializes a null quark component.
LC::QuarkComponent
Describes a single quark.
Definition: iquarkcomponentprovider.h:50
paths.h
LC::QuarkComponent::DynamicProps_
QList< QPair< QString, QObject * > > DynamicProps_
Dynamic properties to be exposed to the engine.
Definition: iquarkcomponentprovider.h:66
LC::Util::GetSysPathUrl
QUrl GetSysPathUrl(SysPath path, const QString &subfolder, const QString &filename)
Returns path to the file in the given root path and subfolder.
Definition: paths.cpp:75
LC::QuarkComponent::ImageProviders_
QList< QPair< QString, QQuickImageProvider * > > ImageProviders_
The image providers to be exposed to the engine.
Definition: iquarkcomponentprovider.h:85
LC
Definition: constants.h:14
LC::QuarkComponent::operator=
QuarkComponent & operator=(QuarkComponent &&other)=default
Move-assigns this quark component from other.
LC::QuarkComponent::QuarkComponent
QuarkComponent(const QString &subdir, const QString &filename)
Initializes a quark component for the given file path.
Definition: iquarkcomponentprovider.h:125
LC::QuarkComponent::ContextProps_
std::vector< std::pair< QString, std::unique_ptr< QObject > > > ContextProps_
Context-depended properties to be exposed to the engine.
Definition: iquarkcomponentprovider.h:70
LC::QuarkComponent_ptr
std::shared_ptr< QuarkComponent > QuarkComponent_ptr
A shared pointer to a quark.
Definition: iquarkcomponentprovider.h:133