File indexing completed on 2024-11-24 04:34:30
0001 /*************************************************************************** 0002 * SPDX-License-Identifier: GPL-2.0-or-later 0003 * * 0004 * SPDX-FileCopyrightText: 2004-2023 Thomas Fischer <fischer@unix-ag.uni-kl.de> 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published by * 0008 * the Free Software Foundation; either version 2 of the License, or * 0009 * (at your option) any later version. * 0010 * * 0011 * This program 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 * 0014 * GNU General Public License for more details. * 0015 * * 0016 * You should have received a copy of the GNU General Public License * 0017 * along with this program; if not, see <https://www.gnu.org/licenses/>. * 0018 ***************************************************************************/ 0019 0020 #ifndef KBIBTEX_NETWORKING_ONLINESEARCHARXIV_H 0021 #define KBIBTEX_NETWORKING_ONLINESEARCHARXIV_H 0022 0023 #include <onlinesearch/OnlineSearchAbstract> 0024 0025 #ifdef HAVE_KF 0026 #include "kbibtexnetworking_export.h" 0027 #endif // HAVE_KF 0028 0029 /** 0030 * @author Thomas Fischer <fischer@unix-ag.uni-kl.de> 0031 */ 0032 class KBIBTEXNETWORKING_EXPORT OnlineSearchArXiv : public OnlineSearchAbstract 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 explicit OnlineSearchArXiv(QObject *parent); 0038 ~OnlineSearchArXiv() override; 0039 0040 #ifdef HAVE_QTWIDGETS 0041 void startSearchFromForm() override; 0042 #endif // HAVE_QTWIDGETS 0043 void startSearch(const QMap<QueryKey, QString> &query, int numResults) override; 0044 QString label() const override; 0045 #ifdef HAVE_QTWIDGETS 0046 OnlineSearchAbstract::Form *customWidget(QWidget *parent) override; 0047 #endif // HAVE_QTWIDGETS 0048 QUrl homepage() const override; 0049 0050 #ifdef BUILD_TESTING 0051 // KBibTeXNetworkingTest::onlineSearchArXivAtomRSSparsing makes use of this function to test parsing Atom XML data 0052 QVector<QSharedPointer<Entry>> parseAtomXML(const QByteArray &xmlData, bool *ok = nullptr); 0053 #endif // BUILD_TESTING 0054 0055 private: 0056 #ifdef HAVE_QTWIDGETS 0057 class Form; 0058 #endif // HAVE_QTWIDGETS 0059 class OnlineSearchArXivPrivate; 0060 OnlineSearchArXivPrivate *d; 0061 0062 private Q_SLOTS: 0063 void downloadDone(); 0064 }; 0065 0066 #endif // KBIBTEX_NETWORKING_ONLINESEARCHARXIV_H