KIO

kpropertiesdialog.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1998, 1999 Torben Weis <[email protected]>
4  SPDX-FileCopyrightText: 1999, 2000 Preston Brown <[email protected]>
5  SPDX-FileCopyrightText: 2000 Simon Hausmann <[email protected]>
6  SPDX-FileCopyrightText: 2000 David Faure <[email protected]>
7 
8  SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10 
11 #ifndef KPROPERTIESDIALOG_H
12 #define KPROPERTIESDIALOG_H
13 
14 #include <QString>
15 #include <QUrl>
16 
17 #include "kiowidgets_export.h"
18 #include <kfileitem.h>
19 #include <KPageDialog>
20 
22 
23 class KJob;
24 namespace KIO
25 {
26 class Job;
27 }
28 
52 class KIOWIDGETS_EXPORT KPropertiesDialog : public KPageDialog
53 {
54  Q_OBJECT
55 
56 public:
57 
64  static bool canDisplay(const KFileItemList &_items);
65 
76  explicit KPropertiesDialog(const KFileItem &item,
77  QWidget *parent = nullptr);
78 
90  explicit KPropertiesDialog(const KFileItemList &_items,
91  QWidget *parent = nullptr);
92 
104  explicit KPropertiesDialog(const QUrl &url,
105  QWidget *parent = nullptr);
106 
121  explicit KPropertiesDialog(const QList<QUrl> &urls,
122  QWidget *parent = nullptr);
123 
135  KPropertiesDialog(const QUrl &_tempUrl, const QUrl &_currentDir,
136  const QString &_defaultName,
137  QWidget *parent = nullptr);
138 
146  explicit KPropertiesDialog(const QString &title,
147  QWidget *parent = nullptr);
148 
154  virtual ~KPropertiesDialog();
155 
164  static bool showDialog(const KFileItem &item, QWidget *parent = nullptr,
165  bool modal = true);
166 
175  static bool showDialog(const QUrl &_url, QWidget *parent = nullptr,
176  bool modal = true);
177 
187  static bool showDialog(const KFileItemList &_items, QWidget *parent = nullptr,
188  bool modal = true);
189 
207  static bool showDialog(const QList<QUrl> &urls, QWidget *parent = nullptr,
208  bool modal = true);
209 
223  void insertPlugin(KPropertiesDialogPlugin *plugin);
224 
225 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0)
226 
229  KIOWIDGETS_DEPRECATED_VERSION(5, 0, "Use KPropertiesDialog::url()")
230  QUrl kurl() const
231  {
232  return url();
233  }
234 #endif
235 
243  QUrl url() const;
244 
252  KFileItem &item();
253 
257  KFileItemList items() const;
258 
266  QUrl currentDir() const;
267 
274  QString defaultName() const;
275 
282  void updateUrl(const QUrl &newUrl);
283 
290  void rename(const QString &_name);
291 
295  void abortApplying();
296 
303  void showFileSharingPage();
304 
314  void setFileSharingPage(QWidget *page);
315 
321  void setFileNameReadOnly(bool ro);
322 
324 
325 public Q_SLOTS:
330  KIOWIDGETS_DEPRECATED_VERSION(5, 25, "Use KPropertiesDialog::accept()")
331  virtual void slotOk();
336  KIOWIDGETS_DEPRECATED_VERSION(5, 25, "Use KPropertiesDialog::reject()")
337  virtual void slotCancel();
338 
343  void accept() override;
348  void reject() override;
349 
350 Q_SIGNALS:
355  void propertiesClosed();
356 
361  void applied();
362 
368  void canceled();
374  void saveAs(const QUrl &oldUrl, QUrl &newUrl);
375 
376 Q_SIGNALS:
377  void leaveModality();
378 private:
379  class KPropertiesDialogPrivate;
380  KPropertiesDialogPrivate *const d;
381 
382  Q_DISABLE_COPY(KPropertiesDialog)
383 };
384 
399 class KIOWIDGETS_EXPORT KPropertiesDialogPlugin : public QObject
400 {
401  Q_OBJECT
402 public:
409  virtual ~KPropertiesDialogPlugin();
410 
416  virtual void applyChanges();
417 
418 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(4, 1)
419 
424  KIOWIDGETS_DEPRECATED_VERSION(4, 1, "Use KFileItem::isDesktopFile()")
425  static bool isDesktopFile(const KFileItem &_item);
426 #endif
427 
428  void setDirty(bool b);
429  bool isDirty() const;
430 
431 public Q_SLOTS:
432  void setDirty(); // same as setDirty( true ). TODO KDE5: void setDirty(bool dirty=true);
433 
434 Q_SIGNALS:
440  void changed();
441 
442 protected:
447 
451  int fontHeight() const;
452 
453 private:
454  class KPropertiesDialogPluginPrivate;
455  KPropertiesDialogPluginPrivate *const d;
456 };
457 
458 #endif
459 
A namespace for KIO globals.
Definition: authinfo.h:21
KPropertiesDialog * properties
Pointer to the dialog.
QDialogButtonBox * buttonBox()
A Plugin in the Properties dialog This is an abstract class.
KIOCORE_EXPORT SimpleJob * rename(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
Rename a file or directory.
Definition: simplejob.cpp:360
List of KFileItems, which adds a few helper methods to QList<KFileItem>.
Definition: kfileitem.h:587
The main properties dialog class.
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Sep 17 2020 23:00:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.