summaryrefslogtreecommitdiffstats
path: root/src/app/xineConfig.h
blob: 5dc05f254b7d3b82e240cb2d36395002401a66d4 (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
// (C) 2005 Max Howell ([email protected])
// See COPYING file for licensing information

#ifndef XINECONFIG_H
#define XINECONFIG_H

#include <kdialogbase.h>
#include <tqptrlist.h>

class KComboBox;
class KLineEdit;
class TQCheckBox;
class TQGridLayout;
class TQSpinBox;

typedef struct xine_s xine_t;
typedef struct xine_cfg_entry_s xine_cfg_entry_t;


///stores a single config entry of the config file

class XineConfigEntry : public TQObject
{
   enum ClassType { LineEdit, ComboBox, SpinBox, CheckBox };

   TQWidget *m_widget;
   TQCString m_key;
   TQCString m_string;
   int      m_number;

   static inline ClassType classType( const TQCString &name )
   {
      return name == "KLineEdit" ? LineEdit
           : name == "KComboBox" ? ComboBox
           : name == "TQSpinBox" ? SpinBox : CheckBox;
   }

public:
   XineConfigEntry( TQWidget *parent, TQGridLayout*, xine_cfg_entry_t* );

   bool isChanged() const;
   void save( xine_t* );
   void reset();

   inline const TQCString &key() const { return m_key; }
};


class XineConfigDialog : public KDialogBase
{
   static KDialogBase *s_instance;

   TQPtrList<XineConfigEntry> m_entrys;
   xine_t *m_xine;

public:
   XineConfigDialog( xine_t *xine, TQWidget *parent );

   bool isUnsavedSettings() const;
   void saveSettings();

   static KDialogBase *instance() { return s_instance; }

protected:
   virtual void slotUser1();
   virtual void slotHelp();
};

#endif