-rw-r--r-- | kabc/vcard/testwrite.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kabc/vcard/testwrite.cpp b/kabc/vcard/testwrite.cpp new file mode 100644 index 0000000..e4bbe7b --- a/dev/null +++ b/kabc/vcard/testwrite.cpp | |||
@@ -0,0 +1,41 @@ | |||
1 | #include <kaboutdata.h> | ||
2 | #include <kapplication.h> | ||
3 | #include <kdebug.h> | ||
4 | #include <klocale.h> | ||
5 | #include <kcmdlineargs.h> | ||
6 | |||
7 | #include <VCard.h> | ||
8 | |||
9 | int main(int argc,char **argv) | ||
10 | { | ||
11 | KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); | ||
12 | KCmdLineArgs::init(argc,argv,&aboutData); | ||
13 | |||
14 | KApplication app; | ||
15 | |||
16 | kdDebug() << "Test Write VCard" << endl; | ||
17 | |||
18 | using namespace VCARD; | ||
19 | |||
20 | VCard v; | ||
21 | |||
22 | ContentLine cl1; | ||
23 | cl1.setName(EntityTypeToParamName(EntityName)); | ||
24 | cl1.setValue(new TextValue("Hans Wurst")); | ||
25 | v.add(cl1); | ||
26 | |||
27 | ContentLine cl2; | ||
28 | cl2.setName(EntityTypeToParamName(EntityTelephone)); | ||
29 | cl2.setValue(new TelValue("12345")); | ||
30 | ParamList p; | ||
31 | p.append( new TelParam("home") ); | ||
32 | p.append( new TelParam("fax") ); | ||
33 | cl2.setParamList( p ); | ||
34 | v.add(cl2); | ||
35 | |||
36 | QCString str = v.asString(); | ||
37 | |||
38 | kdDebug() << "--- VCard begin ---" << endl | ||
39 | << str | ||
40 | << "--- VCard end ---" << endl; | ||
41 | } | ||