kmaddrbook.cpp
00001
00002
00003
00004
00005
00006 #include <config.h>
00007 #include <unistd.h>
00008
00009 #include "kmaddrbook.h"
00010 #include "kcursorsaver.h"
00011 #include "kmmessage.h"
00012 #include "kmkernel.h"
00013
00014 #include <kapplication.h>
00015 #include <kdebug.h>
00016 #include <klocale.h>
00017 #include <kmessagebox.h>
00018 #include <kabc/stdaddressbook.h>
00019 #include <kabc/distributionlist.h>
00020 #include <kabc/vcardconverter.h>
00021 #include <dcopref.h>
00022
00023 #include <qregexp.h>
00024
00025
00026 QString KabcBridge::expandNickName( const QString& nickName )
00027 {
00028 if ( nickName.isEmpty() )
00029 return QString::null;
00030
00031 const QString lowerNickName = nickName.lower();
00032 const KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
00033 for( KABC::AddressBook::ConstIterator it = addressBook->begin();
00034 it != addressBook->end(); ++it ) {
00035 if ( (*it).nickName().lower() == lowerNickName )
00036 return (*it).fullEmail();
00037 }
00038 return QString::null;
00039 }
00040
00041
00042
00043
00044 QStringList KabcBridge::categories()
00045 {
00046 KABC::AddressBook *addressBook = KABC::StdAddressBook::self();
00047 KABC::Addressee::List addresses = addressBook->allAddressees();
00048 QStringList allcategories, aux;
00049
00050 for ( KABC::Addressee::List::Iterator it = addresses.begin();
00051 it != addresses.end(); ++it ) {
00052 aux = ( *it ).categories();
00053 for ( QStringList::ConstIterator itAux = aux.begin();
00054 itAux != aux.end(); ++itAux ) {
00055
00056 if ( allcategories.find( *itAux ) == allcategories.end() )
00057 allcategories += *itAux;
00058 }
00059 }
00060 return allcategories;
00061 }
This file is part of the documentation for kmail Library Version 3.3.2.