MediaCellView.h 2.48 KB
Newer Older
Thomas Boquet's avatar
Thomas Boquet committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*****************************************************************************
 * MediaCellView.h
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Thomas Boquet <thomas.boquet@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.
 *****************************************************************************/

Thomas Boquet's avatar
Thomas Boquet committed
23
24
25
26
27
#ifndef MEDIACELLVIEW_H
#define MEDIACELLVIEW_H

#include <QWidget>
#include <QUuid>
28
#include <QMouseEvent>
29
#include "ClickableLabel.h"
Thomas Boquet's avatar
Thomas Boquet committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43

namespace Ui
{
    class MediaCellView;
}

class MediaCellView : public QWidget
{
    Q_OBJECT

public:
    MediaCellView( const QUuid& uuid, QWidget *parent = 0 );
    ~MediaCellView();

44
45
46
    void                    setTitle( const QString& title );
    void                    setThumbnail( const QPixmap& pixmap );
    const QPixmap*          getThumbnail() const;
47
48
49
50
51
    /**
     *  \brief  Set the length displayed in the cell
     *  \param  length  The media length, in ms.
     */
    void                    setLength( qint64 length );
52
53
54
    QString                 title() const;
    const QUuid&            uuid() const;
    const ClickableLabel*   nextButton() const;
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
55
    const ClickableLabel*   deleteButton() const;
Thomas Boquet's avatar
Thomas Boquet committed
56
57
58
59
60

protected:
    void changeEvent( QEvent *e );

private:
61
    Ui::MediaCellView*  m_ui;
Thomas Boquet's avatar
Thomas Boquet committed
62
    const QUuid         m_uuid;
Thomas Boquet's avatar
Thomas Boquet committed
63
    QPoint              m_dragStartPos;
64
65
66

protected:
    void        mouseDoubleClickEvent( QMouseEvent* );
67
    void        mousePressEvent( QMouseEvent* );
Thomas Boquet's avatar
Thomas Boquet committed
68
    void        mouseMoveEvent( QMouseEvent* );
69
70
71

signals:
    void        cellSelected( const QUuid& uuid );
72
    void        arrowClicked( const QUuid& uuid );
Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
73
    void        cellDeleted( const QUuid& uuid );
74

Geoffroy Lacarriere's avatar
Geoffroy Lacarriere committed
75
76
public slots:
    void        deleteButtonClicked( QWidget* sender, QMouseEvent* event );
77

Thomas Boquet's avatar
Thomas Boquet committed
78
79
80
};

#endif // MEDIACELLVIEW_H