File indexing completed on 2024-05-05 16:48:34

0001 /* This file is part of the KDE project
0002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
0003    Copyright     2007       David Faure <faure@kde.org>
0004    Copyright (C) 2015 Jarosław Staniek <staniek@kde.org>
0005 
0006    This library is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU Library General Public
0008    License as published by the Free Software Foundation; either
0009    version 2 of the License, or (at your option) any later version.
0010 
0011    This library is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014    Library General Public License for more details.
0015 
0016    You should have received a copy of the GNU Library General Public License
0017    along with this library; see the file COPYING.LIB.  If not, write to
0018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0019  * Boston, MA 02110-1301, USA.
0020 */
0021 
0022 #ifndef KREPORTJSONTRADER_P_H
0023 #define KREPORTJSONTRADER_P_H
0024 
0025 #include <QList>
0026 #include <QString>
0027 
0028 class QPluginLoader;
0029 
0030 /**
0031  *  Support class to fetch a list of relevant plugins
0032  */
0033 class KReportJsonTrader
0034 {
0035 public:
0036     KReportJsonTrader();
0037     ~KReportJsonTrader();
0038     static KReportJsonTrader *self();
0039 
0040     /**
0041      * The main function in the KReportJsonTrader class.
0042      *
0043      * It will return a list of QPluginLoader objects that match your
0044      * specifications.  The only required parameter is the @a servicetype.
0045      * The @a mimetype parameter is used to limit the possible choices
0046      * returned based on the constraints you give it.
0047      *
0048      * The keys used in the query (Type, ServiceType, Exec) are all
0049      * fields found in the .desktop files.
0050      *
0051      * @param servicetype A service type like 'KMyApp/Plugin' or 'KFilePlugin'.
0052      * @param mimetype    A mimetype constraint to limit the choices returned, QString() to
0053      *                    get all services of the given @a servicetype.
0054      *
0055      * @return A list of QPluginLoader that satisfy the query
0056      * @see http://techbase.kde.org/Development/Tutorials/Services/Traders#The_KTrader_Query_Language
0057      */
0058      QList<QPluginLoader *> query(const QString &servicetype, const QString &mimetype = QString());
0059 
0060 private:
0061      Q_DISABLE_COPY(KReportJsonTrader)
0062      class Private;
0063      Private * const d;
0064 };
0065 
0066 #endif