/***************************************************************************
                          CdboCddaView.h  -  description
                             -------------------
    begin                : Sun Feb 3 2002
    copyright            : (C) 2002 by Alex Podolsky
    email                : alexpod@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef CDBOCDDAVIEW_H
#define CDBOCDDAVIEW_H

#include <qvariant.h>
#include <qframe.h>
#include <klistview.h>

class QVBoxLayout;
class QPopupMenu;
class QListViewItem;


class KConfig;

class CdboPlayerPnl;
class CdboAudioActionFactory;
class CdboDialogBase;

class CdboCddaView : public QFrame
{
    Q_OBJECT

public:
    CdboCddaView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CdboCddaView();

	void load(QString device);
	void loadAndUncheck(QString device);
	void setHeaderClickEnabled(bool);
	void setRenameable();
	void showLongTitle();
	
	inline void setUser(CdboDialogBase *u){ user = u; }
	QStringList* getPickedTracks();
	inline void resizeTrackViewColomns(int w1, int w2, int w3){
		trackView->setColumnWidth(0,w1);
		trackView->setColumnWidth(1,w2);
		trackView->setColumnWidth(2,w3);
	}
	inline CdboAudioActionFactory* getFactory(){ return factory; }
	inline void setDevice(QString d){ thisDevice = d; }
	void readOptions();
	void saveOptions();

public slots:
	void doShowPlayer(bool doShow);
	void setTotal(int total);
	void invalidate();
	void stop();
	
protected slots:
    void slotShowPlayer();
    void reload();
    void popupMenuSlot(QListViewItem*, const QPoint&, int);
	void slotCheckAll();
	void slotUncheckAll();
	void slotSelectFile(QListViewItem *);
	
protected:
    QVBoxLayout* layout;
   KListView *trackView;
   CdboPlayerPnl *player;
   QStringList pickedTracks;

   CdboAudioActionFactory *factory;
   CdboDialogBase *user;

	QPopupMenu *popupMenu;
	QString thisDevice;
	int showPlayerIndex;
	int checkIndex;
	int uncheckIndex;
	KConfig* config;
	
	bool showPlayer;
	bool renameable;
};

#endif // CDBOPLAYERPNL_H
