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( TQString::fromUtf8(
"иванчо") );
49 addressee.setBirthday( TQDate( 1981, 7, 19 ) );
50 addressee.setMailer(
"mutt1.2" );
56 addressee.setGeo( geo );
58 addressee.setTitle( TQString::fromUtf8(
"Др") );
59 addressee.setRole( TQString::fromUtf8(
"Самарянин") );
60 addressee.setOrganization( TQString::fromUtf8(
"България ООД") );
61 addressee.setNote( TQString::fromUtf8(
"не\nпипай работеща система") );
62 addressee.setProductId(
"testId" );
63 addressee.setRevision( TQDateTime::currentDateTime() );
64 addressee.setSortString( TQString::fromUtf8(
"сортиране") );
65 addressee.setUrl(
KURL(
"http://wgess17.dyndns.org") );
66 addressee.setSecrecy( TDEABC::Secrecy( TDEABC::Secrecy::Confidential ) );
88 addressee.
insertEmail( TQString::fromUtf8(
"иван.иванов@българия.оод"),
true );
89 addressee.
insertEmail( TQString::fromUtf8(
"иванчо@yahoo.de"),
true );
91 TDEABC::PhoneNumber phone1(
"029876543", 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( TQString::fromUtf8(
"Цар Борис III") );
105 a.setLocality( TQString::fromUtf8(
"София" ));
106 a.setRegion( TQString::fromUtf8(
"София град" ));
107 a.setPostalCode( TQString::fromUtf8(
"1000" ));
108 a.setCountry( TQString::fromUtf8(
"България" ));
111 addressee.
insertCustom(
"1hsdf",
"test1",TQString::fromUtf8(
"ежзик" ));
112 addressee.
insertCustom(
"2hsdf",
"test2",TQString::fromUtf8(
"ежзик" ));
113 addressee.
insertCustom(
"3hsdf",
"test3",TQString::fromUtf8(
"ежзик" ));
117 TDEABC::Addressee::List list;
118 for (
int i = 0; i < 20; ++i ) {
120 addr.
setUid( TQString::number( i ) );
127 TQFile file(
"out2.vcf" );
128 file.open( IO_WriteOnly );
130 TQTextStream s( &file );
131 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 dump() const
Debug output.
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)