20 #include <tdeabc/addressee.h>
21 #include <tdeabc/phonenumber.h>
22 #include <tdeabc/address.h>
23 #include <tdeabc/key.h>
24 #include <tdeabc/picture.h>
25 #include <tdeabc/sound.h>
26 #include <tdeabc/secrecy.h>
27 #include <tdeaboutdata.h>
28 #include <tdeapplication.h>
29 #include <tdecmdlineargs.h>
32 #include <tqtextstream.h>
34 #include "vcardconverter.h"
36 int main(
int argc,
char **argv )
38 TDEAboutData aboutData(
"testwrite",
"vCard test writer",
"0.1" );
48 addressee.setNickName(
"tokoe" );
49 addressee.setBirthday( TQDate( 1982, 7, 19 ) );
50 addressee.setMailer(
"mutt1.2" );
56 addressee.setGeo( geo );
58 addressee.setTitle(
"nerd" );
59 addressee.setRole(
"Maintainer" );
60 addressee.setOrganization(
"KDE" );
61 addressee.setNote(
"nerver\ntouch a running system" );
62 addressee.setProductId(
"testId" );
63 addressee.setRevision( TQDateTime::currentDateTime() );
64 addressee.setSortString(
"koenig" );
65 addressee.setUrl(
KURL(
"http://wgess16.dyndns.org") );
66 addressee.setSecrecy( TDEABC::Secrecy( TDEABC::Secrecy::Confidential ) );
91 TDEABC::PhoneNumber phone1(
"3541523475", TDEABC::PhoneNumber::Pref | TDEABC::PhoneNumber::Home );
99 TQStringList categories;
100 categories <<
"Friends" <<
"School" <<
"KDE";
103 TDEABC::Address a( TDEABC::Address::Work | TDEABC::Address::Postal | TDEABC::Address::Parcel );
104 a.setStreet(
"6544 Battleford Drive" );
105 a.setLocality(
"Raleigh" );
107 a.setPostalCode(
"27613-3502" );
108 a.setCountry(
"U.S.A." );
115 TDEABC::Addressee::List list;
116 for (
int i = 0; i < 1000; ++i ) {
118 addr.
setUid( TQString::number( i ) );
125 TQFile file(
"out.vcf" );
126 file.open( IO_WriteOnly );
128 TQTextStream s( &file );
129 s.setEncoding( TQTextStream::UnicodeUTF8 );
Postal address information.
void setUid(const TQString &uid)
Set unique identifier.
void setCategories(const TQStringList &)
Set categories to given value.
void insertPhoneNumber(const PhoneNumber &phoneNumber)
Insert a phone number.
void insertCustom(const TQString &app, const TQString &name, const TQString &value)
Insert custom entry.
void insertEmail(const TQString &email, bool preferred=false)
Insert an email address.
void insertAddress(const Address &address)
Insert an address.
DECLARATIONS void setNameFromString(const TQString &)
Set name fields by parsing the given string and trying to associate the parts of the string with acco...
void insertKey(const Key &key)
Insert a key.
void setLongitude(float)
Sets the longitude.
void setLatitude(float)
Sets the latitude.
A class to store an encryption key.
Class to converting contact objects into vCard format and vice versa.
TQString createVCards(Addressee::List list, Version version=v3_0)
Creates a string in vCard format which contains the given list of contact.
static void init(int _argc, char **_argv, const char *_appname, const char *programName, const char *_description, const char *_version, bool noKApp=false)