File indexing completed on 2024-05-19 05:00:22

0001 /*
0002     SPDX-FileCopyrightText: 2000 Yves Arrouye <yves@realnames.com>
0003     SPDX-FileCopyrightText: 2002, 2003 Dawit Alemayehu <adawit@kde.org>
0004     SPDX-FileCopyrightText: 2009 Nick Shaforostoff <shaforostoff@kde.ru>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef IKWSOPTS_H
0010 #define IKWSOPTS_H
0011 
0012 #include <QLayout>
0013 #include <QTabWidget>
0014 
0015 #include <KCModule>
0016 
0017 #include "searchproviderregistry.h"
0018 #include "ui_ikwsopts_ui.h"
0019 
0020 class SearchProvider;
0021 class ProvidersModel;
0022 
0023 class FilterOptions : public KCModule
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit FilterOptions(QObject *parent, const KPluginMetaData &data);
0029 
0030     void load() override;
0031     void save() override;
0032     void defaults() override;
0033 
0034 private Q_SLOTS:
0035     void updateSearchProviderEditingButons();
0036     void addSearchProvider();
0037     void changeSearchProvider();
0038     void deleteSearchProvider();
0039 
0040 private:
0041     void setDelimiter(char);
0042     char delimiter();
0043     void setDefaultEngine(int);
0044 
0045     // The names of the providers that the user deleted,
0046     // these are marked as deleted in the user's homedirectory
0047     // on save if a global service file exists for it.
0048     QStringList m_deletedProviders;
0049     ProvidersModel *m_providersModel;
0050     SearchProviderRegistry m_registry;
0051 
0052     Ui::FilterOptionsUI m_dlg;
0053     // Keep in sync with KIO!
0054     const QStringList m_defaultProviders{
0055         QStringLiteral("google"),
0056         QStringLiteral("youtube"),
0057         QStringLiteral("yahoo"),
0058         QStringLiteral("wikipedia"),
0059         QStringLiteral("wikit"),
0060     };
0061 };
0062 
0063 #endif