#ifndef KURLREQUESTER_H
#define KURLREQUESTER_H

#include <QtGui/QWidget>
#include <QFileDialog>
#include <QUrl>
#include <QDirModel>
class KUrl:public QUrl {
public:
    KUrl(const QString path):QUrl(path) {}
};


namespace Ui {
    class KUrlRequester;
}

class KUrlRequester : public QWidget {
    Q_OBJECT
public:
    enum eMode {OPEN,SAVE,DIRECTORY};
    KUrlRequester(QWidget *parent = 0);
    void setMode(eMode mode);
    void setFilter(const QString &_filter);
    ~KUrlRequester();
    KUrl url() ;

public slots:
    void setUrl(const KUrl &_url);
    void setTitle(const QString &_text);
protected:
    void changeEvent(QEvent *e);
protected slots:
    void toolButtonClicked();
private:
    Ui::KUrlRequester *m_ui;
    eMode m_mode;
    QString m_filter;
    QString m_title;
    QDirModel *m_model;
signals:
    void urlSelected(const KUrl &url);
};

#endif // KURLREQUESTER_H
