kabc
21 #include <QtCore/QFile>
23 #include <kaboutdata.h>
24 #include <klocalizedstring.h>
26 #include <kapplication.h>
27 #include <kcmdlineargs.h>
29 #include "kabc/addressee.h"
30 #include "kabc/phonenumber.h"
31 #include "kabc/address.h"
33 #include "kabc/picture.h"
34 #include "kabc/sound.h"
35 #include "kabc/secrecy.h"
36 #include "kabc/vcardconverter.h"
38 int main(
int argc,
char **argv )
40 KAboutData aboutData(
"testwrite", 0, ki18n(
"vCard test writer" ),
"0.1" );
42 KCmdLineArgs::init( argc, argv, &aboutData );
44 KApplication app(
false );
50 addressee.
setBirthday( QDateTime( QDate( 1982, 7, 19 ) ) );
51 addressee.
setMailer( QLatin1String(
"mutt1.2" ) );
59 addressee.
setTitle( QLatin1String(
"nerd" ) );
60 addressee.
setRole( QLatin1String(
"Maintainer" ) );
62 addressee.
setNote( QLatin1String(
"nerver\ntouch a running system" ) );
64 addressee.
setRevision( QDateTime::currentDateTime() );
66 addressee.
setUrl( KUrl( QLatin1String(
"http://wgess16.dyndns.org" ) ) );
67 addressee.
setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) );
69 addressee.
insertEmail( QLatin1String(
"tokoe@kde.org" ),
true );
70 addressee.
insertEmail( QLatin1String(
"tokoe82@yahoo.de" ),
true );
82 QStringList categories;
83 categories << QLatin1String(
"Friends" ) << QLatin1String(
"School" ) << QLatin1String(
"KDE" );
87 a.setStreet( QLatin1String(
"6544 Battleford Drive" ) );
88 a.setLocality( QLatin1String(
"Raleigh" ) );
89 a.setRegion( QLatin1String(
"NC" ) );
90 a.setPostalCode( QLatin1String(
"27613-3502" ) );
91 a.setCountry( QLatin1String(
"U.S.A." ) );
94 addressee.
insertCustom( QLatin1String(
"1hsdf" ), QLatin1String(
"ertuer" ),
95 QLatin1String(
"iurt" ) );
96 addressee.
insertCustom( QLatin1String(
"2hsdf" ), QLatin1String(
"ertuer" ),
97 QLatin1String(
"iurt" ) );
98 addressee.
insertCustom( QLatin1String(
"3hsdf" ), QLatin1String(
"ertuer" ),
99 QLatin1String(
"iurt" ) );
102 for (
int i = 0; i < 1000; ++i ) {
104 addr.
setUid( QString::number( i ) );
111 QFile file( QLatin1String(
"out.vcf" ) );
112 if ( !file.open( QIODevice::WriteOnly ) ) {
113 qDebug(
"Can't open file '%s' fro writing", qPrintable( file.fileName() ) );
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Fri Jan 17 2014 22:12:53 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.