summaryrefslogtreecommitdiffstats
path: root/kaffeine/src/player-parts/xine-part/xineconfig.h
blob: 65d019a1b71d3ecaf6160946d4122c3d3e2aab31 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 * xineconfig.h - config dialog for xine parameters
 *
 * Copyright (C) 2003-2005 Jürgen Kofler <kaffeine@gmx.net>
 *
 * 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
 */

#ifndef XINECONFIG_H
#define XINECONFIG_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

class KLineEdit;
class KComboBox;
class TQWidget;
class TQHBox;
class TQCheckBox;
class TQSpinBox;
class TQStringList;
class TQGridLayout;

#include <xine.h>

/* stores a single config entry of the config file */
class XineConfigEntry : public TQHBox
{
	Q_OBJECT
  TQ_OBJECT
public:
	XineConfigEntry(TQWidget* tqparent, TQGridLayout* grid, int row, xine_cfg_entry_t* entry);
	~XineConfigEntry();

	bool valueChanged() const;  /* was the value changed by user? */
	const TQString& getKey() const; /* the key (name) of the entry */
	int getNumValue() const;
	const TQString& getStringValue() const;
	void setValueUnchanged()
	{
		m_valueChanged = false;
	}

private slots:
	void slotNumChanged(int);
	void slotBoolChanged(bool);
	void slotStringChanged(const TQString&);

private:
	bool m_valueChanged;
	TQString m_key;
	int m_numValue;
	int m_numDefault;
	TQString m_stringValue;
	TQString m_stringDefault;

	KLineEdit* m_stringEdit;
	KComboBox* m_enumEdit;
	TQSpinBox* m_numEdit;
	TQCheckBox* m_boolEdit;
};


class XineConfig : public KDialogBase
{
	Q_OBJECT
  TQ_OBJECT
public:
	XineConfig(const xine_t* const xine);
	~XineConfig();

private slots:
	void slotOkPressed();
	void slotApplyPressed();

private:
	void createPage(const TQString& cat, bool expert, TQWidget* tqparent);
	const TQStringList getCategories();

private:
	TQPtrList<XineConfigEntry> m_entries;
	xine_t* m_xine;
};

#endif /* XINECONFIG_H */