/usr/include/kio/renamedialog.h is in kdelibs5-dev 4:4.14.2-5+deb8u2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | /* This file is part of the KDE libraries
Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
1999 - 2008 David Faure <faure@kde.org>
2001 Holger Freyther <freyther@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KIO_RENAMEDIALOG_H
#define KIO_RENAMEDIALOG_H
#include <ksqueezedtextlabel.h>
#include <kurl.h>
#include <QtGui/QDialog>
#include <QtCore/QString>
#include <sys/types.h>
#include <kio/global.h>
class QScrollArea;
class QLabel;
class QPixmap;
class KFileItem;
namespace KIO
{
// KDE5: get rid of M_OVERWRITE_ITSELF, trigger it internally if src==dest
// KDE5: get rid of M_SINGLE. If not multi, then single ;)
// KDE5: use QFlags to get rid of all the casting!
/**
* M_OVERWRITE: We have an existing dest, show details about it and offer to overwrite it.
* M_OVERWRITE_ITSELF: Warn that the current operation would overwrite a file with itself,
* which is not allowed.
* M_SKIP: Offer a "Skip" button, to skip other files too. Requires M_MULTI.
* M_SINGLE: Deprecated and unused, please ignore.
* M_MULTI: Set if the current operation concerns multiple files, so it makes sense
* to offer buttons that apply the user's choice to all files/folders.
* M_RESUME: Offer a "Resume" button (plus "Resume All" if M_MULTI)
* M_NORENAME: Don't offer a "Rename" button
* M_ISDIR: The dest is a directory, so label the "overwrite" button something like "merge" instead.
*/
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 };
/**
* The result of open_RenameDialog().
*/
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};
/**
* The dialog shown when a CopyJob realizes that a destination file already exists,
* and wants to offer the user with the choice to either Rename, Overwrite, Skip;
* this dialog is also used when a .part file exists and the user can choose to
* Resume a previous download.
*/
class KIO_EXPORT RenameDialog : public QDialog
{
Q_OBJECT
public:
/**
* Construct a "rename" dialog to let the user know that @p src is about to overwrite @p dest.
*
* @param parent parent widget (often 0)
* @param caption the caption for the dialog box
* @param src the url to the file/dir we're trying to copy, as it's part of the text message
* @param dest the path to destination file/dir, i.e. the one that already exists
* @param mode parameters for the dialog (which buttons to show...),
* @param sizeSrc size of source file
* @param sizeDest size of destination file
* @param ctimeSrc creation time of source file
* @param ctimeDest creation time of destination file
* @param mtimeSrc modification time of source file
* @param mtimeDest modification time of destination file
* @see RenameDialog_Mode
*/
RenameDialog(QWidget *parent, const QString & caption,
const KUrl & src, const KUrl & dest,
RenameDialog_Mode mode,
KIO::filesize_t sizeSrc = KIO::filesize_t(-1),
KIO::filesize_t sizeDest = KIO::filesize_t(-1),
time_t ctimeSrc = time_t(-1),
time_t ctimeDest = time_t(-1),
time_t mtimeSrc = time_t(-1),
time_t mtimeDest = time_t(-1));
~RenameDialog();
/**
* @return the new destination
* valid only if RENAME was chosen
*/
KUrl newDestUrl();
/**
* @return an automatically renamed destination
* @since 4.5
* valid always
*/
KUrl autoDestUrl() const;
/**
* Given a directory path and a filename (which usually exists already),
* this function returns a suggested name for a file that doesn't exist
* in that directory. The existence is only checked for local urls though.
* The suggested file name is of the form "foo 1", "foo 2" etc.
*/
static QString suggestName(const KUrl& baseURL, const QString& oldName);
public Q_SLOTS:
void cancelPressed();
void renamePressed();
void skipPressed();
void autoSkipPressed();
void overwritePressed();
void overwriteAllPressed();
void resumePressed();
void resumeAllPressed();
void suggestNewNamePressed();
protected Q_SLOTS:
void enableRenameButton(const QString &);
private Q_SLOTS:
void applyAllPressed();
void showSrcIcon(const KFileItem &);
void showDestIcon(const KFileItem &);
void showSrcPreview(const KFileItem &, const QPixmap &);
void showDestPreview(const KFileItem &, const QPixmap &);
void resizePanels();
private:
QScrollArea* createContainerLayout(QWidget* parent, const KFileItem& item, QLabel* preview);
QLabel* createLabel(QWidget* parent, const QString& text, const bool containerTitle);
KSqueezedTextLabel* createSqueezedLabel(QWidget* parent, const QString& text);
class RenameDialogPrivate;
RenameDialogPrivate* const d;
};
}
#endif
|