KIO
kabstractfilewidget.h
Go to the documentation of this file.
00001 // -*- c++ -*- 00002 /* This file is part of the KDE libraries 00003 Copyright (C) 1997, 1998 Richard Moore <rich@kde.org> 00004 1998 Stephan Kulow <coolo@kde.org> 00005 1998 Daniel Grana <grana@ie.iwi.unibe.ch> 00006 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org> 00007 2001 Frerich Raabe <raabe@kde.org> 00008 2007 David Faure <faure@kde.org> 00009 00010 This library is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU Library General Public 00012 License as published by the Free Software Foundation; either 00013 version 2 of the License, or (at your option) any later version. 00014 00015 This library is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 Library General Public License for more details. 00019 00020 You should have received a copy of the GNU Library General Public License 00021 along with this library; see the file COPYING.LIB. If not, write to 00022 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00023 Boston, MA 02110-1301, USA. 00024 */ 00025 #ifndef KABSTRACTFILEWIDGET_H 00026 #define KABSTRACTFILEWIDGET_H 00027 00028 class KPreviewWidgetBase; 00029 00030 #include "kurl.h" 00031 #include "kfile.h" 00032 #include <kmimetype.h> 00033 00034 class KPushButton; 00035 class KActionCollection; 00036 class KToolBar; 00037 class KFileWidgetPrivate; 00038 class KUrlComboBox; 00039 class KFileFilterCombo; 00040 00057 class KIO_EXPORT KAbstractFileWidget 00058 { 00059 public: 00060 virtual ~KAbstractFileWidget() {} 00061 00073 enum OperationMode { Other = 0, Opening, Saving }; 00074 00078 virtual KUrl selectedUrl() const = 0; 00079 00083 virtual KUrl::List selectedUrls() const = 0; 00084 00088 virtual KUrl baseUrl() const = 0; 00089 00094 virtual QString selectedFile() const = 0; 00095 00099 virtual QStringList selectedFiles() const = 0; 00100 00108 virtual void setUrl(const KUrl &url, bool clearforward = true) = 0; 00109 00115 virtual void setSelection(const QString& name) = 0; 00116 00134 virtual void setOperationMode( OperationMode ) = 0; 00135 00143 virtual OperationMode operationMode() const = 0; 00144 00156 virtual void setKeepLocation( bool keep ) = 0; 00157 00162 virtual bool keepsLocation() const = 0; 00163 00198 virtual void setFilter(const QString& filter) = 0; 00199 00207 virtual QString currentFilter() const = 0; 00208 00217 virtual KMimeType::Ptr currentFilterMimeType() = 0; 00218 00230 virtual void setMimeFilter( const QStringList& types, 00231 const QString& defaultType = QString() ) = 0; 00232 00241 virtual QString currentMimeFilter() const = 0; 00242 00246 virtual void clearFilter() = 0; 00247 00259 virtual void setPreviewWidget(KPreviewWidgetBase *w) = 0; 00260 00282 virtual void setMode( KFile::Modes m ) = 0; 00283 00288 virtual KFile::Modes mode() const = 0; 00289 00297 virtual void setLocationLabel(const QString& text) = 0; 00298 00311 virtual KToolBar *toolBar() const = 0; 00312 00318 virtual KPushButton *okButton() const = 0; 00319 00325 virtual KPushButton *cancelButton() const = 0; 00326 00330 virtual KUrlComboBox *locationEdit() const = 0; 00331 00335 virtual KFileFilterCombo *filterWidget() const = 0; 00336 00341 virtual KActionCollection *actionCollection() const = 0; 00342 00351 virtual void setCustomWidget(QWidget* widget) = 0; 00352 00363 virtual void setCustomWidget(const QString& text, QWidget* widget) = 0; 00364 00369 virtual void slotOk() = 0; 00370 virtual void accept() = 0; 00371 virtual void slotCancel() = 0; 00372 00374 virtual void virtual_hook( int id, void* data ) = 0; 00375 00383 void setConfirmOverwrite(bool enable){ // KDE5 TODO: make this virtual 00384 virtual_hook(0, static_cast<void*>(&enable)); 00385 } 00386 00393 void setInlinePreviewShown(bool show) { // KDE5 TODO: make this virtual 00394 virtual_hook(1, static_cast<void*>(&show)); 00395 } 00396 }; 00397 00398 Q_DECLARE_INTERFACE(KAbstractFileWidget, "org.kde.KAbstractFileWidget") 00399 00400 #endif /* KABSTRACTFILEWIDGET_H */ 00401
KDE 4.6 API Reference