ImportController.h 3.6 KB
Newer Older
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
1 2 3 4 5 6 7
/*****************************************************************************
 * ImportController.h
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Geoffroy Lacarriere <geoffroylaca@gmail.com>
 *          Thomas Boquet <thomas.boquet@gmail.com>
8
 *          Clement Chavance <chavance.c@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 "Clip.h"
34 35
#include "ImportMediaListController.h"
#include "Media.h"
Thomas Boquet's avatar
Thomas Boquet committed
36 37 38
#include "PreviewWidget.h"
#include "StackViewController.h"
#include "TagWidget.h"
39 40 41 42

#include <QDialog>
#include <QDirModel>
#include <QFileSystemWatcher>
Thomas Boquet's avatar
Thomas Boquet committed
43

Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
44 45
namespace Ui
{
Thomas Boquet's avatar
Thomas Boquet committed
46 47 48
    class ImportController;
}

49 50 51 52
/**
 *  \class ImportController
 *  \brief Controller of the import menu
 */
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
53 54
class ImportController : public QDialog
{
Thomas Boquet's avatar
Thomas Boquet committed
55 56
    Q_OBJECT

Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
57 58 59 60
    public:
        ImportController(QWidget *parent = 0);
        ~ImportController();
        void    setUIMetaData( Media* media );
61
        void    setUIMetaData( Clip* clip );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
62 63

    protected:
64
        void changeEvent( QEvent *e );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
65 66

    private:
67 68
        void                        saveCurrentPath();
        void                        restoreCurrentPath();
69
        void                        collapseAllButCurrentPath();
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
70 71 72 73 74
        Ui::ImportController*       m_ui;
        PreviewWidget*              m_preview;
        StackViewController*        m_stackNav;
        TagWidget*                  m_tag;
        ImportMediaListController*  m_mediaListController;
75
        ImportMediaListController*  m_clipListController;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
76 77 78
        QDirModel*                  m_filesModel;
        QFileSystemWatcher*         m_fsWatcher;
        QString                     m_currentlyWatchedDir;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
79
        QUuid                       m_currentUuid;
80 81
        QUuid                       m_savedUuid;
        bool                        m_controllerSwitched;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
82 83

    public slots:
84 85
        void        newMediaLoaded( const QUuid& uuid );
        void        updateMediaRequested( const QUuid& uuid );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
86
        void        accept();
87
        void        reject();
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
88 89
        void        mediaSelection( const QUuid& uuid );
        void        clipSelection( const QUuid& uuid );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
90 91
        void        mediaDeletion( const QUuid& uuid );
        void        clipDeletion( const QUuid& uuid );
92
        void        showClipList( const QUuid& uuid );
93
        void        restoreContext();
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
94 95 96 97 98 99 100 101 102

    private slots:
        void        forwardButtonClicked();
        void        treeViewClicked( const QModelIndex& index );
        void        treeViewDoubleClicked( const QModelIndex& index );

    signals:
        void        mediaSelected( Media* );
        void        clipSelected( Clip* );
Thomas Boquet's avatar
Thomas Boquet committed
103 104 105
};

#endif // IMPORTCONTROLLER_H