/***************************************************************************
 *   Copyright (C) 2004 by Judd Baileys                                    *
 *   jbaileys@bigpond.net.au                                               *
 *                                                                         *
 *   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 PREFDIALOG_H
#define PREFDIALOG_H

#include <kdialogbase.h>
#include <qwidget.h>
#include <kcombobox.h>
#include <qradiobutton.h>
#include <qgroupbox.h>
#include <kaboutdata.h>
#include <kstdaction.h>
#include <kaboutdialog.h>
#include <kfiledialog.h>
#include "kdsl.h"
#include <qlistview.h>
#include <qcheckbox.h>
#include <qwidgetstack.h>
#include <kiconview.h>
#include <kcolorbutton.h>

class QListViewItem;
class PPPStats;
class configuration;
class DockWidget;
class PrefGeneral;
class kdsl;
class DocBrowser;
class PrefAdvanced;
class PrefTheme;
class KIconVIew;
class KPushButton;
class Configuration;
class AboutDlg;
class KColorButton;

class PrefDialog : public KDialogBase
{
Q_OBJECT
public:
PrefDialog(QWidget *parent , const char *name = 0 );
~PrefDialog();

public slots:
void slotDefault();
void slotApply();
void slotCancel();
void enableApply();
void dslAccounts();
void dialupAccounts();
void newTheme();
void loadThemes();
bool installThemes(QStringList themes, QString archiveName);
QStringList findThemeDirs(QString archiveName);
void editAccount(QIconViewItem *item);
void modems();
void newDslAccount();
void newDialupAccount();
void allowAccount(const QString &);

private slots:
void slotListBoxSelect(QIconViewItem *item);
void themeListBoxSelect(int);
void deletetheme();
void newDefaultTheme(int);
void modemVolumeActivated(int);
void setStartTheme();
void newAccountIcon();
void newPlugin();
void deleteAccount(QIconViewItem *item);
void comboBoxItemActivated( int );
void dialupComboBoxItemActivated( int );
void flowComboBoxItemActivated( int );
void modemSpeedComboBoxItemActivated( int );

private:
void doaccounts();
void dothemes();
QListViewItem *iconThemeItem(QString name);
QListView *m_iconThemes;
QLabel *m_previewExec;
QLabel *m_previewFolder;
QLabel *m_previewDocument;
QListViewItem *m_defaultTheme;
QMap <QString, QString>m_themeNames;
QStringList *newString;
const char *filterApply;
void applyDslSettings();
void applyDialupSettings();
void applyIsdnSettings();
int WritePapsecrets();
int WriteOptions();

signals:
void settingsChanged();
void resetaccounts();
void dockShow();
void statsChanged(int);
void taskApply();

private:

QPixmap dockicon;
PrefGeneral    *m_prefGeneral;
PrefAdvanced   *m_prefAdvanced;
PrefTheme      *m_prefTheme;
DocBrowser *browser;
kdsl *m_kdsl;
KAboutWidget *about;
Configuration *m_gpppdata;
AboutDlg *aboutDlg;


public:
DockWidget* dock_widget;
//PrefDialog* pref_dialog;
//KURLRequesterDlg* kurlDlg;
PPPStats *stats;
};

#endif
