summaryrefslogtreecommitdiffstats
path: root/kgpg/kgpg.h
blob: e797d28a07530810fb633e754425ed90d9ee7704 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/***************************************************************************
                          kgpg.h  -  description
                             -------------------
    begin                : Mon Nov 18 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 KGPGAPPLET_H
#define KGPGAPPLET_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <tdeaction.h>
#include <ksystemtray.h>
#include <kuniqueapplication.h>
#include <kurl.h>
#include <tdeshortcut.h>

#include <tqlabel.h>
#include <tqstringlist.h>
#include <tqclipboard.h>


class TQPopupMenu;
class KTempFile;
class TDEAboutData;
class KPassivePopup;
class KgpgWizard;
class popupPublic;

class MyView : public TQLabel
{

        Q_OBJECT
  

public:
        MyView( TQWidget *parent = 0, const char *name = 0);
        ~MyView();

        KURL droppedUrl;
        KURL::List droppedUrls;
        KTempFile *kgpgfoldertmp;
	TDEShortcut goDefaultKey;
	TQClipboard::Mode clipboardMode;

private:
        TQPopupMenu *droppopup,*udroppopup;
        TDEAboutData   *_aboutData;
        TQStringList customDecrypt;
        KgpgWizard *wiz;
        KPassivePopup *pop;
        KTempFile *kgpgFolderExtract;
	int compressionScheme,openTasks;
	popupPublic *dialogue;

public slots:
	void busyMessage(TQString mssge,bool reset=false);
        void  encryptDroppedFile();
        void  decryptDroppedFile();
        void  slotVerifyFile();
        void  signDroppedFile();
        void  showDroppedFile ();
        void  clipDecrypt();
	void  clipSign(bool openEditor=true);
        void  clipEncrypt();
        void  shredDroppedFile();
        void encryptDroppedFolder();
        void startFolderEncode(TQStringList selec,TQStringList encryptOptions,bool ,bool symetric);
        void  slotFolderFinished(KURL);
        void  slotFolderFinishedError(TQString errmsge);
	void  encryptFiles(KURL::List urls);
	void installShred();

private slots:
        void  slotWizardClose();
        void  startWizard();
	void  slotWizardChange();
        void  slotSaveOptionsPath();
        void  slotGenKey();
        void importSignature(TQString ID);
        void slotSetClip(TQString newtxt);
	void slotPassiveClip();
        void encryptClipboard(TQStringList selec,TQStringList encryptOptions,bool,bool symmetric);
        void help();
        void about();
        void firstRun();
        void readOptions();
        void  droppedfile (KURL::List);
        void  droppedtext (TQString inputText, bool allowEncrypt=true);
        void  unArchive();
        void slotSetCompression(int cp);
	void  decryptNextFile();

protected:
        virtual void dragEnterEvent(TQDragEnterEvent *);
        virtual void  dropEvent (TQDropEvent*);

protected slots:


signals:
	void setFont(TQFont);
        void readAgain2();
	void createNewKey();
	void updateDefault(TQString);
	void importedKeys(TQStringList);
};

class kgpgapplet : public KSystemTray//KUniqueApplication
{
        Q_OBJECT
  

public:
        kgpgapplet( TQWidget *parent = 0, const char *name = 0);
        /** destructor */
        ~kgpgapplet();
        MyView *w;

private:
        KSystemTray *kgpgapp;
	TDEAction *KgpgEncryptClipboard, *KgpgDecryptClipboard, *KgpgSignClipboard;

private slots:
	void slotOpenKeyManager();
	void slotOpenServerDialog();
	void showOptions();
	void checkMenu();
};

class TDECmdLineArgs;

class KgpgAppletApp : public KUniqueApplication
{
        Q_OBJECT
  
        friend class kgpgapplet;
public:
        KgpgAppletApp();
        ~KgpgAppletApp();
        int newInstance ();
        KURL::List urlList;
        bool running;
	TDEShortcut goHome;

protected:
        TDECmdLineArgs *args;
private:
        kgpgapplet *kgpg_applet;
        class listKeys *s_keyManager;

private slots:
        void slotHandleQuit();
	void wizardOver(TQString defaultKeyId);
};

#endif // KGPGAPPLET_H