Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ConfigWidget.h « mumble « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3632921c6fbf156d07c53eebc779dc17857c6219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2005-2017 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#ifndef MUMBLE_MUMBLE_CONFIGWIDGET_H_
#define MUMBLE_MUMBLE_CONFIGWIDGET_H_

#include <QtCore/QtGlobal>
#include <QtCore/QObject>
#if QT_VERSION >= 0x050000
# include <QtWidgets/QWidget> 
#else 
# include <QtGui/QWidget>
#endif

struct Settings;
class ConfigDialog;
class QSlider;
class QAbstractButton;
class QComboBox;

class ConfigWidget : public QWidget {
	private:
		Q_OBJECT
		Q_DISABLE_COPY(ConfigWidget)
	protected:
		void loadSlider(QSlider *, int);
		void loadCheckBox(QAbstractButton *, bool);
		void loadComboBox(QComboBox *, int);
	signals:
		void intSignal(int);
	public:
		Settings &s;
		ConfigWidget(Settings &st);
		virtual QString title() const = 0;
		virtual QIcon icon() const;
	public slots:
		virtual void accept() const;
		virtual void save() const = 0;
		virtual void load(const Settings &r) = 0;
		virtual bool expert(bool) = 0;
};

typedef ConfigWidget *(*ConfigWidgetNew)(Settings &st);

class ConfigRegistrar Q_DECL_FINAL {
		friend class ConfigDialog;
		friend class ConfigDialogMac;
	private:
		Q_DISABLE_COPY(ConfigRegistrar)
	protected:
		int iPriority;
		static QMap<int, ConfigWidgetNew> *c_qmNew;
	public:
		ConfigRegistrar(int priority, ConfigWidgetNew n);
		~ConfigRegistrar();
};

#endif