/********************************************/
/* Configuration Editor Plugin              */
/* Written by David Yates                   */
/* Copyright Siemens Business Services 2006 */
/********************************************/

#if !defined(AFX_PASTETABLE_H__A45CDDB7_73B9_4918_8EC3_7D340EF45FA0__INCLUDED_)
#define AFX_PASTETABLE_H__A45CDDB7_73B9_4918_8EC3_7D340EF45FA0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <qtable.h>
#include <qintdict.h>
#include <QValidator.h>


class pasteTable : public QTable  
{
	Q_OBJECT
public:
	pasteTable( QWidget * parent = 0, const char * name=0);
	pasteTable( int rows, int cols, QWidget * parent = 0, const char * name = 0 );
	virtual ~pasteTable();
	void setColumnValidator( int column, QValidator * v );
	void keyColumn( bool k );
	QValidator * columnValidator( int col );
	void endEdit( void );
protected:
	virtual void paintCell( QPainter *p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg );
	inline virtual bool isCellValid( int row, int col );
private:
	bool m_pasteReadOnlyMatch;
	bool m_pasteExpandRows;
	bool m_pasteExpandCols;
	bool m_hasKeyColumn;
	void init( void );

	QIntDict< QValidator > columnValidators;
private slots:
	void clipboardDataChanged( void );
public slots:
	void paste( void );
	void copy( void );
signals:
	void canPaste( bool valid );
	void message( const QString & msg );
};

#endif // !defined(AFX_PASTETABLE_H__A45CDDB7_73B9_4918_8EC3_7D340EF45FA0__INCLUDED_)
