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

KIO

  • kio
  • kio
copyjob.h
Go to the documentation of this file.
1// -*- c++ -*-
2/* This file is part of the KDE libraries
3 Copyright 2000 Stephan Kulow <coolo@kde.org>
4 Copyright 2000-2006 David Faure <faure@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_COPYJOB_H
23#define KIO_COPYJOB_H
24
25#include <QtCore/QObject>
26#include <QtCore/QStringList>
27
28#include <sys/types.h> // time_t
29
30#include <kurl.h>
31
32#include "jobclasses.h"
33
34class QTimer;
35
36namespace KIO {
37
41 struct CopyInfo
42 {
43 KUrl uSource;
44 KUrl uDest;
45 QString linkDest; // for symlinks only
46 int permissions;
47 time_t ctime;
48 time_t mtime;
49 KIO::filesize_t size; // 0 for dirs
50 };
51
52 class CopyJobPrivate;
65 class KIO_EXPORT CopyJob : public Job {
66
67 Q_OBJECT
68
69 public:
73 enum CopyMode { Copy, Move, Link };
74
75 virtual ~CopyJob();
76
81 CopyMode operationMode() const;
82
87 KUrl::List srcUrls() const;
88
93 KUrl destUrl() const;
94
102 void setDefaultPermissions( bool b );
103
111 void setAutoSkip(bool autoSkip);
112
120 void setAutoRename(bool autoRename);
121
128 void setWriteIntoExistingDirectories(bool overwriteAllDirs);
129
133 virtual bool doSuspend();
134
135 Q_SIGNALS:
136
142 void totalFiles( KJob *job, unsigned long files );
148 void totalDirs( KJob *job, unsigned long dirs );
149
157 void aboutToCreate( KIO::Job *job, const QList<KIO::CopyInfo> &files);
158
164 void processedFiles( KIO::Job *job, unsigned long files );
170 void processedDirs( KIO::Job *job, unsigned long dirs );
171
183 void copying( KIO::Job *job, const KUrl& src, const KUrl& dest );
195 void linking( KIO::Job *job, const QString& target, const KUrl& to );
207 void moving( KIO::Job *job, const KUrl& from, const KUrl& to );
216 void creatingDir( KIO::Job *job, const KUrl& dir );
224 void renamed( KIO::Job *job, const KUrl& from, const KUrl& to );
225
241 void copyingDone( KIO::Job *job, const KUrl &from, const KUrl &to, time_t mtime, bool directory, bool renamed );
251 void copyingLinkDone( KIO::Job *job, const KUrl &from, const QString& target, const KUrl& to );
252 protected Q_SLOTS:
253 virtual void slotResult( KJob *job );
254
255 protected:
256 CopyJob(CopyJobPrivate &dd);
257 void emitResult();
258
259 private:
260 Q_PRIVATE_SLOT(d_func(), void slotStart())
261 Q_PRIVATE_SLOT(d_func(), void slotEntries( KIO::Job*, const KIO::UDSEntryList& list ))
262 Q_PRIVATE_SLOT(d_func(), void slotSubError(KIO::ListJob*, KIO::ListJob*))
263 Q_PRIVATE_SLOT(d_func(), void slotProcessedSize( KJob*, qulonglong data_size ))
264 Q_PRIVATE_SLOT(d_func(), void slotTotalSize( KJob*, qulonglong size ))
265 Q_PRIVATE_SLOT(d_func(), void slotReport())
266 Q_PRIVATE_SLOT(d_func(), void sourceStated(const KIO::UDSEntry& entry, const KUrl& sourceUrl))
267
268 Q_DECLARE_PRIVATE(CopyJob)
269 };
270
288 KIO_EXPORT CopyJob *copy( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
289
307 KIO_EXPORT CopyJob *copyAs( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
308
320 KIO_EXPORT CopyJob *copy( const KUrl::List& src, const KUrl& dest, JobFlags flags = DefaultFlags );
321
335 KIO_EXPORT CopyJob *move( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
349 KIO_EXPORT CopyJob *moveAs( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
362 KIO_EXPORT CopyJob *move( const KUrl::List& src, const KUrl& dest, JobFlags flags = DefaultFlags );
363
374 KIO_EXPORT CopyJob *link( const KUrl& src, const KUrl& destDir, JobFlags flags = DefaultFlags );
375
387 KIO_EXPORT CopyJob *link( const KUrl::List& src, const KUrl& destDir, JobFlags flags = DefaultFlags );
388
402 KIO_EXPORT CopyJob *linkAs( const KUrl& src, const KUrl& dest, JobFlags flags = DefaultFlags );
403
413 KIO_EXPORT CopyJob *trash( const KUrl& src, JobFlags flags = DefaultFlags );
414
423 KIO_EXPORT CopyJob *trash( const KUrl::List& src, JobFlags flags = DefaultFlags );
424
425}
426
427#endif
KIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: copyjob.h:65
KIO::CopyJob::CopyMode
CopyMode
Defines the mode of the operation.
Definition: copyjob.h:73
KIO::CopyJob::Copy
@ Copy
Definition: copyjob.h:73
KIO::CopyJob::linking
void linking(KIO::Job *job, const QString &target, const KUrl &to)
KIO::CopyJob::copying
void copying(KIO::Job *job, const KUrl &src, const KUrl &dest)
KIO::CopyJob::totalDirs
void totalDirs(KJob *job, unsigned long dirs)
Emitted when the toal number of direcotries is known.
KIO::CopyJob::copyingDone
void copyingDone(KIO::Job *job, const KUrl &from, const KUrl &to, time_t mtime, bool directory, bool renamed)
KIO::CopyJob::aboutToCreate
void aboutToCreate(KIO::Job *job, const QList< KIO::CopyInfo > &files)
Emitted when it is known which files / directories are going to be created.
KIO::CopyJob::copyingLinkDone
void copyingLinkDone(KIO::Job *job, const KUrl &from, const QString &target, const KUrl &to)
KIO::CopyJob::renamed
void renamed(KIO::Job *job, const KUrl &from, const KUrl &to)
KIO::CopyJob::totalFiles
void totalFiles(KJob *job, unsigned long files)
Emitted when the total number of files is known.
KIO::CopyJob::moving
void moving(KIO::Job *job, const KUrl &from, const KUrl &to)
KIO::CopyJob::processedDirs
void processedDirs(KIO::Job *job, unsigned long dirs)
Sends the number of processed directories.
KIO::CopyJob::creatingDir
void creatingDir(KIO::Job *job, const KUrl &dir)
KIO::CopyJob::processedFiles
void processedFiles(KIO::Job *job, unsigned long files)
Sends the number of processed files.
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:936
KIO::UDSEntry
Universal Directory Service.
Definition: udsentry.h:59
KJob
KUrl::List
KUrl
QList
jobclasses.h
kurl.h
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
KIO::filesize_t
qulonglong filesize_t
64-bit file size
Definition: global.h:57
Link
Link
KIO::CopyInfo
Definition: copyjob.h:42
KIO::CopyInfo::uDest
KUrl uDest
Definition: copyjob.h:44
KIO::CopyInfo::permissions
int permissions
Definition: copyjob.h:46
KIO::CopyInfo::mtime
time_t mtime
Definition: copyjob.h:48
KIO::CopyInfo::size
KIO::filesize_t size
Definition: copyjob.h:49
KIO::CopyInfo::ctime
time_t ctime
Definition: copyjob.h:47
KIO::CopyInfo::linkDest
QString linkDest
Definition: copyjob.h:45
KIO::CopyInfo::uSource
KUrl uSource
Definition: copyjob.h:43
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