qBittorrent/src/gui/search/searchwidget.h

87 lines
2.8 KiB
C
Raw Normal View History

/*
* Bittorrent Client using Qt and libtorrent.
2020-10-17 00:21:10 -04:00
* Copyright (C) 2020, Will Da Silva <will@willdasilva.xyz>
* Copyright (C) 2015, 2018 Vladimir Golovnev <glassez@yandex.ru>
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* In addition, as a special exception, the copyright holders give permission to
* link this program with the OpenSSL project's "OpenSSL" library (or with
* modified versions of it that use the same license as the "OpenSSL" library),
* and distribute the linked executables. You must obey the GNU General Public
* License in all respects for all of the code used other than "OpenSSL". If you
* modify file(s), you may extend this exception to your version of the file(s),
* but you are not obligated to do so. If you do not wish to do so, delete this
* exception statement from your version.
*/
#pragma once
#include <QList>
#include <QPointer>
#include <QWidget>
2015-09-24 10:33:02 +03:00
2020-10-17 00:21:10 -04:00
class QEvent;
class QObject;
class QTabWidget;
2010-11-13 21:15:52 +00:00
class MainWindow;
class SearchJobWidget;
namespace Ui
{
class SearchWidget;
}
class SearchWidget : public QWidget
2015-09-24 10:33:02 +03:00
{
2015-04-11 14:26:25 +03:00
Q_OBJECT
2015-08-26 20:05:57 +03:00
Q_DISABLE_COPY(SearchWidget)
public:
2015-09-24 10:33:02 +03:00
explicit SearchWidget(MainWindow *mainWindow);
~SearchWidget() override;
2015-04-11 14:26:25 +03:00
void giveFocusToSearchInput();
private slots:
2015-09-24 10:33:02 +03:00
void on_searchButton_clicked();
void on_pluginsButton_clicked();
private:
2020-10-17 00:21:10 -04:00
bool eventFilter(QObject *object, QEvent *event) override;
void tabChanged(int index);
2015-04-11 14:26:25 +03:00
void closeTab(int index);
void tabStatusChanged(QWidget *tab);
void selectMultipleBox(int index);
void toggleFocusBetweenLineEdits();
2015-09-24 10:33:02 +03:00
2015-04-11 14:26:25 +03:00
void fillCatCombobox();
void fillPluginComboBox();
void selectActivePage();
void searchTextEdited(const QString &);
2015-09-24 10:33:02 +03:00
QString selectedCategory() const;
QString selectedPlugin() const;
Ui::SearchWidget *m_ui;
QPointer<SearchJobWidget> m_currentSearchTab; // Selected tab
QPointer<SearchJobWidget> m_activeSearchTab; // Tab with running search
QList<SearchJobWidget *> m_allTabs; // To store all tabs
2015-09-24 10:33:02 +03:00
MainWindow *m_mainWindow;
bool m_isNewQueryString;
};