Changeset View
Changeset View
Standalone View
Standalone View
src/core/filejob.h
Show All 26 Lines | |||||
27 | namespace KIO | 27 | namespace KIO | ||
28 | { | 28 | { | ||
29 | 29 | | |||
30 | class FileJobPrivate; | 30 | class FileJobPrivate; | ||
31 | /** | 31 | /** | ||
32 | * @class KIO::FileJob filejob.h <KIO/FileJob> | 32 | * @class KIO::FileJob filejob.h <KIO/FileJob> | ||
33 | * | 33 | * | ||
34 | * The file-job is an asynchronous version of normal file handling. | 34 | * The file-job is an asynchronous version of normal file handling. | ||
35 | * It allows block-wise reading and writing, and allows seeking. Results are returned through signals. | 35 | * It allows block-wise reading and writing, and allows seeking and truncation. Results are returned through signals. | ||
36 | * | 36 | * | ||
37 | * Should always be created using KIO::open(QUrl) | 37 | * Should always be created using KIO::open(QUrl) | ||
38 | */ | 38 | */ | ||
39 | 39 | | |||
40 | class KIOCORE_EXPORT FileJob : public SimpleJob | 40 | class KIOCORE_EXPORT FileJob : public SimpleJob | ||
41 | { | 41 | { | ||
42 | Q_OBJECT | 42 | Q_OBJECT | ||
43 | 43 | | |||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 44 | public: | |||
94 | * On error the position() signal is not emitted. To catch errors please | 94 | * On error the position() signal is not emitted. To catch errors please | ||
95 | * connect to the result() signal. | 95 | * connect to the result() signal. | ||
96 | * | 96 | * | ||
97 | * @param offset the position from start to go to | 97 | * @param offset the position from start to go to | ||
98 | */ | 98 | */ | ||
99 | void seek(KIO::filesize_t offset); | 99 | void seek(KIO::filesize_t offset); | ||
100 | 100 | | |||
101 | /** | 101 | /** | ||
102 | * Truncate | ||||
103 | * | ||||
104 | * The slave emits truncated() on successful truncation to the specified \p length. | ||||
105 | * | ||||
106 | * On error the truncated() signal is not emitted. To catch errors please | ||||
107 | * connect to the result() signal. | ||||
108 | * | ||||
109 | * @param length the desired length to truncate to | ||||
dfaure: Missing @since 5.66 | |||||
110 | */ | ||||
111 | void truncate(KIO::filesize_t length); | ||||
112 | | ||||
113 | /** | ||||
102 | * Size | 114 | * Size | ||
103 | * | 115 | * | ||
104 | * @return the file size | 116 | * @return the file size | ||
105 | */ | 117 | */ | ||
106 | KIO::filesize_t size(); | 118 | KIO::filesize_t size(); | ||
107 | 119 | | |||
108 | Q_SIGNALS: | 120 | Q_SIGNALS: | ||
109 | /** | 121 | /** | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
155 | 167 | | |||
156 | /** | 168 | /** | ||
157 | * The file has reached this position. Emitted after seek(). | 169 | * The file has reached this position. Emitted after seek(). | ||
158 | * @param job the job that emitted this signal | 170 | * @param job the job that emitted this signal | ||
159 | * @param offset the new position | 171 | * @param offset the new position | ||
160 | */ | 172 | */ | ||
161 | void position(KIO::Job *job, KIO::filesize_t offset); | 173 | void position(KIO::Job *job, KIO::filesize_t offset); | ||
162 | 174 | | |||
175 | /** | ||||
176 | * The file has been truncated to this point. Emitted after truncate(). | ||||
177 | * @param job the job that emitted this signal | ||||
178 | * @param length the new length of the file | ||||
179 | */ | ||||
180 | void truncated(KIO::Job *job, KIO::filesize_t length); | ||||
dfaure: @since 5.66 | |||||
181 | | ||||
163 | protected: | 182 | protected: | ||
164 | FileJob(FileJobPrivate &dd); | 183 | FileJob(FileJobPrivate &dd); | ||
165 | 184 | | |||
166 | private: | 185 | private: | ||
167 | Q_PRIVATE_SLOT(d_func(), void slotRedirection(const QUrl &)) | 186 | Q_PRIVATE_SLOT(d_func(), void slotRedirection(const QUrl &)) | ||
168 | Q_PRIVATE_SLOT(d_func(), void slotData(const QByteArray &data)) | 187 | Q_PRIVATE_SLOT(d_func(), void slotData(const QByteArray &data)) | ||
169 | Q_PRIVATE_SLOT(d_func(), void slotMimetype(const QString &mimetype)) | 188 | Q_PRIVATE_SLOT(d_func(), void slotMimetype(const QString &mimetype)) | ||
170 | Q_PRIVATE_SLOT(d_func(), void slotOpen()) | 189 | Q_PRIVATE_SLOT(d_func(), void slotOpen()) | ||
171 | Q_PRIVATE_SLOT(d_func(), void slotWritten(KIO::filesize_t)) | 190 | Q_PRIVATE_SLOT(d_func(), void slotWritten(KIO::filesize_t)) | ||
172 | Q_PRIVATE_SLOT(d_func(), void slotFinished()) | 191 | Q_PRIVATE_SLOT(d_func(), void slotFinished()) | ||
173 | Q_PRIVATE_SLOT(d_func(), void slotPosition(KIO::filesize_t)) | 192 | Q_PRIVATE_SLOT(d_func(), void slotPosition(KIO::filesize_t)) | ||
193 | Q_PRIVATE_SLOT(d_func(), void slotTruncated(KIO::filesize_t)) | ||||
174 | Q_PRIVATE_SLOT(d_func(), void slotTotalSize(KIO::filesize_t)) | 194 | Q_PRIVATE_SLOT(d_func(), void slotTotalSize(KIO::filesize_t)) | ||
175 | 195 | | |||
176 | Q_DECLARE_PRIVATE(FileJob) | 196 | Q_DECLARE_PRIVATE(FileJob) | ||
177 | }; | 197 | }; | ||
178 | 198 | | |||
179 | /** | 199 | /** | ||
180 | * Open ( random access I/O ) | 200 | * Open ( random access I/O ) | ||
181 | * | 201 | * | ||
Show All 16 Lines |
Missing @since 5.66