//****************************************************************************
//Copyright (C) 2005-2006 Beijing BlueDJ Technology Co.,Ltd. All rights reserved.

//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 (in the file LICENSE.GPL); if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

//Please visit http://www.bluedj.com for more infomation about us.
//Contact us at ggwizard@gmail.com or darkdong@gmail.com.
//****************************************************************************/

#ifndef DJTREEITEMDELEGATE_H
#define DJTREEITEMDELEGATE_H

#include <QtGui>
#include "DJBaseGlobal.h"
#include "DJPosColor.h"

static const int DirectionTypeTopLeft2BottomLeft	= 1;
static const int DirectionTypeTopLeft2BottomRight	= 2;
static const int DirectionTypeTopRight2BottomLeft	= 3;

class DJ_BASE_EXPORT DJTreeItemDelegate : public QItemDelegate
{
    Q_OBJECT
public:
	DJTreeItemDelegate( quint32 selfUserId, QObject *parent = 0, int linearDirectionType = DirectionTypeTopLeft2BottomLeft );
    DJTreeItemDelegate( quint32 selfUserId, const QList<DJPosColor>& selfColor, const QList<DJPosColor>& otherColor, QObject *parent = 0, int linearDirectionType = DirectionTypeTopLeft2BottomLeft );
    virtual void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
    
    void setSelfUserId( quint32 selfUserId );
    void setSelfColor( const QList<DJPosColor>& pc );
    void setOtherColor( const QList<DJPosColor>& pc );
private:
	quint32				m_selfUserId;
	QList<DJPosColor>		m_selfColor;
	QList<DJPosColor>		m_otherColor;
	int					m_linearDirectionType;
};

#endif
