Settings.h 2.46 KB
Newer Older
1
/*****************************************************************************
2
 * Settings.h: generic preferences interface
3
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5 6
 *
 * Authors: Clement CHAVANCE <kinder@vlmc.org>
7
 *          Ludovic Fauvet <etix@l0cal.com>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * 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.
 *****************************************************************************/

24 25
#ifndef SETTINGS_H
#define SETTINGS_H
26

27 28
#include "SettingsManager.h"

Ludovic Fauvet's avatar
Ludovic Fauvet committed
29
#include <QDialog>
30 31
#include <QString>

32
class QAbstractButton;
33
class QDialogButtonBox;
34
class QGridLayout;
35 36
class QLabel;
class QScrollArea;
37
class QStackedLayout;
38

39 40
class   Panel;
class   PreferenceWidget;
41

Ludovic Fauvet's avatar
Ludovic Fauvet committed
42
class   Settings : public QDialog
43 44
{
    Q_OBJECT
45
    Q_DISABLE_COPY( Settings )
46 47

    public:
48
        Settings( SettingsManager::Type type, QWidget *parent = 0 );
49

50 51
        void                        addCategory( const QString& categorieName,
                                                 const char *label,
52
                                                 SettingsManager::Type type,
53
                                                 const QIcon &icon );
54 55 56

    protected:
        void                        changeEvent( QEvent *e );
57
    private:
58
        void                        buildLayout();
59
        void                        retranslateUi();
60 61

    private:
62 63 64
        QDialogButtonBox            *m_buttons;
        Panel                       *m_panel;
        QLabel                      *m_title;
65
        QStackedLayout              *m_stackedLayout;
66
        SettingsManager::Type       m_type;
67

68
    public slots:
69
        void    switchWidget( int index );
70

71
    private slots:
72
        void    buttonClicked( QAbstractButton *button );
73

74
    signals:
75
        void    loadSettings();
76 77
};

78
#endif // SETTINGS_H