22 #include <kdialogbase.h>
24 #include <tqcheckbox.h>
26 #include <tqcstring.h>
28 #include <tqvaluevector.h>
32 #include <tdemacros.h>
38 class TQMultiLineEdit;
62 bool modal=
true,
const TQString &keyID=TQString());
65 TQString passphrase();
68 KPasswordEdit *lineedit;
76 class TDE_EXPORT
Config :
public TQWidget
82 Config(TQWidget *parent = 0,
const char *name = 0,
bool encrypt =
true);
85 virtual void setValues();
86 virtual void applySettings();
87 TQGroupBox* optionsGroupBox() {
return mpOptionsGroupBox; };
93 TQCheckBox *storePass;
94 TQCheckBox *encToSelf;
95 TQCheckBox *showCipherText;
96 TQCheckBox *showKeyApprovalDlg;
97 TQComboBox *toolCombo;
98 TQGroupBox* mpOptionsGroupBox;
103 #define KeySelectionDialogSuper KDialogBase
104 class TDE_EXPORT KeySelectionDialog:
public KeySelectionDialogSuper
109 enum TrustCheckMode { NoExpensiveTrustCheck,
110 AllowExpensiveTrustCheck,
117 KeySelectionDialog(
const KeyList& keyList,
118 const TQString& title,
119 const TQString& text = TQString(),
120 const KeyIDList& keyIds = KeyIDList(),
121 const bool rememberChoice =
false,
122 const unsigned int allowedKeys = AllKeys,
123 const bool extendedSelection =
false,
124 TQWidget *parent=0,
const char *name=0,
126 virtual ~KeySelectionDialog();
130 virtual KeyID key()
const;
133 virtual KeyIDList keys()
const
136 virtual bool rememberSelection()
const
138 return mRememberCB->isChecked();
144 virtual void slotRereadKeys();
145 virtual void slotSelectionChanged( TQListViewItem* );
146 virtual void slotSelectionChanged();
147 virtual void slotCheckSelection( TQListViewItem* = 0 );
148 virtual void slotRMB( TQListViewItem*,
const TQPoint&,
int );
149 virtual void slotRecheckKey();
150 virtual void slotOk();
151 virtual void slotCancel();
152 virtual void slotSearch(
const TQString & text );
153 virtual void slotFilter();
156 void filterByKeyID(
const TQString & keyID );
157 void filterByKeyIDOrUID(
const TQString & keyID );
158 void filterByUID(
const TQString & uid );
160 bool anyChildMatches(
const TQListViewItem * item, TQRegExp & rx )
const;
162 void initKeylist(
const KeyList& keyList,
const KeyIDList& keyIds );
164 TQString keyInfo(
const Kpgp::Key* )
const;
166 TQString beautifyFingerprint(
const TQCString& )
const;
169 KeyID getKeyId(
const TQListViewItem* )
const;
172 int keyValidity(
const Kpgp::Key* )
const;
175 void updateKeyInfo(
const Kpgp::Key*, TQListViewItem* )
const;
184 int keyAdmissibility( TQListViewItem*,
185 TrustCheckMode = NoExpensiveTrustCheck )
const;
188 bool checkKeys(
const TQValueList<TQListViewItem*>& )
const;
191 TDEListView *mListView;
192 TQCheckBox *mRememberCB;
193 TQPixmap *mKeyGoodPix, *mKeyBadPix, *mKeyUnknownPix, *mKeyValidPix;
195 unsigned int mAllowedKeys;
196 TQTimer* mCheckSelectionTimer;
197 TQTimer* mStartSearchTimer;
198 TQString mSearchText;
199 TQListViewItem* mCurrentContextMenuItem;
201 static const int sCheckSelectionDelay;
204 class TDE_EXPORT KeyRequester:
public TQWidget
210 KeyRequester( TQWidget * parent=0,
bool multipleKeys=
false,
211 unsigned int allowedKeys=AllKeys,
const char * name=0 );
212 virtual ~KeyRequester();
214 KeyIDList keyIDs()
const;
215 void setKeyIDs(
const KeyIDList & keyIDs );
217 TQPushButton * eraseButton()
const {
return mEraseButton; }
218 TQPushButton * dialogButton()
const {
return mDialogButton; }
220 void setDialogCaption(
const TQString & caption );
221 void setDialogMessage(
const TQString & message );
223 bool isMultipleKeysEnabled()
const;
224 void setMultipleKeysEnabled(
bool enable );
226 int allowedKeys()
const;
227 void setAllowedKeys(
int allowed );
231 virtual KeyIDList keyRequestHook( Module * pgp )
const = 0;
235 TQPushButton * mEraseButton;
236 TQPushButton * mDialogButton;
237 TQString mDialogCaption, mDialogMessage;
243 void slotDialogButtonClicked();
244 void slotEraseButtonClicked();
253 virtual void virtual_hook(
int,
void* );
257 class TDE_EXPORT PublicKeyRequester :
public KeyRequester {
261 PublicKeyRequester( TQWidget * parent=0,
bool multipleKeys=
false,
262 unsigned int allowedKeys=PublicKeys,
const char * name=0 );
263 virtual ~PublicKeyRequester();
266 KeyIDList keyRequestHook( Module * pgp )
const;
269 typedef KeyRequester base;
273 virtual void virtual_hook(
int,
void* );
277 class TDE_EXPORT SecretKeyRequester :
public KeyRequester {
281 SecretKeyRequester( TQWidget * parent=0,
bool multipleKeys=
false,
282 unsigned int allowedKeys=SecretKeys,
const char * name=0 );
283 virtual ~SecretKeyRequester();
286 KeyIDList keyRequestHook( Module * pgp )
const;
289 typedef KeyRequester base;
293 virtual void virtual_hook(
int,
void* );
298 class TDE_EXPORT KeyApprovalDialog:
public KDialogBase
304 KeyApprovalDialog(
const TQStringList&,
305 const TQValueVector<KeyIDList>&,
306 const int allowedKeys,
307 TQWidget *parent = 0,
const char *name = 0,
309 virtual ~KeyApprovalDialog() {};
311 TQValueVector<KeyIDList> keys()
const {
return mKeys; };
313 bool preferencesChanged()
const {
return mPrefsChanged; }
316 void slotPrefsChanged(
int ) { mPrefsChanged =
true; };
317 void slotChangeEncryptionKey(
int );
318 virtual void slotOk();
319 virtual void slotCancel();
322 TQValueVector<KeyIDList> mKeys;
326 TQPtrVector<TQLabel> mAddressLabels;
327 TQPtrVector<TQLabel> mKeyIdsLabels;
329 TQPtrVector<TQComboBox> mEncrPrefCombos;
334 class TDE_EXPORT CipherTextDialog:
public KDialogBase
340 CipherTextDialog(
const TQCString & text,
const TQCString & charset=0,
341 TQWidget *parent=0,
const char *name=0,
bool modal=
true );
342 virtual ~CipherTextDialog() {};
345 void setMinimumSize();
346 TQMultiLineEdit *mEditBox;
a widget for configuring the pgp interface.
This class is used to store information about a PGP key.