22 #include <kapplication.h> 23 #include <kcmdlineargs.h> 25 #include <kaboutdata.h> 27 #include "vcardformatplugin.h" 38 main(
int argc,
char **argv )
40 KAboutData aboutData(
"testvcardformatplugin",
"vCard format plugin",
"0.1" );
50 addressee.setNickName( TQString::fromUtf8(
"иванчо") );
51 addressee.setBirthday( TQDate( 1981, 7, 19 ) );
52 addressee.setMailer(
"mutt1.2" );
58 addressee.setGeo( geo );
60 addressee.setTitle( TQString::fromUtf8(
"Др") );
61 addressee.setRole( TQString::fromUtf8(
"Самарянин") );
62 addressee.setOrganization( TQString::fromUtf8(
"България ООД") );
63 addressee.setNote( TQString::fromUtf8(
"не\nпипай работеща система") );
64 addressee.setProductId(
"testId" );
65 addressee.setRevision( TQDateTime::currentDateTime() );
66 addressee.setSortString( TQString::fromUtf8(
"сортиране") );
67 addressee.setUrl(
KURL(
"http://wgess17.dyndns.org") );
68 addressee.setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) );
90 addressee.
insertEmail( TQString::fromUtf8(
"иван.иванов@българия.оод"),
true );
91 addressee.
insertEmail( TQString::fromUtf8(
"иванчо@yahoo.de"),
true );
93 KABC::PhoneNumber phone1(
"029876543", KABC::PhoneNumber::Pref | KABC::PhoneNumber::Home );
101 TQStringList categories;
102 categories <<
"Friends" <<
"School" <<
"KDE";
105 KABC::Address a( KABC::Address::Work | KABC::Address::Postal | KABC::Address::Parcel );
106 a.setStreet( TQString::fromUtf8(
"Цар Борис III") );
107 a.setLocality( TQString::fromUtf8(
"София" ));
108 a.setRegion( TQString::fromUtf8(
"София град" ));
109 a.setPostalCode( TQString::fromUtf8(
"1000" ));
110 a.setCountry( TQString::fromUtf8(
"България" ));
113 addressee.
insertCustom(
"1hsdf",
"test1",TQString::fromUtf8(
"ежзик" ));
114 addressee.
insertCustom(
"2hsdf",
"test2",TQString::fromUtf8(
"ежзик" ));
115 addressee.
insertCustom(
"3hsdf",
"test3",TQString::fromUtf8(
"ежзик" ));
138 TQFile file(
"vfout.vcf" );
139 if ( file.open(IO_WriteOnly) ){
140 vcfplugin->
save(addressee, &file);
147 if ( file.open(IO_ReadOnly ) ){
148 vcfplugin->
load(addressee2, &file);
Postal address information.
void insertCustom(const TQString &app, const TQString &name, const TQString &value)
Insert custom entry.
void insertPhoneNumber(const PhoneNumber &phoneNumber)
Insert a phone number.
A class to store an encryption key.
void insertKey(const Key &key)
Insert a key.
void setLongitude(float)
Sets the longitude.
int key(StdAccel) KDE_DEPRECATED
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 insertAddress(const Address &address)
Insert an address.
void setCategories(const TQStringList &)
Set categories to given value.
static void init(int _argc, char **_argv, const char *_appname, const char *programName, const char *_description, const char *_version, bool noKApp=false)
static data, shared by ALL addressee objects
void insertEmail(const TQString &email, bool preferred=false)
Insert an email address.
void dump() const
Debug output.
void setLatitude(float)
Sets the latitude.