andre@50: /* -*- mode: c++; c-basic-offset:4 -*- andre@50: ui/filenamerequester.h andre@50: andre@50: This file is part of Kleopatra, the KDE keymanager andre@50: Copyright (c) 2007 Klarälvdalens Datakonsult AB andre@50: andre@50: Kleopatra is free software; you can redistribute it and/or modify andre@50: it under the terms of the GNU General Public License as published by andre@50: the Free Software Foundation; either version 2 of the License, or andre@50: (at your option) any later version. andre@50: andre@50: Kleopatra is distributed in the hope that it will be useful, andre@50: but WITHOUT ANY WARRANTY; without even the implied warranty of andre@50: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU andre@50: General Public License for more details. andre@50: andre@50: You should have received a copy of the GNU General Public License andre@50: along with this program; if not, write to the Free Software andre@50: Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA andre@50: andre@50: In addition, as a special exception, the copyright holders give andre@50: permission to link the code of this program with any edition of andre@50: the Qt library by Trolltech AS, Norway (or with modified versions andre@50: of Qt that use the same license as Qt), and distribute linked andre@50: combinations including the two. You must obey the GNU General andre@50: Public License in all respects for all of the code used other than andre@50: Qt. If you modify this file, you may extend this exception to andre@50: your version of the file, but you are not obligated to do so. If andre@50: you do not wish to do so, delete this exception statement from andre@50: your version. andre@50: */ andre@50: andre@50: #ifndef __KLEOPATRA_UI_FILENAMEREQUESTER_H__ andre@50: #define __KLEOPATRA_UI_FILENAMEREQUESTER_H__ andre@50: andre@50: #include andre@50: andre@50: #include andre@50: andre@50: class FileNameRequester : public QWidget andre@50: { andre@50: Q_OBJECT andre@50: Q_PROPERTY(QString fileName READ fileName WRITE setFileName) andre@50: Q_PROPERTY(bool existingOnly READ existingOnly WRITE setExistingOnly) andre@50: public: andre@50: explicit FileNameRequester(QWidget *parent = Q_NULLPTR); andre@50: explicit FileNameRequester(QDir::Filters filter, QWidget *parent = Q_NULLPTR); andre@50: ~FileNameRequester(); andre@50: andre@50: void setFileName(const QString &name); andre@50: QString fileName() const; andre@50: andre@50: void setExistingOnly(bool on); andre@50: bool existingOnly() const; andre@50: andre@50: void setFilter(QDir::Filters f); andre@50: QDir::Filters filter() const; andre@50: andre@50: void setNameFilter(const QString &nameFilter); andre@50: QString nameFilter() const; andre@50: andre@50: Q_SIGNALS: andre@50: void fileNameChanged(const QString &filename); andre@50: andre@50: private: andre@50: virtual QString requestFileName(); andre@50: andre@50: private: andre@50: class Private; andre@50: Private *d; andre@50: Q_PRIVATE_SLOT(d, void slotButtonClicked()) andre@50: }; andre@50: #endif /* __KLEOPATRA_UI_FILENAMEREQUESTER_H__ */