File: ckeyserver.h

package info (click to toggle)
gpgkeys 0.3.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 276 kB
  • ctags: 241
  • sloc: cpp: 2,007; makefile: 53
file content (78 lines) | stat: -rw-r--r-- 1,521 bytes parent folder | download | duplicates (3)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * GPG Keys 
 * ckeyserver.h
 * (c) 2001 Peter Mathiasson <peter@mathiasson.nu>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2, as
 * published by the Free Software Foundation
 */

#ifndef __CKEYSERVER_H__
#define __CKEYSERVER_H__

#include <qobject.h>

class QString;
class QSocket;

class CKeyServer : public QObject
{
    Q_OBJECT

public:
    CKeyServer( QObject *parent = 0 );

    void search( QString searchString );    
    void getKey( QString keyID );
    void sendKey( QString keyData );

    int entriesFound;
    enum {
        Idle,
        Connecting,
        Sending,
        Waiting,
        Recieving
    };

public slots:
    void socketError();
    void socketConnected();
    void socketRead();
    void socketDone();

signals:
    void statusChange( int newStatus );
    void connectionFailed();
    void requestTimedout();

    void searchDone();
    void itemFound( QString type, QString name, QString date, QString keyID );

    void getDone( QString key );
    void sendDone();


private:
    void checkConfig();
    void socketReadSearch();
    QString removeHTMLTags( const QString string );
    void socketReadGet();
    const QString urlEncode( const QString data );
    void socketReadSend();

    QSocket *socket;
    QString server;
    QString searchCommand;
    int port;
    int requestTimeout;
    QString request;
    int operation;

    QString data;

};

#endif // __CKEYSERVER_H__