ImportController.h 3.48 KB
Newer Older
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
1 2 3
/*****************************************************************************
 * ImportController.h
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
5 6 7
 *
 * Authors: Geoffroy Lacarriere <geoffroylaca@gmail.com>
 *          Thomas Boquet <thomas.boquet@gmail.com>
8
 *          Hugo Beauzée-Luyssen <beauze.h@gmail.com>
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 *
 * 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.
 *****************************************************************************/

25 26 27 28 29
/** \file
 * This file ImportController contains class declaration/definition.
 * It's the the controler of the import menu widget of vlmc.
 */

Thomas Boquet's avatar
Thomas Boquet committed
30 31 32 33
#ifndef IMPORTCONTROLLER_H
#define IMPORTCONTROLLER_H

#include "StackViewController.h"
34 35

#include <QDialog>
36
#include <QUuid>
Thomas Boquet's avatar
Thomas Boquet committed
37

38
class   Clip;
39
class   ClipMetadataDisplayer;
40
class   ClipRenderer;
41
class   Media;
42
class   MediaContainer;
43
class   MediaListView;
44 45 46 47 48
class   PreviewWidget;
class   TagWidget;

class   QFileSystemModel;
class   QModelIndex;
49

Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
50 51
namespace Ui
{
Thomas Boquet's avatar
Thomas Boquet committed
52 53 54
    class ImportController;
}

55 56 57 58
/**
 *  \class ImportController
 *  \brief Controller of the import menu
 */
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
59 60
class ImportController : public QDialog
{
Thomas Boquet's avatar
Thomas Boquet committed
61 62
    Q_OBJECT

Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
63 64 65 66 67
    public:
        ImportController(QWidget *parent = 0);
        ~ImportController();

    protected:
68
        void changeEvent( QEvent *e );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
69 70

    private:
71 72
        void                        saveCurrentPath();
        void                        restoreCurrentPath();
73
        void                        collapseAllButCurrentPath();
74 75
        void                        importMedia( const QString &filePath );
        void                        importDir( const QString &path );
76 77
        void                        handleInvalidMedias();
    private:
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
78 79
        Ui::ImportController*       m_ui;
        StackViewController*        m_stackNav;
80
//        TagWidget*                  m_tag;
81
        MediaListView               *m_mediaListView;
82
        QFileSystemModel            *m_filesModel;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
83
        QString                     m_currentlyWatchedDir;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
84
        QUuid                       m_currentUuid;
85
        MediaContainer              *m_temporaryMedias;
86 87
        quint32                     m_nbMediaToLoad;
        quint32                     m_nbMediaLoaded;
88
        ClipRenderer*               m_clipRenderer;
89
        QStringList                 m_nameFilters;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
90 91 92

    public slots:
        void        accept();
93
        void        reject();
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
94 95

    private slots:
96
        void        clipSelection( Clip* clip );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
97 98 99
        void        forwardButtonClicked();
        void        treeViewClicked( const QModelIndex& index );
        void        treeViewDoubleClicked( const QModelIndex& index );
100
        void        mediaLoaded();
101
        void        failedToLoad( Media* media );
102
        void        hideErrors();
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
103 104 105

    signals:
        void        clipSelected( Clip* );
Thomas Boquet's avatar
Thomas Boquet committed
106 107 108
};

#endif // IMPORTCONTROLLER_H