KIO

knameandurlinputdialog.h
1/*
2 SPDX-FileCopyrightText: 1998, 2008, 2009 David Faure <faure@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef KNAMEANDURLINPUTDIALOG_H
8#define KNAMEANDURLINPUTDIALOG_H
9
10#include "kiofilewidgets_export.h"
11#include <QDialog>
12
13#include <memory>
14
15class KUrlRequester;
16class KNameAndUrlInputDialogPrivate;
17class QUrl;
18
19/**
20 * @class KNameAndUrlInputDialog knameandurlinputdialog.h <KNameAndUrlInputDialog>
21 *
22 * Dialog to ask for a name (e.g.\ filename) and a URL
23 * Basically a merge of KLineEditDlg and KUrlRequesterDlg ;)
24 * @author David Faure <faure@kde.org>
25 */
26class KIOFILEWIDGETS_EXPORT KNameAndUrlInputDialog : public QDialog
27{
28 Q_OBJECT
29public:
30 /**
31 * @param nameLabel label for the name field
32 * @param urlLabel label for the URL requester
33 * @param startDir start directory for the URL requester (optional)
34 * @param parent parent widget
35 */
36 KNameAndUrlInputDialog(const QString &nameLabel, const QString &urlLabel, const QUrl &startDir, QWidget *parent);
37
38 /**
39 * Destructor.
40 */
42
43 /**
44 * Pre-fill the name lineedit.
45 */
46 void setSuggestedName(const QString &name);
47 /**
48 * Pre-fill the URL requester.
49 */
50 void setSuggestedUrl(const QUrl &url);
51
52 /**
53 * @return the name the user entered
54 */
55 QString name() const;
56 /**
57 * @return the URL the user entered
58 */
59 QUrl url() const;
60 /**
61 * @return the URL the user entered, as plain text.
62 * This is only useful for creating relative symlinks.
63 * @since 5.25
64 */
65 QString urlText() const;
66
67private:
68 std::unique_ptr<KNameAndUrlInputDialogPrivate> const d;
69};
70
71#endif
Dialog to ask for a name (e.g. filename) and a URL Basically a merge of KLineEditDlg and KUrlRequeste...
~KNameAndUrlInputDialog() override
Destructor.
This class is a widget showing a lineedit and a button, which invokes a filedialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.