LeechCraft 0.6.70-17609-g3dde4097dd
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
ientitymanager.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 <QObject>
12#include <QFuture>
13#include <util/sll/either.h>
15
16namespace LC
17{
18 struct Entity;
19}
20
31class Q_DECL_EXPORT IEntityManager
32{
33public:
37 {
42 QObject *Handler_ = nullptr;
43
47
48 explicit operator bool () const
49 {
50 return Handler_;
51 }
52 };
53
54 virtual ~IEntityManager () {}
55
72 virtual DelegationResult DelegateEntity (LC::Entity entity, QObject *desired = nullptr) = 0;
73
88 virtual bool HandleEntity (LC::Entity entity, QObject *desired = nullptr) = 0;
89
96 virtual bool CouldHandle (const LC::Entity& entity) = 0;
97
104 virtual QList<QObject*> GetPossibleHandlers (const LC::Entity& entity) = 0;
105};
106
107Q_DECLARE_INTERFACE (IEntityManager, "org.Deviant.LeechCraft.IEntityManager/1.0")
Proxy to core entity manager.
virtual bool HandleEntity(LC::Entity entity, QObject *desired=nullptr)=0
Handles the given entity.
virtual DelegationResult DelegateEntity(LC::Entity entity, QObject *desired=nullptr)=0
Delegates the given entity and returns the delegation result.
virtual QList< QObject * > GetPossibleHandlers(const LC::Entity &entity)=0
Queries what plugins can handle the given entity.
virtual ~IEntityManager()
virtual bool CouldHandle(const LC::Entity &entity)=0
Queries whether the given entity can be handled at all.
Definition constants.h:15
The result of delegating this entity to another plugin.
QObject * Handler_
The plugin instance object that handles this entity.
QFuture< IDownload::Result > DownloadResult_
A message used for inter-plugin communication.
Definition structures.h:96