#ifndef DCIPFILTERCONTROL_H
#define DCIPFILTERCONTROL_H

#include <QDialog>
#include <QTreeWidgetItem>
#include <QCloseEvent>
#include <QRadioButton>
#include <QList>

#include "dcipfilter.h"
#include "dcconfig.h"

#include "DCDialogIPFilter.h"

class DCIPFilterControl: public QDialog, private Ui::DCDialogIPFilter
{
    Q_OBJECT

    public:
        DCIPFilterControl(QWidget *parent = 0);
        virtual ~DCIPFilterControl();

    private:
	void InitDocument();

	void loadItems();
	void clearTree();
	void changePolicy(QRadioButton*,bool);

	void fastLocalRule(eREGEXP_ROLE);
	void fastInternetRule(eREGEXP_ROLE);

	QString old_exp;
	QString old_dir;

	QList<QString> rfc1918;

    protected:
	virtual void closeEvent(QCloseEvent *e);

    private slots:
	void slotCheckBoxClick();

	void slotRuleAdded(QString, eDIRECTION);
	void slotRuleChanged(QString, eDIRECTION, eDIRECTION);
	void slotRuleRemoved(QString, eDIRECTION);

	void slotExport();
	void slotImport();

	void slotAddRule();

	void slotTreeClicked(QTreeWidgetItem*,int);
	void slotTreeItemChanged(QTreeWidgetItem*, int);

	void slotPolicyChanged_ALLOW(bool);
	void slotPolicyChanged_BLOCK(bool);

	void slotFastRulesAllowIIP();
	void slotFastRulesDenyLIP();
	void slotFastRulesDenyIIP();
};

#endif
