korganizer Library API Documentation

korgplugins.cpp

00001 #include <kaboutdata.h>
00002 #include <kapplication.h>
00003 #include <kdebug.h>
00004 #include <klocale.h>
00005 #include <kcmdlineargs.h>
00006 
00007 #include <calendar/plugin.h>
00008 
00009 #include "kocore.h"
00010 
00011 int main(int argc,char **argv)
00012 {
00013   KAboutData aboutData("korgplugins",I18N_NOOP("KOrgPlugins"),"0.1");
00014   KCmdLineArgs::init(argc,argv,&aboutData);
00015 
00016   KApplication app;
00017   
00018   KTrader::OfferList plugins = KOCore::self()->availablePlugins("Calendar/Plugin");
00019   KTrader::OfferList::ConstIterator it;
00020   for(it = plugins.begin(); it != plugins.end(); ++it) {
00021     kdDebug() << "Plugin: " << (*it)->desktopEntryName() << " ("
00022               << (*it)->name() << ")" << endl;
00023     KOrg::Plugin *p = KOCore::self()->loadPlugin(*it);
00024     if (!p) {
00025       kdDebug() << "Plugin loading failed." << endl;
00026     } else {
00027       kdDebug() << "PLUGIN INFO: " << p->info() << endl;
00028     }
00029   }
00030   
00031   plugins = KOCore::self()->availablePlugins("KOrganizer/Part");
00032   for(it = plugins.begin(); it != plugins.end(); ++it) {
00033     kdDebug() << "Part: " << (*it)->desktopEntryName() << " ("
00034               << (*it)->name() << ")" << endl;
00035     KOrg::Part *p = KOCore::self()->loadPart(*it,0);
00036     if (!p) {
00037       kdDebug() << "Plugin loading failed." << endl;
00038     } else {
00039       kdDebug() << "PLUGIN INFO: " << p->info() << endl;
00040     }
00041   }
00042   
00043   plugins = KOCore::self()->availablePlugins("KOrganizer/View");
00044   for(it = plugins.begin(); it != plugins.end(); ++it) {
00045     kdDebug() << "Part: " << (*it)->desktopEntryName() << " ("
00046               << (*it)->name() << ")" << endl;
00047 #if 0
00048     KOrg::Part *p = KOCore::self()->loadPart(*it,0,0);
00049     if (!p) {
00050       kdDebug() << "Plugin loading failed." << endl;
00051     } else {
00052       kdDebug() << "PLUGIN INFO: " << p->info() << endl;
00053     }
00054 #endif
00055   }
00056 
00057 #if 0  
00058   KOrg::TextDecoration::List tdl = KOCore::self()->textDecorations();
00059   KOrg::TextDecoration *td = tdl.first();
00060   while(td) {
00061     kdDebug() << "TEXT DECORATION INFO: " << td->info() << endl;
00062     td = tdl.next();
00063   }
00064 
00065   KOrg::WidgetDecoration *moon = KOCore::self()->loadWidgetDecoration("moon");
00066   if (moon) {
00067     QWidget *wid = moon->daySmall(0,QDate::currentDate());
00068     app.setMainWidget(wid);
00069     wid->show();
00070     app.exec();
00071   }
00072 #endif
00073 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:10 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001