36
39
// application specific includes
40
#include <smb4kscanner.h>
41
#include <smb4kprocess.h>
37
42
#include <smb4kworkgroup.h>
38
#include <smb4khost.h>
43
#include <smb4kauthinfo.h>
45
// forward declarations
49
class Smb4KLookupDomainsJob : public KJob
57
Smb4KLookupDomainsJob( QObject *parent = 0 );
62
~Smb4KLookupDomainsJob();
65
* Returns TRUE if the job has been started and FALSE otherwise
67
* @returns TRUE if the job has been started
69
bool isStarted() { return m_started; }
77
* Sets up the lookup job.
79
* @param parent The parent widget
81
void setupLookup( QWidget *parent = 0 );
84
* Returns the parent widget
86
* @returns the parent widget
88
QWidget *parentWidget() { return m_parent_widget; }
91
* Returns the list of discovered workgroups. You can use this function
92
* after the finished() signal has been emitted to retrieve the complete
95
* @returns the list of workgroups
97
const QList<Smb4KWorkgroup> &workgroupsList() { return m_workgroups_list; }
101
* This signal is emitted when a lookup process is about
107
* This signal is emitted when a lookup process finished
112
* Emits the list of discovered workgroups and domains
114
void workgroups( const QList<Smb4KWorkgroup> &list );
120
void slotStartLookup();
121
void slotReadStandardError();
122
void slotProcessFinished( int exitCode,
123
QProcess::ExitStatus exitStatus );
126
void processWorkgroups();
128
QWidget *m_parent_widget;
129
Smb4KProcess *m_proc;
130
QList<Smb4KWorkgroup> m_workgroups_list;
134
class Smb4KQueryMasterJob : public KJob
142
Smb4KQueryMasterJob( QObject *parent = 0 );
147
~Smb4KQueryMasterJob();
150
* Returns TRUE if the job has been started and FALSE otherwise
152
* @returns TRUE if the job has been started
154
bool isStarted() { return m_started; }
162
* Sets up the lookup job. With the @p master argument you can
163
* define a custom master browser that should be queried. If
164
* @p master is empty, the current master browser is queried.
166
* @param master The master browser's name or IP address
168
* @param parent The parent widget
170
void setupLookup( const QString &master,
171
QWidget *parent = 0 );
174
* Returns the parent widget
176
* @returns the parent widget
178
QWidget *parentWidget() { return m_parent_widget; }
181
* Returns the name of either the custom master browser, if one was
182
* passed, or, in the case of an authentication error, the master
183
* browser that needs authentication.
185
* @returns the custom master browser's name
187
const QString &masterBrowser() { return m_master_browser; }
190
* Returns the list of discovered workgroups. You can use this function
191
* after the finished() signal has been emitted to retrieve the complete
192
* list of workgroups.
194
* @returns the list of workgroups
196
const QList<Smb4KWorkgroup> &workgroupsList() { return m_workgroups_list; }
200
* This signal is emitted when a lookup process is about
206
* This signal is emitted when a lookup process finished
211
* Emits the list of discovered workgroups and domains
213
void workgroups( const QList<Smb4KWorkgroup> &list );
216
* This signal is emitted when an authentication error
219
* @param job This job
221
void authError( Smb4KQueryMasterJob *job );
227
void slotStartLookup();
228
void slotReadStandardError();
229
void slotProcessFinished( int exitCode,
230
QProcess::ExitStatus exitStatus );
233
void processWorkgroups();
235
QWidget *m_parent_widget;
236
QString m_master_browser;
237
Smb4KProcess *m_proc;
238
QList<Smb4KWorkgroup> m_workgroups_list;
242
class Smb4KScanBAreasJob : public KJob
250
Smb4KScanBAreasJob( QObject *parent = 0 );
255
~Smb4KScanBAreasJob();
258
* Returns TRUE if the job has been started and FALSE otherwise
260
* @returns TRUE if the job has been started
262
bool isStarted() { return m_started; }
270
* Sets up the scan job
272
* @param parent The parent widget
274
void setupScan( QWidget *parent = 0 );
277
* Returns the parent widget
279
* @returns the parent widget
281
QWidget *parentWidget() { return m_parent_widget; }
284
* Returns the list of discovered workgroups. You can use this function
285
* after the finished() signal has been emitted to retrieve the complete
286
* list of workgroups.
288
* @returns the list of workgroups
290
const QList<Smb4KWorkgroup> &workgroupsList() { return m_workgroups_list; }
293
* Returns the list of discovered hosts. You can use this function
294
* after the finished() signal has been emitted to retrieve the complete
297
* @returns the list of hosts
299
const QList<Smb4KHost> &hostsList() { return m_hosts_list; }
303
* This signal is emitted when a scan process is about
309
* This signal is emitted when a scan process finished
314
* Emits the list of discovered workgroups and domains.
316
* @param list The list of workgroups
318
void workgroups( const QList<Smb4KWorkgroup> &list );
321
* Emits the list of discovered hosts.
323
* @param list The list of hosts
325
void hosts( const QList<Smb4KHost> &list );
331
void slotStartScan();
332
void slotReadStandardError();
333
void slotProcessFinished( int exitCode,
334
QProcess::ExitStatus exitStatus );
339
QWidget *m_parent_widget;
340
Smb4KProcess *m_proc;
341
QList<Smb4KWorkgroup> m_workgroups_list;
342
QList<Smb4KHost> m_hosts_list;
346
class Smb4KLookupDomainMembersJob : public KJob
354
Smb4KLookupDomainMembersJob( QObject *parent = 0 );
359
~Smb4KLookupDomainMembersJob();
362
* Returns TRUE if the job has been started and FALSE otherwise
364
* @returns TRUE if the job has been started
366
bool isStarted() { return m_started; }
374
* Sets up the lookup job.
376
* @param workgroup The workgroup for that the hosts should be looked up
378
* @param parent The parent widget
380
void setupLookup( Smb4KWorkgroup *workgroup,
381
QWidget *parent = 0 );
384
* Returns the parent widget
386
* @returns the parent widget
388
QWidget *parentWidget() { return m_parent_widget; }
391
* Returns the workgroup for that the hosts were looked up.
392
* Please note that this is a copy of the initial workgroup object.
394
* @returns the workgroup
396
Smb4KWorkgroup *workgroup() { return &m_workgroup; }
399
* Returns the list of discovered hosts. You can use this function
400
* after the finished() signal has been emitted to retrieve the
401
* list of hosts discovered in the defined workgroup.
403
* @returns the list of hosts
405
const QList<Smb4KHost> &hostsList() { return m_hosts_list; }
409
* This signal is emitted when the lookup process is about to start.
411
* @param workgroup The workgroup for that the hosts should be looked up
413
void aboutToStart( Smb4KWorkgroup *workgroup );
416
* This signal is emitted when the lookup process finished.
418
* @param workgroup The workgroup for that the hosts should be looked up
420
void finished( Smb4KWorkgroup *workgroup );
423
* Emits the list of @p hosts that belong to a certain @p workgroup.
425
* @param workgroup The workgroup
427
* @param list The list of hosts
429
void hosts( Smb4KWorkgroup *workgroup,
430
const QList<Smb4KHost> &list );
433
* This signal is emitted when an authentication error
436
* @param job This job
438
void authError( Smb4KLookupDomainMembersJob *job );
444
void slotStartLookup();
445
void slotReadStandardError();
446
void slotProcessFinished( int exitCode,
447
QProcess::ExitStatus exitStatus );
451
QWidget *m_parent_widget;
452
Smb4KWorkgroup m_workgroup;
453
Smb4KProcess *m_proc;
454
QList<Smb4KHost> m_hosts_list;
455
Smb4KHost m_master_browser;
459
class Smb4KLookupSharesJob : public KJob
467
Smb4KLookupSharesJob( QObject* parent = 0 );
472
~Smb4KLookupSharesJob();
475
* Returns TRUE if the job has been started and FALSE otherwise
477
* @returns TRUE if the job has been started
479
bool isStarted() { return m_started; }
487
* Sets up the lookup job.
489
* @param workgroup The host that is to be asked for its shared resources
491
* @param parent The parent widget
493
void setupLookup( Smb4KHost *host,
494
QWidget *parent = 0 );
497
* Returns the parent widget
499
* @returns the parent widget
501
QWidget *parentWidget() { return m_parent_widget; }
504
* Returns the host that is/was queried for its shared resources.
505
* Please note that this is a copy of the initial host object.
509
Smb4KHost *host() { return &m_host; }
513
* This signal is emitted when the lookup process is about to start.
515
* @param host The host that is queried for its shares
517
void aboutToStart( Smb4KHost *host );
520
* This signal is emitted when the lookup process finished.
522
* @param host The host that is queried for its shares
524
void finished( Smb4KHost *host );
527
* This signal emits the list of shares that was retrieved from
530
* @param host The host
532
* @param list The list of shares
534
void shares( Smb4KHost *host,
535
const QList<Smb4KShare> &list );
538
* This signal is emitted when an authentication error
541
* @param job This job
543
void authError( Smb4KLookupSharesJob *job );
549
void slotStartLookup();
550
void slotReadStandardError();
551
void slotProcessFinished( int exitCode,
552
QProcess::ExitStatus exitStatus );
555
void processShares();
558
QWidget *m_parent_widget;
559
Smb4KProcess *m_proc;
560
QList<Smb4KShare> m_shares_list;
564
class Smb4KLookupInfoJob : public KJob
572
Smb4KLookupInfoJob( QObject *parent = 0 );
577
~Smb4KLookupInfoJob();
580
* Returns TRUE if the job has been started and FALSE otherwise
582
* @returns TRUE if the job has been started
584
bool isStarted() { return m_started; }
592
* Sets up the lookup job.
594
* @param workgroup The host that is to be asked for its shared resources
596
* @param parent The parent widget
598
void setupLookup( Smb4KHost *host,
599
QWidget *parent = 0 );
602
* Returns the parent widget
604
* @returns the parent widget
606
QWidget *parentWidget() { return m_parent_widget; }
610
* This signal is emitted when the lookup process is about to start.
612
* @param host The host that is queried for the additional
615
void aboutToStart( Smb4KHost *host );
618
* This signal is emitted when the lookup process finished.
620
* @param host The host that was queried for the additional
623
void finished( Smb4KHost *host );
626
* This signal is emitted when and if additional information was
629
* @param host The host that was queried for and now carries
630
* additional information
632
void info( Smb4KHost *host );
638
void slotStartLookup();
639
void slotProcessFinished( int exitCode,
640
QProcess::ExitStatus exitStatus );
646
QWidget *m_parent_widget;
647
Smb4KProcess *m_proc;
41
651
class Smb4KScannerPrivate