DockWidgetManager.h 2.2 KB
Newer Older
1
/*****************************************************************************
2
 * DockWidgetManager.h: Object managing the application docked widget
3
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * Authors: Clement CHAVANCE <chavance.c@gmail.com>
 *
 * 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 DOCKWIDGETMANAGER_H
#define DOCKWIDGETMANAGER_H

26 27
#include "QSingleton.hpp"

28 29 30 31
#include <QObject>
#include <QWidget>
#include <QDockWidget>
#include <QString>
32
#include <QMap>
33 34

class MainWindow;
35

36
class DockWidgetManager : public QObject, public QSingleton<DockWidgetManager>
37
{
38
    Q_OBJECT
39
    Q_DISABLE_COPY( DockWidgetManager );
40

41
    public:
42 43 44 45 46 47 48
        void                setMainWindow( MainWindow *mainWin );
        QDockWidget*        createDockedWidget( const char *qs_name,
                                                Qt::DockWidgetAreas areas,
                                                QDockWidget::DockWidgetFeature features );
        void        addDockedWidget( QDockWidget *dockWidget, QWidget *containedWidget,
                                     Qt::DockWidgetArea startArea );
        void        retranslateUi();
49

50 51
    private:
        explicit DockWidgetManager( QObject *parent = 0 );
52 53
        virtual ~DockWidgetManager();

54 55
        MainWindow                          *m_mainWin;
        QMap<const char*, QDockWidget*>     m_dockWidgets;
56 57

        friend  class   QSingleton<DockWidgetManager>;
58 59 60
};

#endif