• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kfile
kabstractfilewidget.h
Go to the documentation of this file.
1// -*- c++ -*-
2/* This file is part of the KDE libraries
3 Copyright (C) 1997, 1998 Richard Moore <rich@kde.org>
4 1998 Stephan Kulow <coolo@kde.org>
5 1998 Daniel Grana <grana@ie.iwi.unibe.ch>
6 2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
7 2001 Frerich Raabe <raabe@kde.org>
8 2007 David Faure <faure@kde.org>
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Library General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19
20 You should have received a copy of the GNU Library General Public License
21 along with this library; see the file COPYING.LIB. If not, write to
22 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 Boston, MA 02110-1301, USA.
24*/
25#ifndef KABSTRACTFILEWIDGET_H
26#define KABSTRACTFILEWIDGET_H
27
28class KPreviewWidgetBase;
29
30#include "kurl.h"
31#include "kfile.h"
32#include <kmimetype.h>
33
34class KPushButton;
35class KActionCollection;
36class KToolBar;
37class KFileWidgetPrivate;
38class KUrlComboBox;
39class KFileFilterCombo;
40
57class KIO_EXPORT KAbstractFileWidget
58{
59public:
60 virtual ~KAbstractFileWidget() {}
61
73 enum OperationMode { Other = 0, Opening, Saving };
74
78 virtual KUrl selectedUrl() const = 0;
79
83 virtual KUrl::List selectedUrls() const = 0;
84
88 virtual KUrl baseUrl() const = 0;
89
94 virtual QString selectedFile() const = 0;
95
99 virtual QStringList selectedFiles() const = 0;
100
108 virtual void setUrl(const KUrl &url, bool clearforward = true) = 0;
109
115 virtual void setSelection(const QString& name) = 0;
116
134 virtual void setOperationMode( OperationMode ) = 0;
135
143 virtual OperationMode operationMode() const = 0;
144
156 virtual void setKeepLocation( bool keep ) = 0;
157
162 virtual bool keepsLocation() const = 0;
163
198 virtual void setFilter(const QString& filter) = 0;
199
207 virtual QString currentFilter() const = 0;
208
217 virtual KMimeType::Ptr currentFilterMimeType() = 0;
218
230 virtual void setMimeFilter( const QStringList& types,
231 const QString& defaultType = QString() ) = 0;
232
241 virtual QString currentMimeFilter() const = 0;
242
246 virtual void clearFilter() = 0;
247
259 virtual void setPreviewWidget(KPreviewWidgetBase *w) = 0;
260
282 virtual void setMode( KFile::Modes m ) = 0;
283
288 virtual KFile::Modes mode() const = 0;
289
297 virtual void setLocationLabel(const QString& text) = 0;
298
311 virtual KToolBar *toolBar() const = 0;
312
318 virtual KPushButton *okButton() const = 0;
319
325 virtual KPushButton *cancelButton() const = 0;
326
330 virtual KUrlComboBox *locationEdit() const = 0;
331
335 virtual KFileFilterCombo *filterWidget() const = 0;
336
341 virtual KActionCollection *actionCollection() const = 0;
342
351 virtual void setCustomWidget(QWidget* widget) = 0;
352
363 virtual void setCustomWidget(const QString& text, QWidget* widget) = 0;
364
369 virtual void slotOk() = 0;
370 virtual void accept() = 0;
371 virtual void slotCancel() = 0;
372
374 virtual void virtual_hook( int id, void* data ) = 0;
375
383 void setConfirmOverwrite(bool enable){ // KDE5 TODO: make this virtual
384 virtual_hook(0, static_cast<void*>(&enable));
385 }
386
393 void setInlinePreviewShown(bool show) { // KDE5 TODO: make this virtual
394 virtual_hook(1, static_cast<void*>(&show));
395 }
396};
397
398Q_DECLARE_INTERFACE(KAbstractFileWidget, "org.kde.KAbstractFileWidget")
399
400#endif /* KABSTRACTFILEWIDGET_H */
401
KAbstractFileWidget
Base class for KFileWidget.
Definition: kabstractfilewidget.h:58
KAbstractFileWidget::setUrl
virtual void setUrl(const KUrl &url, bool clearforward=true)=0
Sets the directory to view.
KAbstractFileWidget::selectedUrl
virtual KUrl selectedUrl() const =0
KAbstractFileWidget::setSelection
virtual void setSelection(const QString &name)=0
Sets the file name to preselect to name.
KAbstractFileWidget::setOperationMode
virtual void setOperationMode(OperationMode)=0
Sets the operational mode of the filedialog to Saving, Opening or Other.
KAbstractFileWidget::setFilter
virtual void setFilter(const QString &filter)=0
Sets the filter to be used to filter.
KAbstractFileWidget::selectedFile
virtual QString selectedFile() const =0
Returns the full path of the selected file in the local filesystem.
KAbstractFileWidget::keepsLocation
virtual bool keepsLocation() const =0
KAbstractFileWidget::cancelButton
virtual KPushButton * cancelButton() const =0
KAbstractFileWidget::accept
virtual void accept()=0
KAbstractFileWidget::setMimeFilter
virtual void setMimeFilter(const QStringList &types, const QString &defaultType=QString())=0
Sets the filter up to specify the output type.
KAbstractFileWidget::OperationMode
OperationMode
Defines some default behavior of the filedialog.
Definition: kabstractfilewidget.h:73
KAbstractFileWidget::Opening
@ Opening
Definition: kabstractfilewidget.h:73
KAbstractFileWidget::selectedUrls
virtual KUrl::List selectedUrls() const =0
KAbstractFileWidget::setCustomWidget
virtual void setCustomWidget(QWidget *widget)=0
Set a custom widget that should be added to the bottom of the file dialog.
KAbstractFileWidget::okButton
virtual KPushButton * okButton() const =0
KAbstractFileWidget::baseUrl
virtual KUrl baseUrl() const =0
KAbstractFileWidget::setLocationLabel
virtual void setLocationLabel(const QString &text)=0
Sets the text to be displayed in front of the selection.
KAbstractFileWidget::selectedFiles
virtual QStringList selectedFiles() const =0
Returns a list of all selected local files.
KAbstractFileWidget::slotCancel
virtual void slotCancel()=0
KAbstractFileWidget::currentFilterMimeType
virtual KMimeType::Ptr currentFilterMimeType()=0
Returns the mimetype for the desired output format.
KAbstractFileWidget::actionCollection
virtual KActionCollection * actionCollection() const =0
KAbstractFileWidget::filterWidget
virtual KFileFilterCombo * filterWidget() const =0
KAbstractFileWidget::setPreviewWidget
virtual void setPreviewWidget(KPreviewWidgetBase *w)=0
Adds a preview widget and enters the preview mode.
KAbstractFileWidget::slotOk
virtual void slotOk()=0
Called when clicking ok (when this widget is used in KFileDialog) Might or might not call accept().
KAbstractFileWidget::setConfirmOverwrite
void setConfirmOverwrite(bool enable)
Sets whether the user should be asked for confirmation when an overwrite might occurr.
Definition: kabstractfilewidget.h:383
KAbstractFileWidget::operationMode
virtual OperationMode operationMode() const =0
KAbstractFileWidget::clearFilter
virtual void clearFilter()=0
Clears any mime- or namefilter.
KAbstractFileWidget::setKeepLocation
virtual void setKeepLocation(bool keep)=0
Sets whether the filename/url should be kept when changing directories.
KAbstractFileWidget::currentMimeFilter
virtual QString currentMimeFilter() const =0
The mimetype for the desired output format.
KAbstractFileWidget::~KAbstractFileWidget
virtual ~KAbstractFileWidget()
Definition: kabstractfilewidget.h:60
KAbstractFileWidget::setInlinePreviewShown
void setInlinePreviewShown(bool show)
Forces the inline previews to be shown or hidden, depending on show.
Definition: kabstractfilewidget.h:393
KAbstractFileWidget::currentFilter
virtual QString currentFilter() const =0
Returns the current filter as entered by the user or one of the predefined set via setFilter().
KAbstractFileWidget::virtual_hook
virtual void virtual_hook(int id, void *data)=0
KAbstractFileWidget::toolBar
virtual KToolBar * toolBar() const =0
Returns a pointer to the toolbar.
KAbstractFileWidget::mode
virtual KFile::Modes mode() const =0
Returns the mode of the filedialog.
KAbstractFileWidget::setMode
virtual void setMode(KFile::Modes m)=0
Sets the mode of the dialog.
KAbstractFileWidget::setCustomWidget
virtual void setCustomWidget(const QString &text, QWidget *widget)=0
Sets a custom widget that should be added below the location and the filter editors.
KAbstractFileWidget::locationEdit
virtual KUrlComboBox * locationEdit() const =0
KActionCollection
KPreviewWidgetBase
Abstract baseclass for all preview widgets which shall be used via KFileDialog::setPreviewWidget(cons...
Definition: kpreviewwidgetbase.h:44
KPushButton
KSharedPtr< KMimeType >
KToolBar
KUrlComboBox
This combobox shows a number of recent URLs/directories, as well as some default directories.
Definition: kurlcombobox.h:48
KUrl::List
KUrl
QWidget
kfile.h
kmimetype.h
kurl.h
Other
Other
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal