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

KIO

  • 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
33class QScrollArea;
34class QLabel;
35class QPixmap;
36class KFileItem;
37
38namespace 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!
56enum 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
61enum 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
70class KIO_EXPORT RenameDialog : public QDialog
71{
72 Q_OBJECT
73public:
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
123public 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
134protected Q_SLOTS:
135 void enableRenameButton(const QString &);
136private 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
144private:
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
KFileItem
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:46
KIO::RenameDialog
The dialog shown when a CopyJob realizes that a destination file already exists, and wants to offer t...
Definition: renamedialog.h:71
KSqueezedTextLabel
KUrl
QDialog
QLabel
QWidget
global.h
ksqueezedtextlabel.h
kurl.h
caption
QString caption()
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
KIO::RenameDialog_Result
RenameDialog_Result
The result of open_RenameDialog().
Definition: renamedialog.h:61
KIO::R_RENAME
@ R_RENAME
Definition: renamedialog.h:61
KIO::R_AUTO_SKIP
@ R_AUTO_SKIP
Definition: renamedialog.h:61
KIO::R_OVERWRITE_ALL
@ R_OVERWRITE_ALL
Definition: renamedialog.h:61
KIO::R_OVERWRITE
@ R_OVERWRITE
Definition: renamedialog.h:61
KIO::R_AUTO_RENAME
@ R_AUTO_RENAME
Definition: renamedialog.h:61
KIO::R_RESUME
@ R_RESUME
Definition: renamedialog.h:61
KIO::R_SKIP
@ R_SKIP
Definition: renamedialog.h:61
KIO::R_CANCEL
@ R_CANCEL
Definition: renamedialog.h:61
KIO::R_RESUME_ALL
@ R_RESUME_ALL
Definition: renamedialog.h:61
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::M_OVERWRITE_ITSELF
@ M_OVERWRITE_ITSELF
Definition: renamedialog.h:56
KIO::M_RESUME
@ M_RESUME
Definition: renamedialog.h:56
KIO::M_SINGLE
@ M_SINGLE
Definition: renamedialog.h:56
KIO::M_MULTI
@ M_MULTI
Definition: renamedialog.h:56
KIO::M_SKIP
@ M_SKIP
Definition: renamedialog.h:56
KIO::M_ISDIR
@ M_ISDIR
Definition: renamedialog.h:56
KIO::M_NORENAME
@ M_NORENAME
Definition: renamedialog.h:56
KIO::M_OVERWRITE
@ M_OVERWRITE
Definition: renamedialog.h:56
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
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