Falkon Develop
Cross-platform Qt-based web browser
searchenginesdialog.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef SEARCHENGINESDIALOG_H
19#define SEARCHENGINESDIALOG_H
20
21#include "qzcommon.h"
23
24#include <QDialog>
25
26class QTreeWidgetItem;
27
28namespace Ui
29{
31}
32
33class FALKON_EXPORT SearchEnginesDialog : public QDialog
34{
35 Q_OBJECT
36
37public:
38 explicit SearchEnginesDialog(QWidget* parent = nullptr);
39 ~SearchEnginesDialog() override;
40
41public Q_SLOTS:
42 void accept() override;
43
44private Q_SLOTS:
45 void addEngine();
46 void removeEngine();
47 void editEngine();
48 void setDefaultEngine();
49
50 void moveUp();
51 void moveDown();
52
53 void defaults();
54
55private:
56 enum TreeRole { EngineRole = Qt::UserRole, DefaultRole = Qt::UserRole + 1 };
57
58 bool isDefaultEngine(QTreeWidgetItem* item);
59 SearchEngine getEngine(QTreeWidgetItem* item);
60
61 void setEngine(QTreeWidgetItem* item, const SearchEngine &engine);
62 void changeItemToDefault(QTreeWidgetItem* item, bool isDefault);
63
64 void reloadEngines();
65
66 void showEvent(QShowEvent *e) override;
67 void resizeEvent(QResizeEvent *e) override;
68 void resizeViewHeader();
69
70 Ui::SearchEnginesDialog* ui;
71 SearchEnginesManager* m_manager;
72};
73
74#endif // SEARCHENGINESDIALOG_H
#define FALKON_EXPORT
Definition: qzcommon.h:28