LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
ifinder.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#ifndef INTERFACES_IFINDER_H
10#define INTERFACES_IFINDER_H
11#include <memory>
12#include <QStringList>
13#include <QHash>
14#include <QVariant>
15
16class QAbstractItemModel;
17
18namespace LC
19{
26 struct Request
27 {
37
41
45
48 QString Plugin_;
49
52 QString Category_;
53
56 QString String_;
59 QHash<QString, QVariant> Params_;
60 };
61}
62
69class Q_DECL_EXPORT IFindProxy
70{
71public:
72 virtual ~IFindProxy () {}
73
83 virtual QAbstractItemModel* GetModel () = 0;
84
101 virtual QByteArray GetUniqueSearchID () const = 0;
102
111 virtual QStringList GetCategories () const = 0;
112};
113
114typedef std::shared_ptr<IFindProxy> IFindProxy_ptr;
115
123class Q_DECL_EXPORT IFinder
124{
125public:
126 virtual ~IFinder () {}
127
138 virtual QStringList GetCategories () const = 0;
139
153
160 virtual void categoriesChanged (const QStringList& newCats,
161 const QStringList& oldCats) = 0;
162};
163
164Q_DECLARE_INTERFACE (IFinder, "org.Deviant.LeechCraft.IFinder/1.0")
165Q_DECLARE_INTERFACE (IFindProxy, "org.Deviant.LeechCraft.IFinder/1.0")
166
167#endif
168
Represents search results for a single Request.
Definition ifinder.h:70
virtual ~IFindProxy()
Definition ifinder.h:72
virtual QByteArray GetUniqueSearchID() const =0
Represents the unique ID of this finder type.
virtual QAbstractItemModel * GetModel()=0
virtual QStringList GetCategories() const =0
Returns the list of categories this proxy would return.
Base class for search providers.
Definition ifinder.h:124
virtual QList< IFindProxy_ptr > GetProxy(const LC::Request &r)=0
Returns find proxies for the given request.
virtual void categoriesChanged(const QStringList &newCats, const QStringList &oldCats)=0
This signal should be emitted by plugin after the list of categories has been updated.
virtual ~IFinder()
Definition ifinder.h:126
virtual QStringList GetCategories() const =0
Returns the plugin's categories.
std::shared_ptr< IFindProxy > IFindProxy_ptr
Definition ifinder.h:114
Definition constants.h:15
Describes the elementary subrequest.
Definition ifinder.h:27
bool CaseSensitive_
Definition ifinder.h:40
QHash< QString, QVariant > Params_
Definition ifinder.h:59
QString String_
Definition ifinder.h:56
QString Plugin_
Definition ifinder.h:48
@ RTWildcard
Wildcard.
Definition ifinder.h:33
@ RTTag
Tag filtering.
Definition ifinder.h:35
@ RTFixed
Fixed string.
Definition ifinder.h:32
@ RTRegexp
Regular expression.
Definition ifinder.h:34
Type Type_
Definition ifinder.h:44
QString Category_
Definition ifinder.h:52