Panel.h 1.83 KB
Newer Older
1
/*****************************************************************************
2
 * Panel.h: a simple panel with buttons
3
 *****************************************************************************
4
 * Copyright (C) 2008-2016 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
 *
 * 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.
 *****************************************************************************/
23

24 25 26 27 28
#ifndef PANEL_H
#define PANEL_H

#include <QWidget>
#include <QString>
29
#include <QMap>
30

31 32
class   QVBoxLayout;
class   QButtonGroup;
33

34 35
class   QButtonGroup;
class   QToolButton;
36 37 38 39 40 41

class   Panel : public QWidget
{
    Q_OBJECT
    Q_DISABLE_COPY( Panel )

Ludovic Fauvet's avatar
Ludovic Fauvet committed
42 43 44
public:
    Panel( QWidget* parent = 0 );
    virtual ~Panel() { }
45

46
    void    addButton( const char* label,
Ludovic Fauvet's avatar
Ludovic Fauvet committed
47 48
                       const QIcon& icon,
                       int index );
49
    void    retranslate();
50

51 52 53 54 55
private:
    QVBoxLayout*                    m_layout;
    QButtonGroup*                   m_buttons;
    static const int                M_ICON_HEIGHT;
    QMap<QToolButton*, const char*> m_buttonsNames;
56

Ludovic Fauvet's avatar
Ludovic Fauvet committed
57 58
signals:
    void   changePanel( int index );
59 60 61 62
};


#endif /* !PANEL_H */