1
/***************************************************************************
2
smb4knotification - This class provides notifications for Smb4K.
4
begin : Son Jun 27 2010
5
copyright : (C) 2010-2011 by Alexander Reinholdt
6
email : alexander.reinholdt@kdemail.org
7
***************************************************************************/
9
/***************************************************************************
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
15
* This program is distributed in the hope that it will be useful, but *
16
* WITHOUT ANY WARRANTY; without even the implied warranty of *
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18
* General Public License for more details. *
20
* You should have received a copy of the GNU General Public License *
21
* along with this program; if not, write to the *
22
* Free Software Foundation, 51 Franklin Street, Suite 500, Boston, *
23
* MA 02110-1335, USA *
24
***************************************************************************/
26
#ifndef SMB4KNOTIFICATION_H
27
#define SMB4KNOTIFICATION_H
42
// application specific includes
43
#include <smb4kshare.h>
45
// forward declarations
51
* This class provides notifications used thoughout Smb4K.
53
* @author Alexander Reinholdt <alexander.reinholdt@kdemail.net>
57
class KDE_EXPORT Smb4KNotification : public QObject
65
Smb4KNotification( QObject *parent = 0 );
77
* Notify the user that a share has been mounted.
79
* @param share The share that has been mounted
81
void shareMounted( Smb4KShare *share );
84
* Notify the user that a share has been unmounted.
86
* @param share The share that has been unmounted
88
void shareUnmounted( Smb4KShare *share );
91
* Notify the user that shares have been remounted.
93
* @param total The number of remounts that were scheduled
95
* @param actual The number of remounts that were actually
98
void sharesMounted( int total, int actual );
101
* Notify the user that all shares have been unmounted at once.
103
* @param total The number of unmounts that were scheduled
105
* @param actual The number of unmounts that actually finished
108
void allSharesUnmounted( int total, int actual );
115
* Warn the user that the wallet could not be opened.
117
* @param name The name of the wallet
119
void openingWalletFailed( const QString &name );
122
* Warn the user that the logins stored in the wallet could not
125
void loginsNotAccessible();
128
* Tell the user that the mimetype is not supported and that he/she
129
* should convert the file.
131
* @param mimetype The mimetype
133
void mimetypeNotSupported( const QString &mimetype );
136
* Tell the user that this bookmark is already present and that it will
139
* @param bookmark The bookmark
141
void bookmarkExists( Smb4KBookmark *bookmark );
144
* Tell the user that the label he/she chose for the bookmark is already
145
* being used and that it will be changed automatically.
147
* @param bookmark The bookmark
149
void bookmarkLabelInUse( Smb4KBookmark *bookmark );
152
* This warning is shown if the entry of the custom master browser
155
void emptyCustomMasterBrowser();
162
* This error message is shown if the list of workgroups could not
165
* @param err_msg The error message
167
void retrievingDomainsFailed( const QString &err_msg );
170
* This error message is shown if the scanning of the broadcast
173
* @param err_msg The error message
175
void scanningBroadcastAreaFailed( const QString &err_msg );
178
* This error message is shown if the list of servers could not
181
* @param err_msg The error message
183
void retrievingServersFailed( Smb4KWorkgroup *workgroup, const QString &err_msg );
186
* This error message is shown if the list of shares could not
189
* @param host The host object
191
* @param err_msg The error message
193
void retrievingSharesFailed( Smb4KHost *host, const QString &err_msg );
196
* This error message is shown if the preview could not be
199
* @param err_meg The error message
201
void retrievingPreviewFailed( Smb4KShare *share, const QString &err_msg );
204
* This error message is shown if the mounting of a share failed.
206
* @param share The share that was to be mounted
208
* @param err_msg The error message
210
void mountingFailed( Smb4KShare *share, const QString &err_msg );
213
* This error message is shown if the unmounting of a share failed.
215
* @param share The share that was to be unmounted
217
* @param err_msg The error message
219
void unmountingFailed( Smb4KShare *share, const QString &err_msg );
222
* This error message is shown if the unmounting of a certain share
223
* is not allowed for the user.
225
* @param share The share that was to be unmounted
227
void unmountingNotAllowed( Smb4KShare *share );
230
* This error message is shown if printing failed.
232
* @param printer The printer share
234
* @param err_msg The error message
236
void printingFailed( Smb4KShare *printer, const QString &err_msg );
239
* This error message is shown if the synchronization failed.
241
* @param src The source URL
243
* @param dest The destination URL
245
* @param err_msg The error message
247
void synchronizationFailed( const KUrl &src,
249
const QString &err_msg );
252
* This error message is shown if the searching of the network
253
* neighborhood failed.
255
* @param item The search item
257
* @param err_msg The error message
259
void searchingFailed( const QString &item, const QString &err_msg );
262
* This error message is shown if a command could not be found.
264
* @param command The command that could not be found
266
void commandNotFound( const QString &command );
269
* This error message is shown if the user tried to bookmark a printer.
271
* @param share The Smb4KShare object
273
void cannotBookmarkPrinter( Smb4KShare *share );
276
* This error message is shown if a file could not be found.
278
* @param fileName The file name
280
void fileNotFound( const QString &fileName );
283
* This error message is shown if a file could not be opened.
285
* @param file The QFile object
287
void openingFileFailed( const QFile &file );
290
* This error message is shown if a file could not be read.
292
* @param file The QFile object
294
* @param err_msg The error message (optional)
296
void readingFileFailed( const QFile &file, const QString &err_msg );
299
* This error message is shown if the creation of a directory
302
* @param path The path
304
void mkdirFailed( const QDir &dir );
307
* This error message is shown if there are mandatorily needed
310
* @param programs The list of missing programs
312
void missingPrograms( const QStringList &programs );
315
* This error message is shown if a process threw an error.
317
* @param proc_err The code describing the process error
319
void processError( QProcess::ProcessError error );
322
* This error message is shown if a system call returned an error.
324
* @param sys_call The system call as string, e.g. "gethostname()"
326
* @param errno The error number
328
void systemCallFailed( const QString &sys_call, int err_no );
331
* This error message is shown if a KAuth action could not be
332
* executed and KAuth::ActionReply::failed() reported true. Pass
333
* the error code supplied by KAuth::ActionReply::errorCode() to
334
* this function if available.
336
* @param err_code The error code
338
void actionFailed( int err_code = -1 );
341
* This error message is shown when an invalid URL was passed to some core
342
* class that refuses to process it.
344
void invalidURLPassed();
347
* This error message is emitted if the entry of the broadcast areas
350
void emptyBroadcastAreas();
354
* This slot is invoked when the notification is closed or ignored.
356
void slotNotificationClosed();
359
* Opens the contents of a share in a file manager
361
void slotOpenShare();