summaryrefslogtreecommitdiffstats
path: root/kgpg/kgpglibrary.h
blob: 1892f5f2bffe041dfa5f9b4238926b75ecd54d3b (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
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
79
80
81
/***************************************************************************
                          kgpglibrary.h  -  description
                             -------------------
    begin                : Mon Jul 8 2002
    copyright          : (C) 2002 by Jean-Baptiste Mardelle
    email                : bj@altern.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef KGPGLIBRARY_H
#define KGPGLIBRARY_H

#include <qobject.h>
#include <kurl.h>
#include <kshortcut.h>
#include <kio/job.h> 

class KPassivePopup;
class KProgress;

class KgpgLibrary : public QObject
{

        Q_OBJECT

public:
        /**
         * Initialize the class
         */
        KgpgLibrary(QWidget *parent=0,bool pgpExtension=false);
        ~KgpgLibrary();

        KURL::List urlselecteds;

public slots:
        void slotFileEnc(KURL::List urls=KURL(""),QStringList opts=QString::null,QStringList defaultKey=QString::null,KShortcut goDefaultKey=QKeySequence(CTRL+Qt::Key_Home));
        void slotFileDec(KURL srcUrl,KURL destUrl,QStringList customDecryptOption=QStringList());
	void shredprocessenc(KURL::List filesToShred);

private slots:
	void startencode(QStringList encryptKeys,QStringList encryptOptions,bool shred,bool symetric);
        void fastencode(KURL &fileToCrypt,QStringList selec,QStringList encryptOptions,bool symetric);
//        void startencode(QString &selec,QString encryptOptions,bool shred,bool symetric);
	void slotShredResult( KIO::Job * job );
	void shredpreprocessenc(KURL fileToShred);
        void processenc(KURL);
        void processdecover();
        void processdecerror(QString mssge);
        void processencerror(QString mssge);
        void processpopup(QString fileName);
        void processpopup2(QString fileName);

private:
        QString customDecrypt,tempFile,extension;
        KURL urlselected;
        KPassivePopup *pop;
	KProgress *shredProgressBar;
	bool popIsActive;
	QWidget *panel;
	QStringList _encryptKeys;
	QStringList _encryptOptions;
	bool _shred;
	bool _symetric;

signals:
        void decryptionOver();
	void importOver(QStringList);
	void systemMessage(QString,bool reset=false);
};

#endif // KGPGLIBRARY_H