LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
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 
16 class QAbstractItemModel;
17 
18 namespace LC
19 {
26  struct Request
27  {
30  enum Type
31  {
36  };
37 
41 
45 
48  QString Plugin_;
49 
52  QString Category_;
53 
56  QString String_;
59  QHash<QString, QVariant> Params_;
60  };
61 }
62 
69 class Q_DECL_EXPORT IFindProxy
70 {
71 public:
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 
114 typedef std::shared_ptr<IFindProxy> IFindProxy_ptr;
115 
123 class Q_DECL_EXPORT IFinder
124 {
125 public:
126  virtual ~IFinder () {}
127 
138  virtual QStringList GetCategories () const = 0;
139 
152  virtual QList<IFindProxy_ptr> GetProxy (const LC::Request& r) = 0;
153 
160  virtual void categoriesChanged (const QStringList& newCats,
161  const QStringList& oldCats) = 0;
162 };
163 
164 Q_DECLARE_INTERFACE (IFinder, "org.Deviant.LeechCraft.IFinder/1.0")
165 Q_DECLARE_INTERFACE (IFindProxy, "org.Deviant.LeechCraft.IFinder/1.0")
166 
167 #endif
168 
IFinder
Base class for search providers.
Definition: ifinder.h:123
LC::Request::String_
QString String_
Definition: ifinder.h:56
LC::Request
Describes the elementary subrequest.
Definition: ifinder.h:26
QList
Definition: ianrulesstorage.h:14
LC::Request::Type
Type
Definition: ifinder.h:30
IFindProxy
Represents search results for a single Request.
Definition: ifinder.h:69
LC::Request::Category_
QString Category_
Definition: ifinder.h:52
LC::Request::Type_
Type Type_
Definition: ifinder.h:44
LC::Request::Params_
QHash< QString, QVariant > Params_
Definition: ifinder.h:59
IFindProxy::~IFindProxy
virtual ~IFindProxy()
Definition: ifinder.h:72
LC::Request::RTRegexp
@ RTRegexp
Regular expression.
Definition: ifinder.h:34
LC::Request::RTTag
@ RTTag
Tag filtering.
Definition: ifinder.h:35
IFinder::~IFinder
virtual ~IFinder()
Definition: ifinder.h:126
IFindProxy_ptr
std::shared_ptr< IFindProxy > IFindProxy_ptr
Definition: ifinder.h:114
LC
Definition: constants.h:14
LC::Request::CaseSensitive_
bool CaseSensitive_
Definition: ifinder.h:40
LC::Request::RTWildcard
@ RTWildcard
Wildcard.
Definition: ifinder.h:33
LC::Request::RTFixed
@ RTFixed
Fixed string.
Definition: ifinder.h:32
LC::Request::Plugin_
QString Plugin_
Definition: ifinder.h:48