summaryrefslogtreecommitdiffstats
path: root/kbugbuster/backend/bugjob.h
blob: 00ab7f8f3cbfd1dfa06fd3a61a8f5c427f28b9be (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 TQString &text );
    void infoPercent( unsigned long percent );
    void error( const TQString &text );
    void jobEnded( BugJob * );

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

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

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

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

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

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

  private:
    TQByteArray m_data;
    BugServer *mServer;
};

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