| # kabc Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# testwrite.cpp

    00001 #include <kaboutdata.h>
    00002 #include <kapplication.h>
    00003 #include <kdebug.h>
    00004 #include <klocale.h>
    00005 #include <kcmdlineargs.h>
    00006
    00007 #include <VCard.h>
    00008
    00009 int main(int argc,char **argv)
    00010 {
    00011   KAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1");
    00012   KCmdLineArgs::init(argc,argv,&aboutData);
    00013
    00014   KApplication app;
    00015
    00016   kdDebug() << "Test Write VCard" << endl;
    00017
    00018   using namespace VCARD;
    00019
    00020   VCard v;
    00021
    00022   ContentLine cl1;
    00023   cl1.setName(EntityTypeToParamName(EntityName));
    00024   cl1.setValue(new TextValue("Hans Wurst"));
    00025   v.add(cl1);
    00026
    00027   ContentLine cl2;
    00028   cl2.setName(EntityTypeToParamName(EntityTelephone));
    00029   cl2.setValue(new TelValue("12345"));
    00030   ParamList p;
    00031   p.append( new TelParam("home") );
    00032   p.append( new TelParam("fax") );
    00033   cl2.setParamList( p );
    00034   v.add(cl2);
    00035
    00036   QCString str = v.asString();
    00037
    00038   kdDebug() << "--- VCard begin ---" << endl
    00039             << str
    00040             << "--- VCard  end  ---" << endl;
    00041 }

This file is part of the documentation for kabc Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:31:31 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003