summaryrefslogtreecommitdiffstats
path: root/kbugbuster/backend/bugjob.h
blob: 2c439810b21034bebcb11b9d7f3a0bf2cd5f45c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef KBB_BUGJOB_H
#define KBB_BUGJOB_H

#include <kio/jobclasses.h>

#include "bugserver.h"

class BugJob : public KIO::Job
{
    Q_OBJECT
  public:
    BugJob( BugServer * );
    virtual ~BugJob();

    BugServer *server() const { return mServer; }

  signals:
    void infoMessage( const QString &text );
    void infoPercent( unsigned long percent );
    void error( const QString &text );
    void jobEnded( BugJob * );

  protected:
    void start( const KURL &url /*, const KParts::URLArgs &args = KParts::URLArgs()*/ );

    virtual void process( const QByteArray &data ) = 0;

  private slots:
    void ioResult( KIO::Job *job );

    void ioData( KIO::Job *job, const QByteArray &data );

    void ioInfoMessage( KIO::Job *job, const QString &text );

    void ioInfoPercent( KIO::Job *job, unsigned long percent );

  private:
    QByteArray m_data;
    BugServer *mServer;
};

#endif
/*
 * vim:sw=4:ts=4:et
 */