libkpimidentities

identity.cpp
1// tdemidentity.cpp
2// License: GPL
3
4#ifdef HAVE_CONFIG_H
5#include <config.h>
6#endif
7
8#include "identity.h"
9
10#include <libtdepim/tdefileio.h>
11#include <libtdepim/collectingprocess.h>
12
13#include <kdebug.h>
14#include <tdelocale.h>
15#include <tdemessagebox.h>
16#include <tdeconfig.h>
17#include <kurl.h>
18
19#include <tqfileinfo.h>
20
21#include <sys/types.h>
22#include <stdlib.h>
23#include <stdio.h>
24#include <errno.h>
25#include <assert.h>
26
27using namespace KPIM;
28
29
30Signature::Signature()
31 : mType( Disabled )
32{
33
34}
35
36Signature::Signature( const TQString & text )
37 : mText( text ),
38 mType( Inlined )
39{
40
41}
42
43Signature::Signature( const TQString & url, bool isExecutable )
44 : mUrl( url ),
45 mType( isExecutable ? FromCommand : FromFile )
46{
47}
48
49bool Signature::operator==( const Signature & other ) const {
50 if ( mType != other.mType ) return false;
51 switch ( mType ) {
52 case Inlined: return mText == other.mText;
53 case FromFile:
54 case FromCommand: return mUrl == other.mUrl;
55 default:
56 case Disabled: return true;
57 }
58}
59
60TQString Signature::rawText( bool * ok ) const
61{
62 switch ( mType ) {
63 case Disabled:
64 if ( ok ) *ok = true;
65 return TQString();
66 case Inlined:
67 if ( ok ) *ok = true;
68 return mText;
69 case FromFile:
70 return textFromFile( ok );
71 case FromCommand:
72 return textFromCommand( ok );
73 };
74 kdFatal( 5006 ) << "Signature::type() returned unknown value!" << endl;
75 return TQString(); // make compiler happy
76}
77
78TQString Signature::textFromCommand( bool * ok ) const
79{
80 assert( mType == FromCommand );
81
82 // handle pathological cases:
83 if ( mUrl.isEmpty() ) {
84 if ( ok ) *ok = true;
85 return TQString();
86 }
87
88 // create a shell process:
89 CollectingProcess proc;
90 proc.setUseShell(true);
91 proc << mUrl;
92
93 // run the process:
94 int rc = 0;
95 if ( !proc.start( TDEProcess::Block, TDEProcess::Stdout ) )
96 rc = -1;
97 else
98 rc = ( proc.normalExit() ) ? proc.exitStatus() : -1 ;
99
100 // handle errors, if any:
101 if ( rc != 0 ) {
102 if ( ok ) *ok = false;
103 TQString wmsg = i18n("<qt>Failed to execute signature script<br><b>%1</b>:<br>%2</qt>")
104 .arg( mUrl ).arg( strerror(rc) );
105 KMessageBox::error(0, wmsg);
106 return TQString();
107 }
108
109 // no errors:
110 if ( ok ) *ok = true;
111
112 // get output:
113 TQByteArray output = proc.collectedStdout();
114
115 // ### hmm, should we allow other encodings, too?
116 return TQString::fromLocal8Bit( output.data(), output.size() );
117}
118
119TQString Signature::textFromFile( bool * ok ) const
120{
121 assert( mType == FromFile );
122
123 // ### FIXME: Use TDEIO::NetAccess to download non-local files!
124 if ( !KURL(mUrl).isLocalFile() && !(TQFileInfo(mUrl).isRelative()
125 && TQFileInfo(mUrl).exists()) ) {
126 kdDebug( 5006 ) << "Signature::textFromFile: non-local URLs are unsupported" << endl;
127 if ( ok ) *ok = false;
128 return TQString();
129 }
130 if ( ok ) *ok = true;
131 // ### hmm, should we allow other encodings, too?
132 return TQString::fromLocal8Bit( kFileToString( mUrl, false ) );
133}
134
135TQString Signature::withSeparator( bool * ok ) const
136{
137 bool internalOK = false;
138 TQString signature = rawText( &internalOK );
139 if ( !internalOK ) {
140 if ( ok ) *ok = false;
141 return TQString();
142 }
143 if ( ok ) *ok = true;
144 if ( signature.isEmpty() ) return signature; // don't add a separator in this case
145 if ( signature.startsWith( TQString::fromLatin1("-- \n") ) )
146 // already have signature separator at start of sig:
147 return TQString::fromLatin1("\n") += signature;
148 else if ( signature.find( TQString::fromLatin1("\n-- \n") ) != -1 )
149 // already have signature separator inside sig; don't prepend '\n'
150 // to improve abusing signatures as templates:
151 return signature;
152 else
153 // need to prepend one:
154 return TQString::fromLatin1("\n-- \n") + signature;
155}
156
157
158void Signature::setUrl( const TQString & url, bool isExecutable )
159{
160 mUrl = url;
161 mType = isExecutable ? FromCommand : FromFile ;
162}
163
164// config keys and values:
165static const char sigTypeKey[] = "Signature Type";
166static const char sigTypeInlineValue[] = "inline";
167static const char sigTypeFileValue[] = "file";
168static const char sigTypeCommandValue[] = "command";
169static const char sigTypeDisabledValue[] = "disabled";
170static const char sigTextKey[] = "Inline Signature";
171static const char sigFileKey[] = "Signature File";
172static const char sigCommandKey[] = "Signature Command";
173
174void Signature::readConfig( const TDEConfigBase * config )
175{
176 TQString sigType = config->readEntry( sigTypeKey );
177 if ( sigType == sigTypeInlineValue ) {
178 mType = Inlined;
179 } else if ( sigType == sigTypeFileValue ) {
180 mType = FromFile;
181 mUrl = config->readPathEntry( sigFileKey );
182 } else if ( sigType == sigTypeCommandValue ) {
183 mType = FromCommand;
184 mUrl = config->readPathEntry( sigCommandKey );
185 } else {
186 mType = Disabled;
187 }
188 mText = config->readEntry( sigTextKey );
189}
190
191void Signature::writeConfig( TDEConfigBase * config ) const
192{
193 switch ( mType ) {
194 case Inlined:
195 config->writeEntry( sigTypeKey, sigTypeInlineValue );
196 break;
197 case FromFile:
198 config->writeEntry( sigTypeKey, sigTypeFileValue );
199 config->writePathEntry( sigFileKey, mUrl );
200 break;
201 case FromCommand:
202 config->writeEntry( sigTypeKey, sigTypeCommandValue );
203 config->writePathEntry( sigCommandKey, mUrl );
204 break;
205 case Disabled:
206 config->writeEntry( sigTypeKey, sigTypeDisabledValue );
207 default: ;
208 }
209 config->writeEntry( sigTextKey, mText );
210}
211
212TQDataStream & KPIM::operator<<( TQDataStream & stream, const KPIM::Signature & sig ) {
213 return stream << static_cast<TQ_UINT8>(sig.mType)
214 << sig.mUrl
215 << sig.mText;
216}
217
218TQDataStream & KPIM::operator>>( TQDataStream & stream, KPIM::Signature & sig ) {
219 TQ_UINT8 s;
220 stream >> s
221 >> sig.mUrl
222 >> sig.mText;
223 sig.mType = static_cast<Signature::Type>(s);
224 return stream;
225}
226
227// ### should use a kstaticdeleter?
228static Identity* identityNull = 0;
229const Identity& Identity::null()
230{
231 if ( !identityNull )
232 identityNull = new Identity;
233 return *identityNull;
234}
235
236bool Identity::isNull() const {
237 return mIdentity.isEmpty() && mFullName.isEmpty() && mEmailAddr.isEmpty() &&
238 mEmailAliases.empty() &&
239 mOrganization.isEmpty() && mReplyToAddr.isEmpty() && mBcc.isEmpty() &&
240 mVCardFile.isEmpty() &&
241 mFcc.isEmpty() && mDrafts.isEmpty() && mTemplates.isEmpty() &&
242 mPGPEncryptionKey.isEmpty() && mPGPSigningKey.isEmpty() &&
243 mSMIMEEncryptionKey.isEmpty() && mSMIMESigningKey.isEmpty() &&
244 mTransport.isEmpty() && mDictionary.isEmpty() &&
245 mPreferredCryptoMessageFormat == Kleo::AutoFormat &&
246 mSignature.type() == Signature::Disabled &&
247 mXFace.isEmpty();
248}
249
250bool Identity::operator==( const Identity & other ) const {
251 bool same = mUoid == other.mUoid &&
252 mIdentity == other.mIdentity && mFullName == other.mFullName &&
253 mEmailAddr == other.mEmailAddr && mOrganization == other.mOrganization &&
254 mEmailAliases == other.mEmailAliases &&
255 mReplyToAddr == other.mReplyToAddr && mBcc == other.mBcc &&
256 mVCardFile == other.mVCardFile &&
257 mFcc == other.mFcc &&
258 mPGPEncryptionKey == other.mPGPEncryptionKey &&
259 mPGPSigningKey == other.mPGPSigningKey &&
260 mSMIMEEncryptionKey == other.mSMIMEEncryptionKey &&
261 mSMIMESigningKey == other.mSMIMESigningKey &&
262 mPreferredCryptoMessageFormat == other.mPreferredCryptoMessageFormat &&
263 mDrafts == other.mDrafts && mTemplates == other.mTemplates &&
264 mTransport == other.mTransport &&
265 mDictionary == other.mDictionary && mSignature == other.mSignature &&
266 mXFace == other.mXFace && mXFaceEnabled == other.mXFaceEnabled;
267
268#if 0
269 if ( same )
270 return true;
271 if ( mUoid != other.mUoid ) kdDebug() << "mUoid differs : " << mUoid << " != " << other.mUoid << endl;
272 if ( mIdentity != other.mIdentity ) kdDebug() << "mIdentity differs : " << mIdentity << " != " << other.mIdentity << endl;
273 if ( mFullName != other.mFullName ) kdDebug() << "mFullName differs : " << mFullName << " != " << other.mFullName << endl;
274 if ( mEmailAddr != other.mEmailAddr ) kdDebug() << "mEmailAddr differs : " << mEmailAddr << " != " << other.mEmailAddr << endl;
275 if ( mEmailAliases != other.mEmailAliases ) kdDebug() << "mEmailAliases differs : " << mEmailAliases.join(";") << " != " << other.mEmailAliases.join(";") << endl;
276 if ( mOrganization != other.mOrganization ) kdDebug() << "mOrganization differs : " << mOrganization << " != " << other.mOrganization << endl;
277 if ( mReplyToAddr != other.mReplyToAddr ) kdDebug() << "mReplyToAddr differs : " << mReplyToAddr << " != " << other.mReplyToAddr << endl;
278 if ( mBcc != other.mBcc ) kdDebug() << "mBcc differs : " << mBcc << " != " << other.mBcc << endl;
279 if ( mVCardFile != other.mVCardFile ) kdDebug() << "mVCardFile differs : " << mVCardFile << " != " << other.mVCardFile << endl;
280 if ( mFcc != other.mFcc ) kdDebug() << "mFcc differs : " << mFcc << " != " << other.mFcc << endl;
281 if ( mPGPEncryptionKey != other.mPGPEncryptionKey ) kdDebug() << "mPGPEncryptionKey differs : " << mPGPEncryptionKey << " != " << other.mPGPEncryptionKey << endl;
282 if ( mPGPSigningKey != other.mPGPSigningKey ) kdDebug() << "mPGPSigningKey differs : " << mPGPSigningKey << " != " << other.mPGPSigningKey << endl;
283 if ( mSMIMEEncryptionKey != other.mSMIMEEncryptionKey ) kdDebug() << "mSMIMEEncryptionKey differs : '" << mSMIMEEncryptionKey << "' != '" << other.mSMIMEEncryptionKey << "'" << endl;
284 if ( mSMIMESigningKey != other.mSMIMESigningKey ) kdDebug() << "mSMIMESigningKey differs : " << mSMIMESigningKey << " != " << other.mSMIMESigningKey << endl;
285 if ( mPreferredCryptoMessageFormat != other.mPreferredCryptoMessageFormat ) kdDebug() << "mPreferredCryptoMessageFormat differs : " << mPreferredCryptoMessageFormat << " != " << other.mPreferredCryptoMessageFormat << endl;
286 if ( mDrafts != other.mDrafts ) kdDebug() << "mDrafts differs : " << mDrafts << " != " << other.mDrafts << endl;
287 if ( mTemplates != other.mTemplates ) kdDebug() << "mTemplates differs : " << mTemplates << " != " << other.mTemplates << endl;
288 if ( mTransport != other.mTransport ) kdDebug() << "mTransport differs : " << mTransport << " != " << other.mTransport << endl;
289 if ( mDictionary != other.mDictionary ) kdDebug() << "mDictionary differs : " << mDictionary << " != " << other.mDictionary << endl;
290 if ( ! ( mSignature == other.mSignature ) ) kdDebug() << "mSignature differs" << endl;
291#endif
292 return same;
293}
294
295Identity::Identity( const TQString & id, const TQString & fullName,
296 const TQString & emailAddr, const TQString & organization,
297 const TQString & replyToAddr )
298 : mUoid( 0 ), mIdentity( id ), mFullName( fullName ),
299 mEmailAddr( emailAddr ), mOrganization( organization ),
300 mReplyToAddr( replyToAddr ),
301 // Using "" instead of null to make operator==() not fail
302 // (readConfig returns "")
303 mBcc( "" ), mVCardFile( "" ), mPGPEncryptionKey( "" ), mPGPSigningKey( "" ),
304 mSMIMEEncryptionKey( "" ), mSMIMESigningKey( "" ), mFcc( "" ),
305 mDrafts( "" ), mTemplates( "" ), mTransport( "" ),
306 mDictionary( "" ),
307 mXFace( "" ), mXFaceEnabled( false ),
308 mIsDefault( false ),
309 mPreferredCryptoMessageFormat( Kleo::AutoFormat )
310{
311}
312
314{
315}
316
317
318void Identity::readConfig( const TDEConfigBase * config )
319{
320 mUoid = config->readUnsignedNumEntry("uoid",0);
321
322 mIdentity = config->readEntry("Identity");
323 mFullName = config->readEntry("Name");
324 mEmailAddr = config->readEntry("Email Address");
325 mEmailAliases = config->readListEntry("Email Aliases");
326 mVCardFile = config->readPathEntry("VCardFile");
327 mOrganization = config->readEntry("Organization");
328 mPGPSigningKey = config->readEntry("PGP Signing Key").latin1();
329 mPGPEncryptionKey = config->readEntry("PGP Encryption Key").latin1();
330 mSMIMESigningKey = config->readEntry("SMIME Signing Key").latin1();
331 mSMIMEEncryptionKey = config->readEntry("SMIME Encryption Key").latin1();
332 mPreferredCryptoMessageFormat = Kleo::stringToCryptoMessageFormat( config->readEntry("Preferred Crypto Message Format", "none" ) );
333 mReplyToAddr = config->readEntry( "Reply-To Address" );
334 mBcc = config->readEntry( "Bcc" );
335 mFcc = config->readEntry( "Fcc", "sent-mail" );
336 if( mFcc.isEmpty() )
337 mFcc = "sent-mail";
338 mDrafts = config->readEntry( "Drafts", "drafts" );
339 if( mDrafts.isEmpty() )
340 mDrafts = "drafts";
341 mTemplates = config->readEntry( "Templates", "templates" );
342 if( mTemplates.isEmpty() )
343 mTemplates = "templates";
344 mTransport = config->readEntry( "Transport" );
345 mDictionary = config->readEntry( "Dictionary" );
346 mXFace = config->readEntry( "X-Face" );
347 mXFaceEnabled = config->readBoolEntry( "X-FaceEnabled", false );
348
349 mSignature.readConfig( config );
350 kdDebug(5006) << "Identity::readConfig(): UOID = " << mUoid
351 << " for identity named \"" << mIdentity << "\"" << endl;
352}
353
354
355void Identity::writeConfig( TDEConfigBase * config ) const
356{
357 config->writeEntry("uoid", mUoid);
358
359 config->writeEntry("Identity", mIdentity);
360 config->writeEntry("Name", mFullName);
361 config->writeEntry("Organization", mOrganization);
362 config->writeEntry("PGP Signing Key", mPGPSigningKey.data());
363 config->writeEntry("PGP Encryption Key", mPGPEncryptionKey.data());
364 config->writeEntry("SMIME Signing Key", mSMIMESigningKey.data());
365 config->writeEntry("SMIME Encryption Key", mSMIMEEncryptionKey.data());
366 config->writeEntry("Preferred Crypto Message Format", Kleo::cryptoMessageFormatToString( mPreferredCryptoMessageFormat ) );
367 config->writeEntry("Email Address", mEmailAddr);
368 config->writeEntry("Email Aliases", mEmailAliases);
369 config->writeEntry("Reply-To Address", mReplyToAddr);
370 config->writeEntry("Bcc", mBcc);
371 config->writePathEntry("VCardFile", mVCardFile);
372 config->writeEntry("Transport", mTransport);
373 config->writeEntry("Fcc", mFcc);
374 config->writeEntry("Drafts", mDrafts);
375 config->writeEntry("Templates", mTemplates);
376 config->writeEntry( "Dictionary", mDictionary );
377 config->writeEntry( "X-Face", mXFace );
378 config->writeEntry( "X-FaceEnabled", mXFaceEnabled );
379
380 mSignature.writeConfig( config );
381}
382
383TQDataStream & KPIM::operator<<( TQDataStream & stream, const KPIM::Identity & i ) {
384 return stream << static_cast<TQ_UINT32>(i.uoid())
385 << i.identityName()
386 << i.fullName()
387 << i.organization()
388 << i.pgpSigningKey()
389 << i.pgpEncryptionKey()
390 << i.smimeSigningKey()
391 << i.smimeEncryptionKey()
393 << i.emailAliases()
394 << i.replyToAddr()
395 << i.bcc()
396 << i.vCardFile()
397 << i.transport()
398 << i.fcc()
399 << i.drafts()
400 << i.templates()
401 << i.mSignature
402 << i.dictionary()
403 << i.xface()
404 << TQString( Kleo::cryptoMessageFormatToString( i.mPreferredCryptoMessageFormat ) );
405}
406
407TQDataStream & KPIM::operator>>( TQDataStream & stream, KPIM::Identity & i ) {
408 TQ_UINT32 uoid;
409 TQString format;
410 stream >> uoid
411 >> i.mIdentity
412 >> i.mFullName
413 >> i.mOrganization
414 >> i.mPGPSigningKey
415 >> i.mPGPEncryptionKey
416 >> i.mSMIMESigningKey
417 >> i.mSMIMEEncryptionKey
418 >> i.mEmailAddr
419 >> i.mEmailAliases
420 >> i.mReplyToAddr
421 >> i.mBcc
422 >> i.mVCardFile
423 >> i.mTransport
424 >> i.mFcc
425 >> i.mDrafts
426 >> i.mTemplates
427 >> i.mSignature
428 >> i.mDictionary
429 >> i.mXFace
430 >> format;
431 i.mUoid = uoid;
432 i.mPreferredCryptoMessageFormat = Kleo::stringToCryptoMessageFormat( format.latin1() );
433
434 return stream;
435}
436
437//-----------------------------------------------------------------------------
439{
440 return !mEmailAddr.isEmpty();
441}
442
443
444void Identity::setIsDefault( bool flag ) {
445 mIsDefault = flag;
446}
447
448void Identity::setIdentityName( const TQString & name ) {
449 mIdentity = name;
450}
451
452void Identity::setFullName(const TQString &str)
453{
454 mFullName = str;
455}
456
457
458//-----------------------------------------------------------------------------
459void Identity::setOrganization(const TQString &str)
460{
461 mOrganization = str;
462}
463
464void Identity::setPGPSigningKey(const TQCString &str)
465{
466 mPGPSigningKey = str;
467 if ( mPGPSigningKey.isNull() )
468 mPGPSigningKey = "";
469}
470
471void Identity::setPGPEncryptionKey(const TQCString &str)
472{
473 mPGPEncryptionKey = str;
474 if ( mPGPEncryptionKey.isNull() )
475 mPGPEncryptionKey = "";
476}
477
478void Identity::setSMIMESigningKey(const TQCString &str)
479{
480 mSMIMESigningKey = str;
481 if ( mSMIMESigningKey.isNull() )
482 mSMIMESigningKey = "";
483}
484
485void Identity::setSMIMEEncryptionKey(const TQCString &str)
486{
487 mSMIMEEncryptionKey = str;
488 if ( mSMIMEEncryptionKey.isNull() )
489 mSMIMEEncryptionKey = "";
490}
491
492//-----------------------------------------------------------------------------
493void Identity::setPrimaryEmailAddress( const TQString & str )
494{
495 mEmailAddr = str;
496}
497
498void Identity::setEmailAliases( const TQStringList & list )
499{
500 mEmailAliases = list;
501}
502
503bool Identity::matchesEmailAddress( const TQString & addr ) const
504{
505 const TQString lower = addr.lower();
506 if ( lower == mEmailAddr.lower() )
507 return true;
508 for ( TQStringList::const_iterator it = mEmailAliases.begin(), end = mEmailAliases.end() ; it != end ; ++it )
509 if ( (*it).lower() == lower )
510 return true;
511 return false;
512}
513
514//-----------------------------------------------------------------------------
515void Identity::setVCardFile(const TQString &str)
516{
517 mVCardFile = str;
518}
519
520
521//-----------------------------------------------------------------------------
522TQString Identity::fullEmailAddr(void) const
523{
524 if (mFullName.isEmpty()) return mEmailAddr;
525
526 const TQString specials("()<>@,.;:[]");
527
528 TQString result;
529
530 // add DQUOTE's if necessary:
531 bool needsQuotes=false;
532 for (unsigned int i=0; i < mFullName.length(); i++) {
533 if ( specials.contains( mFullName[i] ) )
534 needsQuotes = true;
535 else if ( mFullName[i] == '\\' || mFullName[i] == '"' ) {
536 needsQuotes = true;
537 result += '\\';
538 }
539 result += mFullName[i];
540 }
541
542 if (needsQuotes) {
543 result.insert(0,'"');
544 result += '"';
545 }
546
547 result += " <" + mEmailAddr + '>';
548
549 return result;
550}
551
552//-----------------------------------------------------------------------------
553void Identity::setReplyToAddr(const TQString& str)
554{
555 mReplyToAddr = str;
556}
557
558
559//-----------------------------------------------------------------------------
560void Identity::setSignatureFile(const TQString &str)
561{
562 mSignature.setUrl( str, signatureIsCommand() );
563}
564
565
566//-----------------------------------------------------------------------------
567void Identity::setSignatureInlineText(const TQString &str )
568{
569 mSignature.setText( str );
570}
571
572
573//-----------------------------------------------------------------------------
574void Identity::setTransport( const TQString &str )
575{
576 mTransport = str;
577 if ( mTransport.isNull() )
578 mTransport = "";
579}
580
581//-----------------------------------------------------------------------------
582void Identity::setFcc( const TQString &str )
583{
584 mFcc = str;
585 if ( mFcc.isNull() )
586 mFcc = "";
587}
588
589//-----------------------------------------------------------------------------
590void Identity::setDrafts( const TQString &str )
591{
592 mDrafts = str;
593 if ( mDrafts.isNull() )
594 mDrafts = "";
595}
596
597//-----------------------------------------------------------------------------
598void Identity::setTemplates( const TQString &str )
599{
600 mTemplates = str;
601 if ( mTemplates.isNull() )
602 mTemplates = "";
603}
604
605//-----------------------------------------------------------------------------
606void Identity::setDictionary( const TQString &str )
607{
608 mDictionary = str;
609 if ( mDictionary.isNull() )
610 mDictionary = "";
611}
612
613
614//-----------------------------------------------------------------------------
615void Identity::setXFace( const TQString &str )
616{
617 mXFace = str;
618 mXFace.remove( " " );
619 mXFace.remove( "\n" );
620 mXFace.remove( "\r" );
621}
622
623
624//-----------------------------------------------------------------------------
625void Identity::setXFaceEnabled( const bool on )
626{
627 mXFaceEnabled = on;
628}
629
630
631//-----------------------------------------------------------------------------
632TQString Identity::signatureText( bool * ok ) const
633{
634 bool internalOK = false;
635 TQString signatureText = mSignature.withSeparator( &internalOK );
636 if ( internalOK ) {
637 if ( ok ) *ok=true;
638 return signatureText;
639 }
640
641 // OK, here comes the funny part. The call to
642 // Signature::withSeparator() failed, so we should probably fix the
643 // cause:
644 if ( ok ) *ok = false;
645 return TQString();
646
647#if 0 // ### FIXME: error handling
648 if (mSignatureFile.endsWith("|"))
649 {
650 }
651 else
652 {
653 }
654#endif
655
656 return TQString();
657}
User identity information.
Definition: identity.h:96
TQString signatureText(bool *ok=0) const
Returns the signature.
Definition: identity.cpp:632
bool signatureIsCommand() const
Definition: identity.h:251
TQString xface() const
a X-Face header for this identity
Definition: identity.h:301
void writeConfig(TDEConfigBase *) const
Write configuration to config.
Definition: identity.cpp:355
uint uoid() const
Unique Object Identifier for this identity.
Definition: identity.h:164
TQString organization() const
The user's organization (optional)
Definition: identity.h:186
bool operator==(const Identity &other) const
used for comparison
Definition: identity.cpp:250
TQCString smimeEncryptionKey() const
The user's S/MIME encryption key.
Definition: identity.h:204
const TQStringList & emailAliases() const
email address aliases
Definition: identity.h:224
bool mailingAllowed() const
Tests if there are enough values set to allow mailing.
Definition: identity.cpp:438
TQCString smimeSigningKey() const
The user's S/MIME signing key.
Definition: identity.h:208
void setIsDefault(bool flag)
Set whether this identity is the default identity.
Definition: identity.cpp:444
void readConfig(const TDEConfigBase *)
Read configuration from config.
Definition: identity.cpp:318
TQString identityName() const
Identity/nickname for this collection.
Definition: identity.h:157
TQString fcc() const
The folder where sent messages from this identity will be stored by default.
Definition: identity.h:283
Identity(const TQString &id=TQString(), const TQString &realName=TQString(), const TQString &emailAddr=TQString(), const TQString &organization=TQString(), const TQString &replyToAddress=TQString())
Constructor.
Definition: identity.cpp:295
TQString fullEmailAddr() const
email address in the format "username <name@host>" suitable for the "From:" field of email messages.
Definition: identity.cpp:522
TQString bcc() const
email addresses for the BCC: field
Definition: identity.h:242
TQString fullName() const
Full name of the user.
Definition: identity.h:182
TQString dictionary() const
dictionary which should be used for spell checking
Definition: identity.h:297
TQString primaryEmailAddress() const
primary email address (without the user name - only name@host).
Definition: identity.h:220
TQString transport() const
The transport that is set for this identity.
Definition: identity.h:278
TQString replyToAddr() const
email address for the ReplyTo: field
Definition: identity.h:238
TQCString pgpEncryptionKey() const
The user's OpenPGP encryption key.
Definition: identity.h:196
~Identity()
Destructor.
Definition: identity.cpp:313
TQString drafts() const
The folder where draft messages from this identity will be stored by default.
Definition: identity.h:288
TQString templates() const
The folder where template messages from this identity will be stored by default.
Definition: identity.h:293
TQString vCardFile() const
vCard to attach to outgoing emails
Definition: identity.h:230
TQCString pgpSigningKey() const
The user's OpenPGP signing key.
Definition: identity.h:200
abstraction of a signature (aka "footer").
Definition: identity.h:39
bool operator==(const Signature &other) const
Used for comparison.
Definition: identity.cpp:49
void setUrl(const TQString &url, bool isExecutable=false)
Set the signature URL and mark this signature as being of "from file" resp.
Definition: identity.cpp:158
Type
Type of signature (ie.
Definition: identity.h:47
Type type() const
Definition: identity.h:77
void setText(const TQString &text)
Set the signature text and mark this signature as being of "inline text" type.
Definition: identity.h:68
Signature()
Constructor for disabled signature.
Definition: identity.cpp:30
TQString withSeparator(bool *ok=0) const
Definition: identity.cpp:135
TQString rawText(bool *ok=0) const
Definition: identity.cpp:60