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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
renamedialog.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
3  1999 - 2008 David Faure <faure@kde.org>
4  2001 Holger Freyther <freyther@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KIO_RENAMEDIALOG_H
23 #define KIO_RENAMEDIALOG_H
24 
25 #include <ksqueezedtextlabel.h>
26 #include <kurl.h>
27 #include <QtGui/QDialog>
28 #include <QtCore/QString>
29 #include <sys/types.h>
30 
31 #include <kio/global.h>
32 
33 class QScrollArea;
34 class QLabel;
35 class QPixmap;
36 class KFileItem;
37 
38 namespace KIO
39 {
40 
41 // KDE5: get rid of M_OVERWRITE_ITSELF, trigger it internally if src==dest
42 // KDE5: get rid of M_SINGLE. If not multi, then single ;)
43 // KDE5: use QFlags to get rid of all the casting!
56 enum RenameDialog_Mode { M_OVERWRITE = 1, M_OVERWRITE_ITSELF = 2, M_SKIP = 4, M_SINGLE = 8, M_MULTI = 16, M_RESUME = 32, M_NORENAME = 64, M_ISDIR = 128 };
57 
61 enum RenameDialog_Result {R_RESUME = 6, R_RESUME_ALL = 7, R_OVERWRITE = 4, R_OVERWRITE_ALL = 5, R_SKIP = 2, R_AUTO_SKIP = 3, R_RENAME = 1, R_AUTO_RENAME = 8, R_CANCEL = 0};
62 
63 
70 class KIO_EXPORT RenameDialog : public QDialog
71 {
72  Q_OBJECT
73 public:
90  RenameDialog(QWidget *parent, const QString & caption,
91  const KUrl & src, const KUrl & dest,
92  RenameDialog_Mode mode,
93  KIO::filesize_t sizeSrc = KIO::filesize_t(-1),
94  KIO::filesize_t sizeDest = KIO::filesize_t(-1),
95  time_t ctimeSrc = time_t(-1),
96  time_t ctimeDest = time_t(-1),
97  time_t mtimeSrc = time_t(-1),
98  time_t mtimeDest = time_t(-1));
99  ~RenameDialog();
100 
105  KUrl newDestUrl();
106 
107 
113  KUrl autoDestUrl() const;
114 
121  static QString suggestName(const KUrl& baseURL, const QString& oldName);
122 
123 public Q_SLOTS:
124  void cancelPressed();
125  void renamePressed();
126  void skipPressed();
127  void autoSkipPressed();
128  void overwritePressed();
129  void overwriteAllPressed();
130  void resumePressed();
131  void resumeAllPressed();
132  void suggestNewNamePressed();
133 
134 protected Q_SLOTS:
135  void enableRenameButton(const QString &);
136 private Q_SLOTS:
137  void applyAllPressed();
138  void showSrcIcon(const KFileItem &);
139  void showDestIcon(const KFileItem &);
140  void showSrcPreview(const KFileItem &, const QPixmap &);
141  void showDestPreview(const KFileItem &, const QPixmap &);
142  void resizePanels();
143 
144 private:
145  QScrollArea* createContainerLayout(QWidget* parent, const KFileItem& item, QLabel* preview);
146  QLabel* createLabel(QWidget* parent, const QString& text, const bool containerTitle);
147  KSqueezedTextLabel* createSqueezedLabel(QWidget* parent, const QString& text);
148  class RenameDialogPrivate;
149  RenameDialogPrivate* const d;
150 };
151 
152 }
153 
154 #endif
caption
QString caption()
QWidget
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
KIO::R_RESUME
Definition: renamedialog.h:61
KIO::M_NORENAME
Definition: renamedialog.h:56
kurl.h
KIO::R_OVERWRITE
Definition: renamedialog.h:61
KIO::M_SINGLE
Definition: renamedialog.h:56
global.h
KIO::R_OVERWRITE_ALL
Definition: renamedialog.h:61
KIO::M_OVERWRITE_ITSELF
Definition: renamedialog.h:56
KUrl
KIO::R_CANCEL
Definition: renamedialog.h:61
KIO::R_RESUME_ALL
Definition: renamedialog.h:61
KIO::R_AUTO_SKIP
Definition: renamedialog.h:61
QString
KIO::RenameDialog_Mode
RenameDialog_Mode
M_OVERWRITE: We have an existing dest, show details about it and offer to overwrite it...
Definition: renamedialog.h:56
KIO::R_SKIP
Definition: renamedialog.h:61
KIO::M_SKIP
Definition: renamedialog.h:56
KSqueezedTextLabel
QPixmap
KIO::R_RENAME
Definition: renamedialog.h:61
ksqueezedtextlabel.h
KIO::M_ISDIR
Definition: renamedialog.h:56
KIO::R_AUTO_RENAME
Definition: renamedialog.h:61
KIO::M_OVERWRITE
Definition: renamedialog.h:56
KIO::RenameDialog_Result
RenameDialog_Result
The result of open_RenameDialog().
Definition: renamedialog.h:61
QDialog
KIO::RenameDialog
The dialog shown when a CopyJob realizes that a destination file already exists, and wants to offer t...
Definition: renamedialog.h:70
QScrollArea
KIO::M_RESUME
Definition: renamedialog.h:56
QLabel
KFileItem
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:45
KIO::M_MULTI
Definition: renamedialog.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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