/***************************************************************************
 *   Copyright (C) 2005 by James Thorniley                                 *
 *   james@uncommonlygood.co.uk                                            *
 *                                                                         *
 *   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; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef BURNDATACDCONFIGWIDGET_H
#define BURNDATACDCONFIGWIDGET_H

#include <qframe.h>
#include "burnk3bdoccreator.h"
#include <kfileitem.h>

class K3bDoc;
class KDirLister;
class QLabel;
class BurnSidebarPlugin;
class QVBoxLayout;
class QCheckBox;
class K3bIsoOptions;
class KConfigGroup;

/**
@author James Thorniley
*/
class BurnDataCDConfigWidget : public QFrame, public BurnK3bDocCreator
{
  Q_OBJECT
  public:
    BurnDataCDConfigWidget(BurnSidebarPlugin *plugin, QWidget *parent = 0, const char *name = 0, const QString &configGroup = "CDISO");

    virtual ~BurnDataCDConfigWidget();

    virtual K3bDoc *k3bDoc();

  protected:

    BurnSidebarPlugin *m_plugin;
    K3bIsoOptions *m_isoOptions;
    KConfigGroup *m_configGroup;
    QCheckBox *m_jolietCheckBox;
    QLabel *m_dataCDLabel;

  private:

    unsigned int m_totalSize;
    QVBoxLayout *m_vLayout;
    QLabel *m_sizeLabel;

  private slots:
    /**
    Calculates the size of the files already found by the plugin's
    KDirLister. Connects newItems and deleteItem signals to appropriate
    slots so the size will constantly be updated.
    */
    void initSize();
    void slotNewItems( const KFileItemList &newItems );
    void slotDeleteItem( KFileItem *item );
    void slotJolietChecked(bool checked);
};

#endif
