• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
ldifconverter.cpp
1 /*
2  This file is part of libtdeabc.
3  Copyright (c) 2003 Helge Deller <deller@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 
22 /*
23  Useful links:
24  - http://tldp.org/HOWTO/LDAP-Implementation-HOWTO/schemas.html
25  - http://www.faqs.org/rfcs/rfc2849.html
26 
27  Not yet handled items:
28  - objectclass microsoftaddressbook
29  - info,
30  - initials,
31  - otherfacsimiletelephonenumber,
32  - otherpager,
33  - physicaldeliveryofficename,
34 */
35 
36 #include <tqstring.h>
37 #include <tqstringlist.h>
38 #include <tqregexp.h>
39 #include <tqtextstream.h>
40 
41 #include <tdelocale.h>
42 #include <kdebug.h>
43 #include <kmdcodec.h>
44 
45 #include "addressee.h"
46 #include "address.h"
47 
48 #include "ldif.h"
49 #include "ldifconverter.h"
50 #include "vcardconverter.h"
51 
52 using namespace TDEABC;
53 
54 /* generate LDIF stream */
55 
56 bool LDIFConverter::addresseeToLDIF( const AddresseeList &addrList, TQString &str )
57 {
58  AddresseeList::ConstIterator it;
59  for ( it = addrList.begin(); it != addrList.end(); ++it ) {
60  addresseeToLDIF( *it, str );
61  }
62  return true;
63 }
64 
65 
66 
67 static void ldif_out( TQTextStream &t, TQString formatStr, TQString value )
68 {
69  if ( value.isEmpty() )
70  return;
71 
72  TQCString txt = LDIF::assembleLine( formatStr, value, 72 );
73 
74  // write the string
75  t << TQString::fromUtf8(txt) << "\n";
76 }
77 
78 bool LDIFConverter::addresseeToLDIF( const Addressee &addr, TQString &str )
79 {
80  if ( addr.isEmpty() )
81  return false;
82 
83  TQTextStream t( str, IO_WriteOnly|IO_Append );
84  t.setEncoding( TQTextStream::UnicodeUTF8 );
85 
86  const Address homeAddr = addr.address( Address::Home );
87  const Address workAddr = addr.address( Address::Work );
88 
89  ldif_out( t, "dn", TQString( "cn=%1,mail=%2" )
90  .arg( TQString(addr.formattedName()).simplifyWhiteSpace() )
91  .arg( addr.preferredEmail() ) );
92  ldif_out( t, "givenname", addr.givenName() );
93  ldif_out( t, "sn", addr.familyName() );
94  ldif_out( t, "cn", TQString(addr.formattedName()).simplifyWhiteSpace() );
95  ldif_out( t, "uid", addr.uid() );
96  ldif_out( t, "nickname", addr.nickName() );
97  ldif_out( t, "xmozillanickname", addr.nickName() );
98 
99  ldif_out( t, "mail", addr.preferredEmail() );
100  if ( addr.emails().count() > 1 )
101  ldif_out( t, "mozillasecondemail", addr.emails()[ 1 ] );
102 //ldif_out( t, "mozilla_AIMScreenName: %1\n", "screen_name" );
103 
104  ldif_out( t, "telephonenumber", addr.phoneNumber( PhoneNumber::Work ).number() );
105  ldif_out( t, "facsimiletelephonenumber", addr.phoneNumber( PhoneNumber::Fax ).number() );
106  ldif_out( t, "homephone", addr.phoneNumber( PhoneNumber::Home ).number() );
107  ldif_out( t, "mobile", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 7
108  ldif_out( t, "cellphone", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 4.x
109  ldif_out( t, "pager", addr.phoneNumber( PhoneNumber::Pager ).number() );
110  ldif_out( t, "pagerphone", addr.phoneNumber( PhoneNumber::Pager ).number() );
111 
112  ldif_out( t, "streethomeaddress", homeAddr.street() );
113  ldif_out( t, "postalcode", workAddr.postalCode() );
114  ldif_out( t, "postofficebox", workAddr.postOfficeBox() );
115 
116  TQStringList streets = TQStringList::split( '\n', homeAddr.street() );
117  if ( streets.count() > 0 )
118  ldif_out( t, "homepostaladdress", streets[ 0 ] ); // Netscape 7
119  if ( streets.count() > 1 )
120  ldif_out( t, "mozillahomepostaladdress2", streets[ 1 ] ); // Netscape 7
121  ldif_out( t, "mozillahomelocalityname", homeAddr.locality() ); // Netscape 7
122  ldif_out( t, "mozillahomestate", homeAddr.region() );
123  ldif_out( t, "mozillahomepostalcode", homeAddr.postalCode() );
124  ldif_out( t, "mozillahomecountryname", Address::ISOtoCountry(homeAddr.country()) );
125  ldif_out( t, "locality", workAddr.locality() );
126  ldif_out( t, "streetaddress", workAddr.street() ); // Netscape 4.x
127 
128  streets = TQStringList::split( '\n', workAddr.street() );
129  if ( streets.count() > 0 )
130  ldif_out( t, "postaladdress", streets[ 0 ] );
131  if ( streets.count() > 1 )
132  ldif_out( t, "mozillapostaladdress2", streets[ 1 ] );
133  ldif_out( t, "countryname", Address::ISOtoCountry(workAddr.country()) );
134  ldif_out( t, "l", workAddr.locality() );
135  ldif_out( t, "c", Address::ISOtoCountry(workAddr.country()) );
136  ldif_out( t, "st", workAddr.region() );
137 
138  ldif_out( t, "title", addr.title() );
139  ldif_out( t, "vocation", addr.prefix() );
140  ldif_out( t, "ou", addr.role() );
141  ldif_out( t, "o", addr.organization() );
142  ldif_out( t, "organization", addr.organization() );
143  ldif_out( t, "organizationname", addr.organization() );
144 
145  // Compatibility with older tdeabc versions.
146  if ( !addr.department().isEmpty() )
147  ldif_out( t, "department", addr.department() );
148  else
149  ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") );
150 
151  ldif_out( t, "workurl", addr.url().prettyURL() );
152  ldif_out( t, "homeurl", addr.url().prettyURL() );
153  ldif_out( t, "description", addr.note() );
154  if (addr.revision().isValid())
155  ldif_out(t, "modifytimestamp", dateToVCardString( TQT_TQDATETIME_OBJECT(addr.revision())) );
156 
157  t << "objectclass: top\n";
158  t << "objectclass: person\n";
159  t << "objectclass: organizationalPerson\n";
160 
161  t << "\n";
162 
163  return true;
164 }
165 
166 
167 /* convert from LDIF stream */
168 
169 bool LDIFConverter::LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt )
170 {
171  if (str.isEmpty())
172  return true;
173 
174  bool endldif = false, end = false;
175  LDIF ldif;
176  LDIF::ParseVal ret;
177  const char *latinstr = str.latin1();
178  int latinstrlen = tqstrlen( latinstr );
179  TQByteArray data;
180  Addressee a;
181  Address homeAddr, workAddr;
182 
183  data.setRawData( latinstr, latinstrlen );
184  ldif.setLDIF( data );
185  if (!dt.isValid())
186  dt = TQDateTime::currentDateTime();
187  a.setRevision(dt);
188  homeAddr = Address( Address::Home );
189  workAddr = Address( Address::Work );
190 
191  do {
192  ret = ldif.nextItem();
193  switch ( ret ) {
194  case LDIF::Item: {
195  TQString fieldname = ldif.attr().lower();
196  TQString value = TQString::fromUtf8( ldif.val(), ldif.val().size() );
197  evaluatePair( a, homeAddr, workAddr, fieldname, value );
198  break;
199  }
200  case LDIF::EndEntry:
201  // if the new address is not empty, append it
202  if ( !a.formattedName().isEmpty() || !a.name().isEmpty() ||
203  !a.familyName().isEmpty() ) {
204  if ( !homeAddr.isEmpty() )
205  a.insertAddress( homeAddr );
206  if ( !workAddr.isEmpty() )
207  a.insertAddress( workAddr );
208  addrList.append( a );
209  }
210  a = Addressee();
211  a.setRevision(dt);
212  homeAddr = Address( Address::Home );
213  workAddr = Address( Address::Work );
214  break;
215  case LDIF::MoreData: {
216  if ( endldif )
217  end = true;
218  else {
219  ldif.endLDIF();
220  endldif = true;
221  break;
222  }
223  }
224  default:
225  break;
226  }
227  } while ( !end );
228 
229  data.resetRawData( latinstr, latinstrlen );
230 
231  return true;
232 }
233 
234 bool LDIFConverter::evaluatePair( Addressee &a, Address &homeAddr,
235  Address &workAddr,
236  TQString &fieldname, TQString &value )
237 {
238  if ( fieldname == TQString::fromLatin1( "dn" ) ) // ignore & return false!
239  return false;
240 
241  if ( fieldname.startsWith("#") ) {
242  return true;
243  }
244 
245  if ( fieldname.isEmpty() && !a.note().isEmpty() ) {
246  // some LDIF export filters are borken and add additional
247  // comments on stand-alone lines. Just add them to the notes for now.
248  a.setNote( a.note() + "\n" + value );
249  return true;
250  }
251 
252  if ( fieldname == TQString::fromLatin1( "givenname" ) ) {
253  a.setGivenName( value );
254  return true;
255  }
256 
257  if ( fieldname == TQString::fromLatin1( "xmozillanickname") ||
258  fieldname == TQString::fromLatin1( "nickname") ) {
259  a.setNickName( value );
260  return true;
261  }
262 
263  if ( fieldname == TQString::fromLatin1( "sn" ) ) {
264  a.setFamilyName( value );
265  return true;
266  }
267 
268  if ( fieldname == TQString::fromLatin1( "uid" ) ) {
269  a.setUid( value );
270  return true;
271  }
272  if ( fieldname == TQString::fromLatin1( "mail" ) ||
273  fieldname == TQString::fromLatin1( "mozillasecondemail" ) ) { // mozilla
274  if ( a.emails().findIndex( value ) == -1 )
275  a.insertEmail( value );
276  return true;
277  }
278 
279  if ( fieldname == TQString::fromLatin1( "title" ) ) {
280  a.setTitle( value );
281  return true;
282  }
283 
284  if ( fieldname == TQString::fromLatin1( "vocation" ) ) {
285  a.setPrefix( value );
286  return true;
287  }
288 
289  if ( fieldname == TQString::fromLatin1( "cn" ) ) {
290  a.setFormattedName( value );
291  return true;
292  }
293 
294  if ( fieldname == TQString::fromLatin1( "o" ) ||
295  fieldname == TQString::fromLatin1( "organization" ) || // Exchange
296  fieldname == TQString::fromLatin1( "organizationname" ) ) { // Exchange
297  a.setOrganization( value );
298  return true;
299  }
300 
301  if ( fieldname == TQString::fromLatin1( "description" ) ) {
302 addComment:
303  if ( !a.note().isEmpty() )
304  a.setNote( a.note() + "\n" );
305  a.setNote( a.note() + value );
306  return true;
307  }
308 
309  if ( fieldname == TQString::fromLatin1( "custom1" ) ||
310  fieldname == TQString::fromLatin1( "custom2" ) ||
311  fieldname == TQString::fromLatin1( "custom3" ) ||
312  fieldname == TQString::fromLatin1( "custom4" ) ) {
313  goto addComment;
314  }
315 
316  if ( fieldname == TQString::fromLatin1( "homeurl" ) ||
317  fieldname == TQString::fromLatin1( "workurl" ) ) {
318  if (a.url().isEmpty()) {
319  a.setUrl( KURL( value ) );
320  return true;
321  }
322  if ( a.url().prettyURL() == KURL(value).prettyURL() )
323  return true;
324  // TODO: current version of tdeabc only supports one URL.
325  // TODO: change this with KDE 4
326  }
327 
328  if ( fieldname == TQString::fromLatin1( "homephone" ) ) {
329  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Home ) );
330  return true;
331  }
332 
333  if ( fieldname == TQString::fromLatin1( "telephonenumber" ) ) {
334  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) );
335  return true;
336  }
337 
338  if ( fieldname == TQString::fromLatin1( "mobile" ) ) { // mozilla/Netscape 7
339  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) );
340  return true;
341  }
342 
343  if ( fieldname == TQString::fromLatin1( "cellphone" ) ) {
344  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) );
345  return true;
346  }
347 
348  if ( fieldname == TQString::fromLatin1( "pager" ) || // mozilla
349  fieldname == TQString::fromLatin1( "pagerphone" ) ) { // mozilla
350  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Pager ) );
351  return true;
352  }
353 
354  if ( fieldname == TQString::fromLatin1( "facsimiletelephonenumber" ) ) {
355  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Fax ) );
356  return true;
357  }
358 
359  if ( fieldname == TQString::fromLatin1( "xmozillaanyphone" ) ) { // mozilla
360  a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) );
361  return true;
362  }
363 
364  if ( fieldname == TQString::fromLatin1( "street" ) ||
365  fieldname == TQString::fromLatin1( "streethomeaddress" ) ) {
366  homeAddr.setStreet( value );
367  return true;
368  }
369 
370  if ( fieldname == TQString::fromLatin1( "postaladdress" ) ) { // mozilla
371  workAddr.setStreet( value );
372  return true;
373  }
374 
375  if ( fieldname == TQString::fromLatin1( "mozillapostaladdress2" ) ) { // mozilla
376  workAddr.setStreet( workAddr.street() + TQString::fromLatin1( "\n" ) + value );
377  return true;
378  }
379 
380  if ( fieldname == TQString::fromLatin1( "postalcode" ) ) {
381  workAddr.setPostalCode( value );
382  return true;
383  }
384 
385  if ( fieldname == TQString::fromLatin1( "postofficebox" ) ) {
386  workAddr.setPostOfficeBox( value );
387  return true;
388  }
389 
390  if ( fieldname == TQString::fromLatin1( "homepostaladdress" ) ) { // Netscape 7
391  homeAddr.setStreet( value );
392  return true;
393  }
394 
395  if ( fieldname == TQString::fromLatin1( "mozillahomepostaladdress2" ) ) { // mozilla
396  homeAddr.setStreet( homeAddr.street() + TQString::fromLatin1( "\n" ) + value );
397  return true;
398  }
399 
400  if ( fieldname == TQString::fromLatin1( "mozillahomelocalityname" ) ) { // mozilla
401  homeAddr.setLocality( value );
402  return true;
403  }
404 
405  if ( fieldname == TQString::fromLatin1( "mozillahomestate" ) ) { // mozilla
406  homeAddr.setRegion( value );
407  return true;
408  }
409 
410  if ( fieldname == TQString::fromLatin1( "mozillahomepostalcode" ) ) { // mozilla
411  homeAddr.setPostalCode( value );
412  return true;
413  }
414 
415  if ( fieldname == TQString::fromLatin1( "mozillahomecountryname" ) ) { // mozilla
416  if ( value.length() <= 2 )
417  value = Address::ISOtoCountry(value);
418  homeAddr.setCountry( value );
419  return true;
420  }
421 
422  if ( fieldname == TQString::fromLatin1( "locality" ) ) {
423  workAddr.setLocality( value );
424  return true;
425  }
426 
427  if ( fieldname == TQString::fromLatin1( "streetaddress" ) ) { // Netscape 4.x
428  workAddr.setStreet( value );
429  return true;
430  }
431 
432  if ( fieldname == TQString::fromLatin1( "countryname" ) ||
433  fieldname == TQString::fromLatin1( "c" ) ) { // mozilla
434  if ( value.length() <= 2 )
435  value = Address::ISOtoCountry(value);
436  workAddr.setCountry( value );
437  return true;
438  }
439 
440  if ( fieldname == TQString::fromLatin1( "l" ) ) { // mozilla
441  workAddr.setLocality( value );
442  return true;
443  }
444 
445  if ( fieldname == TQString::fromLatin1( "st" ) ) {
446  workAddr.setRegion( value );
447  return true;
448  }
449 
450  if ( fieldname == TQString::fromLatin1( "ou" ) ) {
451  a.setRole( value );
452  return true;
453  }
454 
455  if ( fieldname == TQString::fromLatin1( "department" ) ) {
456  a.setDepartment( value );
457  return true;
458  }
459 
460  if ( fieldname == TQString::fromLatin1( "member" ) ) {
461  // this is a mozilla list member (cn=xxx, mail=yyy)
462  TQStringList list( TQStringList::split( ',', value ) );
463  TQString name, email;
464 
465  TQStringList::Iterator it;
466  for ( it = list.begin(); it != list.end(); ++it ) {
467  if ( (*it).startsWith( "cn=" ) )
468  name = (*it).mid( 3 ).stripWhiteSpace();
469  if ( (*it).startsWith( "mail=" ) )
470  email = (*it).mid( 5 ).stripWhiteSpace();
471  }
472  if ( !name.isEmpty() && !email.isEmpty() )
473  email = " <" + email + ">";
474  a.insertEmail( name + email );
475  a.insertCategory( i18n( "List of Emails" ) );
476  return true;
477  }
478 
479  if ( fieldname == TQString::fromLatin1( "modifytimestamp" ) ) {
480  if (value == TQString::fromLatin1("0Z")) // ignore
481  return true;
482  TQDateTime dt = VCardStringToDate( value );
483  if ( dt.isValid() ) {
484  a.setRevision(dt);
485  return true;
486  }
487  }
488 
489  if ( fieldname == TQString::fromLatin1( "objectclass" ) ) // ignore
490  return true;
491 
492  kdWarning() << TQString(TQString("LDIFConverter: Unknown field for '%1': '%2=%3'\n")
493  .arg(a.formattedName()).arg(fieldname).arg(value));
494 
495  return true;
496 }
497 
498 /* The following functions are obsoleted. Similar functionality can be found
499  * in the LDIF class */
500 
501 bool LDIFConverter::parseSingleLine( Addressee &a, Address &homeAddr,
502  Address &workAddr, TQString &line )
503 {
504  if ( line.isEmpty() )
505  return true;
506 
507  TQString fieldname, value;
508  TQByteArray val;
509 
510  LDIF::splitLine( line.latin1(), fieldname, val );
511  value = TQString::fromUtf8( val.data(), val.size() );
512  return evaluatePair( a, homeAddr, workAddr, fieldname, value);
513 }
514 
515 
516 bool LDIFConverter::splitLine( TQString &line, TQString &fieldname, TQString &value)
517 {
518  TQByteArray val;
519  bool ret = LDIF::splitLine( line.latin1(), fieldname, val );
520  value = TQString::fromUtf8( val.data(), val.size() );
521  return ret;
522 }
523 
524 
525 TQString LDIFConverter::makeLDIFfieldString( TQString formatStr, TQString value, bool allowEncode )
526 {
527  if ( value.isEmpty() )
528  return TQString();
529 
530  // append format if not given
531  if (formatStr.find(':') == -1)
532  formatStr.append(": %1\n");
533 
534  // check if base64-encoding is needed
535  bool printable = true;
536  unsigned int i, len;
537  len = value.length();
538  for (i = 0; i<len; ++i ) {
539  if (!value[i].isPrint()) {
540  printable = false;
541  break;
542  }
543  }
544 
545  if (printable) // always encode if we find special chars...
546  printable = (value.find('\n') == -1);
547 
548  if (!printable && allowEncode) {
549  // encode to base64
550  value = KCodecs::base64Encode( value.utf8() );
551  int p = formatStr.find(':');
552  if (p>=0)
553  formatStr.insert(p, ':');
554  }
555 
556  // generate the new string and split it to 72 chars/line
557  TQCString txt = TQString(formatStr.arg(value)).utf8();
558 
559  if (allowEncode) {
560  len = txt.length();
561  if (len && txt[len-1] == '\n')
562  --len;
563  i = 72;
564  while (i < len) {
565  txt.insert(i, "\n ");
566  i += 72+1;
567  len += 2;
568  }
569  }
570 
571  return TQString::fromUtf8(txt);
572 }
573 
TDEABC::Address::street
TQString street() const
Returns the street.
Definition: address.cpp:174
KURL
TDEABC::LDIFConverter::LDIFToAddressee
KABC_EXPORT bool LDIFToAddressee(const TQString &str, AddresseeList &addrList, TQDateTime dt=TQDateTime::currentDateTime())
Converts a LDIF string to a list of addressees.
Definition: ldifconverter.cpp:169
TDEABC::Address::setCountry
void setCountry(const TQString &)
Sets the country.
Definition: address.cpp:239
TDEABC::Addressee::emails
TQStringList emails() const
Return list of all email addresses.
Definition: addressee.src.cpp:451
TDEABC::Address::setRegion
void setRegion(const TQString &)
Sets the region, e.g.
Definition: address.cpp:203
TDEABC::Addressee::setUid
void setUid(const TQString &uid)
Set unique identifier.
Definition: addressee.src.cpp:166
TDEABC::Address::isEmpty
bool isEmpty() const
Returns true, if the address is empty.
Definition: address.cpp:68
TDEABC::LDIF::nextItem
ParseVal nextItem()
Process the LDIF until a complete item can be returned.
Definition: ldif.cpp:308
TDEABC::Address::setPostOfficeBox
void setPostOfficeBox(const TQString &)
Sets the post office box.
Definition: address.cpp:131
TDEABC::Address::setStreet
void setStreet(const TQString &)
Sets the street (including number).
Definition: address.cpp:167
TDEABC::Addressee::custom
TQString custom(const TQString &app, const TQString &name) const
Return value of custom entry, identified by app and entry name.
Definition: addressee.src.cpp:827
TDEABC::Addressee::insertEmail
void insertEmail(const TQString &email, bool preferred=false)
Insert an email address.
Definition: addressee.src.cpp:412
TDEABC::VCardStringToDate
KABC_EXPORT TQDateTime VCardStringToDate(const TQString &dateString)
Converts a date string as it is used in VCard and LDIF files to a TQDateTime value.
Definition: vcardconverter.cpp:114
TDEABC::LDIF::setLDIF
void setLDIF(const TQByteArray &ldif)
Sets a chunk of LDIF.
Definition: ldif.h:111
TDEABC::Address::ISOtoCountry
static TQString ISOtoCountry(const TQString &ISOname)
Returns a localized country name for a ISO code.
Definition: address.cpp:547
TDEABC::Addressee::insertAddress
void insertAddress(const Address &address)
Insert an address.
Definition: addressee.src.cpp:675
TDEABC::Address::postOfficeBox
TQString postOfficeBox() const
Returns the post office box.
Definition: address.cpp:138
TDEABC::LDIF::assembleLine
static TQCString assembleLine(const TQString &fieldname, const TQByteArray &value, uint linelen=0, bool url=false)
Assembles fieldname and value into a valid LDIF line, BASE64 encodes the value if neccessary and opti...
Definition: ldif.cpp:37
TDEABC::PhoneNumber::number
TQString number() const
Returns the number.
Definition: phonenumber.cpp:88
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48
TDEABC::Addressee::phoneNumber
PhoneNumber phoneNumber(int type) const
Return phone number, which matches the given type.
Definition: addressee.src.cpp:489
TDEABC::Address
Postal address information.
Definition: address.h:55
TDEABC::Address::locality
TQString locality() const
Returns the locality.
Definition: address.cpp:192
TDEABC::AddresseeList
a TQValueList of Addressee, with sorting functionality
Definition: addresseelist.h:112
tdelocale.h
kdWarning
kdbgstream kdWarning(int area=0)
TDEABC::LDIF::endLDIF
void endLDIF()
Indicates the end of the LDIF file/stream.
Definition: ldif.cpp:344
TDEABC::Addressee::uid
TQString uid() const
Return unique identifier.
Definition: addressee.src.cpp:174
TDEABC::Address::postalCode
TQString postalCode() const
Returns the postal code.
Definition: address.cpp:228
TDEABC::dateToVCardString
KABC_EXPORT TQString dateToVCardString(const TQDateTime &dateTime)
Helper functions.
Definition: vcardconverter.cpp:104
TDEABC::LDIF
LDIF.
Definition: ldif.h:40
TDEABC::Address::region
TQString region() const
Returns the region.
Definition: address.cpp:210
TDEABC::Address::setPostalCode
void setPostalCode(const TQString &)
Sets the postal code.
Definition: address.cpp:221
TDEABC::Addressee::isEmpty
bool isEmpty() const
Return, if the address book entry is empty.
Definition: addressee.src.cpp:161
TDEABC::PhoneNumber
Phonenumber information.
Definition: phonenumber.h:38
TDEABC::Addressee
address book entry
Definition: addressee.src.h:74
TDEABC::Addressee::insertCategory
void insertCategory(const TQString &)
Insert category.
Definition: addressee.src.cpp:753
TDEABC::Addressee::address
Address address(int type) const
Return address, which matches the given type.
Definition: addressee.src.cpp:707
TDEABC::LDIF::splitLine
static bool splitLine(const TQCString &line, TQString &fieldname, TQByteArray &value)
Splits one line from an LDIF file to attribute and value components.
Definition: ldif.cpp:106
KCodecs::base64Encode
static TQCString base64Encode(const TQByteArray &in, bool insertLFs=false)
TDEABC::LDIFConverter::splitLine
KABC_EXPORT bool splitLine(TQString &line, TQString &fieldname, TQString &value)
No need for this function anymore - use LDIF::splitLine()
Definition: ldifconverter.cpp:516
TDEABC::Addressee::preferredEmail
TQString preferredEmail() const
Return preferred email address.
Definition: addressee.src.cpp:445
TDEABC::LDIFConverter::parseSingleLine
KABC_EXPORT bool parseSingleLine(Addressee &a, Address &homeAddr, Address &workAddr, TQString &line)
No need for this function anymore - use LDIF::splitLine() + evaluatePair()
Definition: ldifconverter.cpp:501
TDEABC::LDIF::attr
const TQString & attr() const
Returns the attribute name.
Definition: ldif.h:144
TDEABC::LDIF::val
const TQByteArray & val() const
Returns the attribute value.
Definition: ldif.h:148
TDEABC::LDIFConverter::addresseeToLDIF
KABC_EXPORT bool addresseeToLDIF(const AddresseeList &addrList, TQString &str)
Converts a list of addressees to a LDIF string.
Definition: ldifconverter.cpp:56
TDEStdAccel::name
TQString name(StdAccel id)
TDEABC::Address::country
TQString country() const
Returns the country.
Definition: address.cpp:246
TDEABC::LDIFConverter::makeLDIFfieldString
KABC_EXPORT TQString makeLDIFfieldString(TQString field, TQString value, bool allowEncode=true) KDE_DEPRECATED
Definition: ldifconverter.cpp:525
TDEABC::Addressee::insertPhoneNumber
void insertPhoneNumber(const PhoneNumber &phoneNumber)
Insert a phone number.
Definition: addressee.src.cpp:460
TDEABC::Address::setLocality
void setLocality(const TQString &)
Sets the locality, e.g.
Definition: address.cpp:185
KURL::prettyURL
TQString prettyURL(int _trailing=0) const

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.8.8
This website is maintained by Timothy Pearson.