ISettingsCategoryWidget.h 2.03 KB
Newer Older
1 2 3
/*****************************************************************************
 * ISettingsCategorieWidget.h: Common interface for settings widgets.
 *****************************************************************************
4
 * Copyright (C) 2008-2014 VideoLAN
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
 *
 * 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 ISETTINGSCATEGORYWIDGET_H
#define ISETTINGSCATEGORYWIDGET_H
26

27
#include "Settings/SettingValue.h"
28

29 30
class   QVariant;

31 32
#include <QWidget>
#include <QHBoxLayout>
33

34
class   ISettingsCategoryWidget : public QWidget
35
{
36 37
    Q_OBJECT

38
    public:
39
        virtual ~ISettingsCategoryWidget(){}
40
        virtual SettingValue    *setting() { return m_setting; }
41
        virtual bool            save() = 0;
42

43
    protected:
44 45 46
        ISettingsCategoryWidget( QWidget *parent, SettingValue* s ) :
                QWidget( parent ),
                m_setting( s )
47 48 49
        {
            connect( s, SIGNAL( changed( const QVariant& ) ),
                     this, SLOT( changed( const QVariant& ) ) );
50 51
            QHBoxLayout *layout = new QHBoxLayout;
            setLayout( layout );
52 53 54 55 56
        }

    protected:
        SettingValue            *m_setting;

57
    public slots:
58
        virtual void            changed( const QVariant& ) = 0;
59 60
};

61
#endif // ISETTINGSCATEGORYWIDGET_H