Akonadi

abstractsearchplugin.h
1 /*
2  SPDX-FileCopyrightText: 2013 Daniel Vr├ítil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QObject>
10 #include <QSet>
11 #include <QStringList>
12 
13 namespace Akonadi
14 {
15 /**
16  * @class AbstractSearchPlugin
17  *
18  * 3rd party applications can install a search plugin for Akonadi server to
19  * provide access to their search capability.
20  *
21  * When the server performs a search, it will send the query to all available
22  * search plugins and merge the results.
23  *
24  * @since 1.12
25  */
27 {
28 public:
29  /**
30  * Destructor.
31  */
32  virtual ~AbstractSearchPlugin() = default;
33 
34  /**
35  * Reimplement this method to provide the actual search capability.
36  *
37  * The implementation can block.
38  *
39  * @param query Search query to execute.
40  * @return List of Akonadi Item IDs referring to items that are matching
41  * the query.
42  */
43  virtual QSet<qint64> search(const QString &query, const QVector<qint64> &collections, const QStringList &mimeTypes) = 0;
44 
45 protected:
46  explicit AbstractSearchPlugin() = default;
47 
48 private:
49  Q_DISABLE_COPY_MOVE(AbstractSearchPlugin)
50 };
51 
52 }
53 
54 Q_DECLARE_INTERFACE(Akonadi::AbstractSearchPlugin, "org.freedesktop.Akonadi.AbstractSearchPlugin")
55 
virtual ~AbstractSearchPlugin()=default
Destructor.
virtual QSet< qint64 > search(const QString &query, const QVector< qint64 > &collections, const QStringList &mimeTypes)=0
Reimplement this method to provide the actual search capability.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:31 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.