/***************************************************************************
*   Copyright (C) 2007 by Arnold Kraschinski                               *
*   arnold.kra67@gmx.de                                                    *
*                                                                          *
*                                                                          *
*   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.,                                        *
*   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.           *
***************************************************************************/


#ifndef KVTMLSETTINGS_H
#define KVTMLSETTINGS_H

#include <QWidget>
#include <KListWidget>

class QGridLayout;
class QCheckBox;
class QGroupBox;
class QLabel;
class QSpinBox;
class QSpacerItem;
class QPushButton;

class KConfigDialog;

/**
 *  The class has nearly the same functions as the KListWidget class. It has
 *  an additional Q_PROPERTY that is set and read using the KConfigManager.
 *  It is used to edit the list of KVTML-files that are parsed to look for
 *  translation of the verbs
 *  The user can add an delete KVTML-files here.
 * 
 * @short the GUI to change some settings how to use KVTML files in the program
 * @author Kraschinski Arnold <arnold.kra67@gmx.de>
 * @version 2.00.00
 */
class MyFileListWidget : public KListWidget
{
    Q_OBJECT
    Q_PROPERTY (QStringList filesList READ files WRITE setFiles USER true)
public:
    explicit MyFileListWidget( QWidget* parent = 0 );
    
    /** get the list of the selected images from the MyListWidget.
     *
     * @return the list of the selected imaged
     */
    QStringList files();
    
    /** Send the list of the selected images to the MyListWidget
     *
     * @param list the list of the selected images
     */
    void setFiles(QStringList filesList);
    
signals:
    /** The signal is necessary to intergrate the class into the standard KDE
     *  KConfigDialogue
     */
    void settingsChanged();
    void changed();

private:
    QStringList filesList;
};

/**
 * The class is a page for the Kverbos Config Dialogue. The user can change
 * the settings for the use of KVTML files here. He can choose if he wants to use
 * KVTML files and the KVTML files that should be parsed to find translations
 * for verbs
 * 
 * @short the GUI to change some settings of the KVTML use in the program
 * @author Kraschinski Arnold <arnold.kra67@gmx.de>
 * @version 2.00.00
 */
class KvtmlSettings : public QWidget
{
Q_OBJECT
public:
    /** creates an object of this class 
     */
    explicit KvtmlSettings(QWidget*parent);
    ~KvtmlSettings();

    /** Create the GUI of the class 
     */
    void setupUi(QWidget *KvtmlSettings);
    
    void retranslateUi(QWidget *KvtmlSettings);
	
public slots:
    /** Delete the selected KVTML file names from the MyFileListWidget */
    void slotDelete();
    
    /** Open a FileDialog. the user can select multiple KVTML files and
     *  the files are added to the list of KVTML file names. In the 
     *  MyFileListWidget.
     */
    void slotAdd();
	
private slots:

public:
    QGridLayout*        gridLayout;
    QCheckBox*          kcfg_loadKVTML;
    QGroupBox*          groupBoxKvtmlSettings;
    QGridLayout*        gridLayoutFiles;
    QGroupBox*          groupBoxTranslation;
    QGridLayout*        gridLayoutTranslation;
    
    MyFileListWidget*   kcfg_fileList;
    QPushButton*        pushButtonDelete;
    QSpacerItem*        spacerItem2;
    QPushButton*        pushButtonAdd;
    
    QRadioButton*       kcfg_translatedVerbsA;
    QRadioButton*       kcfg_translatedVerbsF;
    QRadioButton*       kcfg_translatedVerbsS;

private:
    KConfigDialog*      m_parent;
};

#endif // KVTMLSETTINGS_H

