00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#include <qfile.h>
00026
00027
#include <kdebug.h>
00028
#include <kfiledialog.h>
00029
#include <kio/netaccess.h>
00030
#include <klocale.h>
00031
#include <kmessagebox.h>
00032
#include <kprocess.h>
00033
#include <kstandarddirs.h>
00034
#include <ktempfile.h>
00035
#include <kurl.h>
00036
00037
#include "xxportmanager.h"
00038
00039
#include "pab_xxport.h"
00040
00041
class PABXXPortFactory :
public KAB::XXPortFactory
00042 {
00043
public:
00044 KAB::XXPort *xxportObject( KABC::AddressBook *ab,
QWidget *parent,
const char *name )
00045 {
00046
return new PABXXPort( ab, parent, name );
00047 }
00048 };
00049
00050
extern "C"
00051 {
00052
void *init_libkaddrbk_pab_xxport()
00053 {
00054
return (
new PABXXPortFactory() );
00055 }
00056 }
00057
00058
00059 PABXXPort::PABXXPort( KABC::AddressBook *ab,
QWidget *parent,
const char *name )
00060 : KAB::XXPort( ab, parent, name )
00061 {
00062 createImportAction( i18n(
"Import MS Exchange Personal Address Book (.PAB)") );
00063 }
00064
00065 KABC::AddresseeList PABXXPort::importContacts(
const QString& )
const
00066
{
00067 KABC::AddresseeList addrList;
00068
00069
QString fileName = KFileDialog::getOpenFileName( QDir::homeDirPath(),
00070
"*.[pP][aA][bB]|" + i18n(
"MS Exchange Personal Address Book Files (*.pab)"), 0 );
00071
if ( fileName.isEmpty() )
00072
return addrList;
00073
if ( !QFile::exists( fileName ) ) {
00074 KMessageBox::sorry( parentWidget(), i18n(
"<qt>Could not find a MS Exchange Personal Address Book <b>%1</b>.</qt>" ).arg( fileName ) );
00075
return addrList;
00076 }
00077
00078
00079
00080
00081
00082
return addrList;
00083 }
00084
00085
#include "pab_xxport.moc"
00086
00087