22 #include <tqcstring.h>
24 #include <tqstrlist.h>
26 #include <tdemacros.h>
39 MultiPgpMessageBlock = 2,
93 class TDE_EXPORT Block
97 Block( const TQCString& str = TQCString() );
100 TQCString text() const;
101 void setText( const TQCString& str );
103 void setProcessedText( const TQCString& str );
106 void setStatus( const int status );
111 bool isEncrypted() const;
114 bool isSigned() const;
117 bool goodSignature() const;
121 TQString signatureUserId() const;
122 void setSignatureUserId( const TQString& userId );
125 TQCString signatureKeyId() const;
126 void setSignatureKeyId( const TQCString& keyId );
130 TQCString signatureDate() const;
131 void setSignatureDate( const TQCString& date );
134 const TQStrList encryptedFor() const;
138 TQString requiredKey() const;
139 void setRequiredKey( const TQCString& keyId );
141 TQString requiredUserId() const;
142 void setRequiredUserId( const TQString& userId );
144 TQCString error() const;
145 void setError( const TQCString& str );
163 Kpgp::Result clearsign( const TQCString& keyId,
164 const TQCString& charset = TQCString() );
172 Kpgp::Result encrypt( const TQStringList& receivers, const TQCString& keyId,
173 const bool sign, const TQCString& charset = TQCString() );
178 BlockType determineType() const;
181 TQCString mProcessedText;
183 TQString mSignatureUserId;
184 TQCString mSignatureKeyId;
185 TQCString mSignatureDate;
186 TQCString mRequiredKey;
187 TQString mRequiredUserId;
188 TQStrList mEncryptedFor;
190 bool mHasBeenProcessed;
199 if( mHasBeenProcessed )
200 return mProcessedText;
206 Block::setText( const TQCString& str )
213 Block::setProcessedText( const TQCString& str )
215 mProcessedText = str;
216 mHasBeenProcessed = true;
226 Block::setError( const TQCString& str )
232 Block::status() const
238 Block::setStatus( const int status )
246 if( mType == NoPgpBlock )
247 mType = determineType();
252 Block::signatureUserId() const
254 return mSignatureUserId;
258 Block::setSignatureUserId( const TQString& userId )
260 mSignatureUserId = userId;
264 Block::signatureKeyId() const
266 return mSignatureKeyId;
270 Block::setSignatureKeyId( const TQCString& keyId )
272 mSignatureKeyId = keyId;
276 Block::signatureDate() const
278 return mSignatureDate;
282 Block::setSignatureDate( const TQCString& date )
284 mSignatureDate = date;
288 Block::requiredKey() const
294 Block::setRequiredKey( const TQCString& keyId )
296 mRequiredKey = keyId;
300 Block::requiredUserId() const
302 return mRequiredUserId;
306 Block::setRequiredUserId( const TQString& userId )
308 mRequiredUserId = userId;
311 inline const TQStrList
312 Block::encryptedFor() const
314 return mEncryptedFor;
318 Block::isEncrypted() const
320 if( mStatus & ENCRYPTED )
326 Block::isSigned() const
328 if( mStatus & SIGNED )
334 Block::goodSignature() const
336 if( mStatus & GOODSIG )
|