view widgets/GenericItemList.h @ 282:d9319859a4cf tip

(none)
author benoitrigolleau
date Fri, 31 Oct 2008 11:00:24 +0000
parents 894b45c9b787
children
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */

/*   
	Sound Access
		EASAIER client application.
		Silogic 2007. Benoit Rigolleau.

	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.  See the file
	COPYING included with this distribution for more information.
*/


#ifndef _GENERIC_ITEM_LIST_H
#define _GENERIC_ITEM_LIST_H

#include <QFrame>
#include <QPoint>

class GenericItemList : public QFrame{
	Q_OBJECT	

public:
	GenericItemList(QWidget *parent=0);
	~GenericItemList();
	void setData(QVariant &data);
	void setIndex(int index);
	virtual void configAction();
	void setAcceptDrag(bool status);

	virtual void setName(QString &name) = 0;
	virtual QString getName() = 0;

signals :
	void doubleClicked();
	void selected(int index=0);
	void itemDropped(int origine, int destination);

protected:
	void mousePressEvent(QMouseEvent *evt);
	void mouseReleaseEvent(QMouseEvent *evt);
	void mouseMoveEvent(QMouseEvent *evt);
	void dragEnterEvent(QDragEnterEvent *evt);
	void dragMoveEvent(QDragMoveEvent *evt);
	void mouseDoubleClickEvent(QMouseEvent *evt);
	void dropEvent(QDropEvent *evt);
	//void focusOutEvent ( QFocusEvent *evt ); 
	//void focusInEvent ( QFocusEvent *evt ); 
	int m_index;


private: 
	void startDrag();
	QPoint m_startPos;
	bool m_clicked;
	bool m_acceptDrag;


};
#endif