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

KIO

  • kio
  • kfile
kurlrequester.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1999,2000,2001 Carsten Pfeiffer <pfeiffer@kde.org>
3
4 library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2, as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KURLREQUESTER_H
20#define KURLREQUESTER_H
21
22#include <kfile.h>
23#include <kpushbutton.h>
24#include <kurl.h>
25#include <khbox.h>
26
27#ifndef KDE_NO_DEPRECATED
28#include <keditlistbox.h>
29#else
30#include <keditlistwidget.h>
31#endif
32
33class KComboBox;
34class KFileDialog;
35class KLineEdit;
36class KUrlCompletion;
37
38class QString;
39class QEvent;
40
60class KIO_EXPORT KUrlRequester : public KHBox
61{
62 Q_OBJECT
63 Q_PROPERTY( KUrl url READ url WRITE setUrl NOTIFY textChanged USER true )
64 Q_PROPERTY( QString filter READ filter WRITE setFilter )
65 Q_PROPERTY( KFile::Modes mode READ mode WRITE setMode )
66 Q_PROPERTY( QString clickMessage READ clickMessage WRITE setClickMessage )
67 Q_PROPERTY(QString text READ text WRITE setText)
68 Q_PROPERTY( Qt::WindowModality fileDialogModality READ fileDialogModality WRITE setFileDialogModality )
69
70public:
74 explicit KUrlRequester( QWidget *parent=0);
75
79 explicit KUrlRequester( const KUrl& url, QWidget *parent=0);
80
87 KUrlRequester( QWidget *editWidget, QWidget *parent);
91 ~KUrlRequester();
92
98 KUrl url() const;
99
104 KUrl startDir() const;
105
114 QString text() const;
115
122 void setMode( KFile::Modes m );
123
128 KFile::Modes mode() const;
129
134 void setFilter( const QString& filter );
135
140 QString filter() const;
141
152 virtual KFileDialog * fileDialog() const;
153
161 KLineEdit * lineEdit() const;
162
167 KComboBox * comboBox() const;
168
173 KPushButton * button() const;
174
178 KUrlCompletion *completionObject() const;
179
190#ifndef KDE_NO_DEPRECATED
191 const KEditListBox::CustomEditor &customEditor();
192#else
193 const KEditListWidget::CustomEditor &customEditor();
194#endif
195
200 QString clickMessage() const;
201
206 void setClickMessage(const QString& msg);
207
212 Qt::WindowModality fileDialogModality() const;
213
219 void setFileDialogModality(Qt::WindowModality modality);
220
221public Q_SLOTS:
225 void setUrl( const KUrl& url );
226
232 void setStartDir( const KUrl& startDir );
233
242#ifndef KDE_NO_DEPRECATED
243 KDE_DEPRECATED void setPath(const QString& path);
244#endif
245
255 void setText(const QString& text);
256
260 void clear();
261
262Q_SIGNALS:
263 // forwards from LineEdit
268 void textChanged( const QString& );
269
273 void returnPressed();
274
279 void returnPressed( const QString& );
280
292 void openFileDialog( KUrlRequester * );
293
298 void urlSelected( const KUrl& );
299
300protected:
301 virtual void changeEvent (QEvent *e);
302 bool eventFilter( QObject *obj, QEvent *ev );
303
304private:
305 class KUrlRequesterPrivate;
306 KUrlRequesterPrivate* const d;
307
308 Q_DISABLE_COPY(KUrlRequester)
309
310 Q_PRIVATE_SLOT(d, void _k_slotUpdateUrl())
311 Q_PRIVATE_SLOT(d, void _k_slotOpenDialog())
312 Q_PRIVATE_SLOT(d, void _k_slotFileDialogFinished())
313
314};
315
316class KIO_EXPORT KUrlComboRequester : public KUrlRequester // krazy:exclude=dpointer (For use in Qt Designer)
317{
318 Q_OBJECT
319public:
323 explicit KUrlComboRequester(QWidget *parent = 0);
324
325private:
326 class Private;
327 Private* const d;
328};
329
330#endif // KURLREQUESTER_H
KComboBox
KEditListBox::CustomEditor
KEditListWidget::CustomEditor
KFileDialog
Provides a user (and developer) friendly way to select files and directories.
Definition: kfiledialog.h:69
KHBox
KLineEdit
KPushButton
KUrlComboRequester
Definition: kurlrequester.h:317
KUrlCompletion
This class does completion of URLs including user directories (~user) and environment variables.
Definition: kurlcompletion.h:42
KUrlRequester
This class is a widget showing a lineedit and a button, which invokes a filedialog.
Definition: kurlrequester.h:61
KUrlRequester::returnPressed
void returnPressed(const QString &)
Emitted when return or enter was pressed in the lineedit.
KUrlRequester::openFileDialog
void openFileDialog(KUrlRequester *)
Emitted before the filedialog is going to open.
KUrlRequester::urlSelected
void urlSelected(const KUrl &)
Emitted when the user changed the URL via the file dialog.
KUrlRequester::textChanged
void textChanged(const QString &)
Emitted when the text in the lineedit changes.
KUrlRequester::returnPressed
void returnPressed()
Emitted when return or enter was pressed in the lineedit.
KUrl
QObject
QWidget
keditlistbox.h
keditlistwidget.h
kfile.h
khbox.h
kpushbutton.h
kurl.h
clear
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
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