LeechCraft  0.6.70-10870-g558588d6ec
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  * Boost Software License - Version 1.0 - August 17th, 2003
6  *
7  * Permission is hereby granted, free of charge, to any person or organization
8  * obtaining a copy of the software and accompanying documentation covered by
9  * this license (the "Software") to use, reproduce, display, distribute,
10  * execute, and transmit the Software, and to prepare derivative works of the
11  * Software, and to permit third-parties to whom the Software is furnished to
12  * do so, all subject to the following:
13  *
14  * The copyright notices in the Software and this entire statement, including
15  * the above license grant, this restriction and the following disclaimer,
16  * must be included in all copies of the Software, in whole or in part, and
17  * all derivative works of the Software, unless such copies or derivative
18  * works are solely in the form of machine-executable object code generated by
19  * a source language processor.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  **********************************************************************/
29 
30 #ifndef INTERFACES_IFINDER_H
31 #define INTERFACES_IFINDER_H
32 #include <memory>
33 #include <QStringList>
34 #include <QHash>
35 #include <QVariant>
36 
37 class QAbstractItemModel;
38 
39 namespace LeechCraft
40 {
47  struct Request
48  {
51  enum Type
52  {
57  };
58 
62 
66 
69  QString Plugin_;
70 
73  QString Category_;
74 
77  QString String_;
80  QHash<QString, QVariant> Params_;
81  };
82 }
83 
90 class Q_DECL_EXPORT IFindProxy
91 {
92 public:
93  virtual ~IFindProxy () {}
94 
104  virtual QAbstractItemModel* GetModel () = 0;
105 
122  virtual QByteArray GetUniqueSearchID () const = 0;
123 
132  virtual QStringList GetCategories () const = 0;
133 };
134 
135 typedef std::shared_ptr<IFindProxy> IFindProxy_ptr;
136 
144 class Q_DECL_EXPORT IFinder
145 {
146 public:
147  virtual ~IFinder () {}
148 
159  virtual QStringList GetCategories () const = 0;
160 
173  virtual QList<IFindProxy_ptr> GetProxy (const LeechCraft::Request& r) = 0;
174 
181  virtual void categoriesChanged (const QStringList& newCats,
182  const QStringList& oldCats) = 0;
183 };
184 
185 Q_DECLARE_INTERFACE (IFinder, "org.Deviant.LeechCraft.IFinder/1.0")
186 Q_DECLARE_INTERFACE (IFindProxy, "org.Deviant.LeechCraft.IFinder/1.0")
187 
188 #endif
189 
virtual ~IFindProxy()
Definition: ifinder.h:93
Regular expression.
Definition: ifinder.h:55
QHash< QString, QVariant > Params_
Definition: ifinder.h:80
QString Plugin_
Definition: ifinder.h:69
Base class for search providers.
Definition: ifinder.h:144
Represents search results for a single Request.
Definition: ifinder.h:90
std::shared_ptr< IFindProxy > IFindProxy_ptr
Definition: ifinder.h:135
virtual ~IFinder()
Definition: ifinder.h:147
QString Category_
Definition: ifinder.h:73
Describes the elementary subrequest.
Definition: ifinder.h:47
QString String_
Definition: ifinder.h:77
Tag filtering.
Definition: ifinder.h:56