testkabcdlg.cpp
00001 #include <qwidget.h>
00002
00003 #include <kaboutdata.h>
00004 #include <kapplication.h>
00005 #include <kdebug.h>
00006 #include <klocale.h>
00007 #include <kcmdlineargs.h>
00008
00009 #include "addresseedialog.h"
00010
00011 using namespace KABC;
00012
00013 static const KCmdLineOptions options[] =
00014 {
00015 {"multiple", I18N_NOOP("Allow selection of multiple addressees."), 0},
00016 {0,0,0}
00017 };
00018
00019 int main(int argc,char **argv)
00020 {
00021 KAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1");
00022 KCmdLineArgs::init(argc,argv,&aboutData);
00023 KCmdLineArgs::addCmdLineOptions( options );
00024
00025 KApplication app;
00026
00027 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00028 if (args->isSet("multiple")) {
00029 Addressee::List al = AddresseeDialog::getAddressees( 0 );
00030 Addressee::List::ConstIterator it;
00031 kdDebug() << "Selected Addressees:" << endl;
00032 for( it = al.begin(); it != al.end(); ++it ) {
00033 kdDebug() << " " << (*it).fullEmail() << endl;
00034 }
00035 } else {
00036 Addressee a = AddresseeDialog::getAddressee( 0 );
00037
00038 if ( !a.isEmpty() ) {
00039 kdDebug() << "Selected Addressee:" << endl;
00040 a.dump();
00041 } else {
00042 kdDebug() << "No Addressee selected." << endl;
00043 }
00044 }
00045 }
This file is part of the documentation for kdelibs Version 3.1.0.