dcoptest.cpp
00001
#ifdef HAVE_CONFIG_H
00002
#include <config.h>
00003
#endif
00004
00005
#include <kdebug.h>
00006
#include <kapplication.h>
00007
#include <dcopclient.h>
00008
#include <kaboutdata.h>
00009
#include <kcmdlineargs.h>
00010
00011
#include <kmailIface_stub.h>
00012
#include <mailcomposerIface_stub.h>
00013
00014
int main(
int argc,
char **argv)
00015 {
00016 kdDebug(5006) <<
"Test KMail DCOP interface." << endl;
00017
00018 KAboutData about(
"testKMailDCOP",
"TestKMailDCOP",
00019
"0.0",
00020
"Test for KMail DCOP interface",
00021 KAboutData::License_GPL,
00022
"(c) 2001, Cornelius Schumacher",
00023 0,
00024
"http://kmail.kde.org");
00025 KCmdLineArgs::init(argc, argv, &about);
00026 KApplication app;
00027 app.dcopClient()->attach();
00028
00029 KMailIface_stub kmailStub(
"kmail",
"KMailIface");
00030
00031 kmailStub.openComposer(
"to 1",
"",
"",
"First test",
"simple openComp call",0,
00032 KURL());
00033
00034 DCOPRef ref = kmailStub.openComposer(
"to 2",
"",
"",
"Second test",
00035
"DCOP ref call",0);
00036 MailComposerIface_stub composerStub(ref.app(),ref.object());
00037
QCString data =
"BEGIN:VCALENDAR\nEND:VCALENDAR";
00038 composerStub.addAttachment(
"test.ics",
"7bit",data,
"text",
"calendar",
"method",
00039
"publish",
"attachement;");
00040 composerStub.send(2);
00041
00042 kdDebug(5006) <<
"testDCOP done." << endl;
00043
00044
return 0;
00045 }
This file is part of the documentation for kmail Library Version 3.3.0.