1 /* ============================================================ 2 * StatusBarIcons - Extra icons in statusbar for Falkon 3 * Copyright (C) 2013-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 SBI_ICONSMANAGER_H 19 #define SBI_ICONSMANAGER_H 20 21 #include <QWidget> 22 #include <QHash> 23 24 class BrowserWindow; 25 class SBI_NetworkManager; 26 27 class SBI_IconsManager : public QObject 28 { 29 Q_OBJECT 30 public: 31 explicit SBI_IconsManager(const QString &settingsPath, QObject* parent = 0); 32 ~SBI_IconsManager(); 33 34 void loadSettings(); 35 36 bool showImagesIcon() const; 37 void setShowImagesIcon(bool show); 38 39 bool showJavaScriptIcon() const; 40 void setShowJavaScriptIcon(bool show); 41 42 bool showNetworkIcon() const; 43 void setShowNetworkIcon(bool show); 44 45 bool showZoomWidget() const; 46 void setShowZoomWidget(bool show); 47 48 void reloadIcons(); 49 void destroyIcons(); 50 51 public Q_SLOTS: 52 void mainWindowCreated(BrowserWindow* window); 53 void mainWindowDeleted(BrowserWindow* window); 54 55 private: 56 QString m_settingsPath; 57 bool m_showImagesIcon; 58 bool m_showJavaScriptIcon; 59 bool m_showNetworkIcon; 60 bool m_showZoomWidget; 61 62 QHash<BrowserWindow*, QWidgetList> m_windows; 63 SBI_NetworkManager* m_networkManager; 64 }; 65 66 #endif // SBI_ICONSMANAGER_H 67