~ubuntu-branches/ubuntu/quantal/smb4k/quantal

« back to all changes in this revision

Viewing changes to core/smb4kipaddressscanner_p.h

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-19 18:54:34 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20120519185434-duffny2n87214n1n
Tags: 1.0.1-1
* New upstream release.
* Update debian/compat: bump to 9.
* Update debian/control:
  - bump debhelper to 9.
  - bump kdelibs5-dev build dependency to 4:4.4.0.
  - bump Standards-Version to 3.9.3 (no changes needed).
  - Replace smbfs dependency by cifs-utils. (Closes: #638162)
* Update debian/copyright:
  - update upstream URL.
  - update upstream e-mail.
* Update debian/smb4k.lintian-overrides file.
* Update debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    smb4kipaddressscanner_p  -  Private classes for the IP address scanner
 
3
    of Smb4K.
 
4
                             -------------------
 
5
    begin                : Mi Jan 28 2009
 
6
    copyright            : (C) 2009-2011 by Alexander Reinholdt
 
7
    email                : alexander.reinholdt@kdemail.net
 
8
 ***************************************************************************/
 
9
 
 
10
/***************************************************************************
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 *   This program is distributed in the hope that it will be useful, but   *
 
17
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
18
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
19
 *   General Public License for more details.                              *
 
20
 *                                                                         *
 
21
 *   You should have received a copy of the GNU General Public License     *
 
22
 *   along with this program; if not, write to the                         *
 
23
 *   Free Software Foundation, 51 Franklin Street, Suite 500, Boston,      *
 
24
 *   MA 02110-1335, USA                                                    *
 
25
 ***************************************************************************/
 
26
 
 
27
#ifndef SMB4KIPADDRESSSCANNER_P_H
 
28
#define SMB4KIPADDRESSSCANNER_P_H
 
29
 
 
30
#ifdef HAVE_CONFIG_H
 
31
#include <config.h>
 
32
#endif
 
33
 
 
34
// Qt includes
 
35
#include <QWidget>
 
36
 
 
37
// KDE includes
 
38
#include <kjob.h>
 
39
 
 
40
// application specific includes
 
41
#include <smb4kipaddressscanner.h>
 
42
#include <smb4kprocess.h>
 
43
 
 
44
class Smb4KIPLookupJob : public KJob
 
45
{
 
46
  Q_OBJECT
 
47
 
 
48
  public:
 
49
    /**
 
50
     * Constructor
 
51
     */
 
52
    Smb4KIPLookupJob( QObject *parent = 0 );
 
53
 
 
54
    /**
 
55
     * Destructor
 
56
     */
 
57
    ~Smb4KIPLookupJob();
 
58
 
 
59
    /**
 
60
     * Returns TRUE if the job has been started and FALSE otherwise
 
61
     *
 
62
     * @returns TRUE if the job has been started
 
63
     */
 
64
    bool isStarted() { return m_started; }
 
65
 
 
66
    /**
 
67
     * Starts the job
 
68
     */
 
69
    void start();
 
70
 
 
71
    /**
 
72
     * Set up the lookup job. You need to set the host, the
 
73
     * parent widget is optional.
 
74
     *
 
75
     * You must run this function before start() is called.
 
76
     *
 
77
     * @param host            The host
 
78
     *
 
79
     * @param parent          The parent widget
 
80
     */
 
81
    void setupLookup( Smb4KHost *host,
 
82
                      QWidget *parentWidget = 0 );
 
83
 
 
84
  signals:
 
85
    /**
 
86
     * This signal is emitted when a lookup process is about to be started.
 
87
     * It passes the host to the receiver.
 
88
     *
 
89
     * @param host          The host
 
90
     */
 
91
    void aboutToStart( Smb4KHost *host );
 
92
 
 
93
    /**
 
94
     * This signal is emitted when a lookup process has finished. It passes
 
95
     * the host to the receiver.
 
96
     *
 
97
     * @param host          The host
 
98
     */
 
99
    void finished( Smb4KHost *host );
 
100
 
 
101
    /**
 
102
     * This signal is emitted when an IP address was successfully looked
 
103
     * up.
 
104
     *
 
105
     * @param host          The host
 
106
     */
 
107
    void ipAddress( Smb4KHost *host );
 
108
 
 
109
  protected:
 
110
    bool doKill();
 
111
 
 
112
  protected slots:
 
113
    void slotStartLookup();
 
114
    void slotReadStandardOutput();
 
115
    void slotReadStandardError();
 
116
    void slotProcessFinished( int exitCode, QProcess::ExitStatus status );
 
117
 
 
118
  private:
 
119
    bool m_started;
 
120
    Smb4KHost *m_host;
 
121
    QWidget *m_parent_widget;
 
122
    Smb4KProcess *m_proc;
 
123
};
 
124
 
 
125
 
 
126
class Smb4KIPAddressScannerPrivate
 
127
{
 
128
  public:
 
129
    Smb4KIPAddressScannerPrivate();
 
130
    ~Smb4KIPAddressScannerPrivate();
 
131
    Smb4KIPAddressScanner instance;
 
132
};
 
133
 
 
134
#endif