/****************************************************************************
** ListViewMedia class to
**
**   Created : Sat Nov 27 12:09:08 2004
**        by : Varol Okan using kate editor
** Copyright : (c) Varol Okan
**   License : GPL v 2.0
**
****************************************************************************/

#ifndef LISTVIEWMEDIA_H
#define LISTVIEWMEDIA_H

//#include <q3listview.h>   //ooo
#include <QListWidget> //xxx
#include <QTreeWidget> //xxx
//#include <QListView> //xxx
//Added by qt3to4:
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QMimeData>    //xxx
#include <QDrag>    //xxx

class SourceFileInfo;
class SourceFileEntry;

//class ListViewMedia : public Q3ListView   //ooo
//class ListViewMedia : public QListView //xxx
//class ListViewMedia : public QListWidget //xxx
class ListViewMedia : public QTreeWidget //xxx
{
	Q_OBJECT
public:
	//ListViewMedia (QWidget *p=0, const char *n=0, Qt::WFlags f=0);   //ooo
    ListViewMedia (QWidget *p=0, const char *n=0, Qt::WindowFlags f=0); //xxx
    //ListViewMedia (QWidget *p = nullptr); //xxx
	virtual ~ListViewMedia ();

	// Overloaded function
	//virtual Q3DragObject *dragObject  ();    //ooo
    //virtual QDrag *dragObject  ();  //xxx
    virtual void mousePressEvent      ( QMouseEvent *       );  //xxx
    //virtual QMimeData *dragObject  ();  //xxx
	virtual void dropEvent (QDropEvent *);
	virtual void dragEnterEvent(QDragEnterEvent *);

	void             resetDragging ();
	SourceFileEntry *draggingSourceFileEntry();
	SourceFileInfo  *draggingSourceFileInfo ();

public slots:
	//void slotItemClicked (Q3ListViewItem *, const QPoint &, int);    //ooo
    //void slotItemClicked (QListWidgetItem *, const QPoint &, int);   //xxx
    void slotItemClicked (QTreeWidgetItem *, int);   //xxx

private:
	void handleAudioTracks    ( SourceFileEntry * );
	void handleSubtitleTracks ( SourceFileEntry * );

signals:
	void signalRemoveEntry ( SourceFileEntry * );

private:
	SourceFileEntry *m_pDraggingSourceFileEntry;
	SourceFileInfo  *m_pDraggingSourceFileInfo;
};

#endif // LISTVIEWMEDIA_H
