1 // Copyright 2005-2019 The Mumble Developers. All rights reserved.
2 // Use of this source code is governed by a BSD-style license
3 // that can be found in the LICENSE file at the root of the
4 // Mumble source tree or at <https://www.mumble.info/LICENSE>.
5 
6 #ifndef MUMBLE_MUMBLE_OVERLAYCONFIG_H_
7 #define MUMBLE_MUMBLE_OVERLAYCONFIG_H_
8 
9 #include "OverlayText.h"
10 #include "ConfigWidget.h"
11 
12 #include "ui_Overlay.h"
13 
14 class OverlayUserGroup;
15 struct OverlayAppInfo;
16 class OverlayPositionableItem;
17 
18 class OverlayConfig : public ConfigWidget, public Ui::OverlayConfig {
19 	private:
20 		Q_OBJECT
21 		Q_DISABLE_COPY(OverlayConfig)
22 
23 		void initDisplay();
24 		void initDisplayFps();
25 		void initDisplayClock();
26 		void refreshFpsDemo();
27 		void refreshFpsLive();
28 		void refreshTimeLive();
29 		void addWhitelistPath(const QString & path);
30 	protected:
31 		QPixmap qpScreen;
32 		QGraphicsPixmapItem *qgpiScreen;
33 		QGraphicsScene qgs;
34 		QGraphicsScene qgsFpsPreview;
35 		BasepointPixmap bpFpsDemo;
36 		BasepointPixmap bpTimeDemo;
37 		QGraphicsPixmapItem *qgpiFpsDemo;
38 		OverlayPositionableItem *qgpiFpsLive;
39 		OverlayPositionableItem *qgpiTimeLive;
40 		OverlayUserGroup *oug;
41 		QGraphicsTextItem *qgtiInstructions;
42 
43 		float fViewScale;
44 
45 		bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
46 
47 		bool supportsInstallableOverlay();
48 		bool isInstalled();
49 		bool needsUpgrade();
50 		bool installFiles();
51 		bool uninstallFiles();
52 		bool supportsCertificates();
53 		bool installerIsValid();
54 		void showCertificates();
55 
56 		void updateOverlayExclusionModeState();
57 	protected slots:
58 		void on_qpbInstall_clicked();
59 		void on_qpbUninstall_clicked();
60 
61 		void on_qcbOverlayExclusionMode_currentIndexChanged(int);
62 
63 		void on_qlwLaunchers_itemSelectionChanged();
64 		void on_qpbLaunchersAdd_clicked();
65 		void on_qpbLaunchersRemove_clicked();
66 
67 		void on_qlwWhitelist_itemSelectionChanged();
68 		void on_qpbWhitelistAdd_clicked();
69 		void on_qpbWhitelistRemove_clicked();
70 
71 		void on_qlwPaths_itemSelectionChanged();
72 		void on_qpbPathsAdd_clicked();
73 		void on_qpbPathsRemove_clicked();
74 
75 		void on_qlwBlacklist_itemSelectionChanged();
76 		void on_qpbBlacklistAdd_clicked();
77 		void on_qpbBlacklistRemove_clicked();
78 
79 		void on_qcbEnable_stateChanged(int);
80 		void on_qcbShowFps_stateChanged(int);
81 		void on_qcbShowTime_stateChanged(int);
82 		void on_qpbFpsFont_clicked();
83 		void on_qpbFpsColor_clicked();
84 		void on_qpbLoadPreset_clicked();
85 		void on_qpbSavePreset_clicked();
86 		void resizeScene(bool force=false);
87 
88 	public:
89 		OverlayConfig(Settings &st);
90 		virtual QString title() const Q_DECL_OVERRIDE;
91 		virtual QIcon icon() const Q_DECL_OVERRIDE;
92 	public slots:
93 		void accept() const Q_DECL_OVERRIDE;
94 		void save() const Q_DECL_OVERRIDE;
95 		void load(const Settings &r) Q_DECL_OVERRIDE;
96 };
97 
98 #endif
99