korgplugins.cpp
00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00005 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 00021 As a special exception, permission is given to link this program 00022 with any edition of TQt, and distribute the resulting executable, 00023 without including the source code for TQt in the source distribution. 00024 */ 00025 #include <kaboutdata.h> 00026 #include <kapplication.h> 00027 #include <kdebug.h> 00028 #include <klocale.h> 00029 #include <kcmdlineargs.h> 00030 00031 #include <calendar/plugin.h> 00032 00033 #include "kocore.h" 00034 00035 int main(int argc,char **argv) 00036 { 00037 KAboutData aboutData("korgplugins",I18N_NOOP("KOrgPlugins"),"0.1"); 00038 KCmdLineArgs::init(argc,argv,&aboutData); 00039 00040 KApplication app; 00041 00042 KTrader::OfferList plugins = KOCore::self()->availablePlugins(); 00043 KTrader::OfferList::ConstIterator it; 00044 for(it = plugins.begin(); it != plugins.end(); ++it) { 00045 kdDebug(5850) << "Plugin: " << (*it)->desktopEntryName() << " (" 00046 << (*it)->name() << ")" << endl; 00047 KOrg::Plugin *p = KOCore::self()->loadPlugin(*it); 00048 if (!p) { 00049 kdDebug(5850) << "Plugin loading failed." << endl; 00050 } else { 00051 kdDebug(5850) << "PLUGIN INFO: " << p->info() << endl; 00052 } 00053 } 00054 00055 plugins = KOCore::self()->availablePrintPlugins(); 00056 for(it = plugins.begin(); it != plugins.end(); ++it) { 00057 kdDebug(5850) << "Print plugin: " << (*it)->desktopEntryName() << " (" 00058 << (*it)->name() << ")" << endl; 00059 KOrg::PrintPlugin *p = KOCore::self()->loadPrintPlugin(*it); 00060 if (!p) { 00061 kdDebug(5850) << "Print plugin loading failed." << endl; 00062 } else { 00063 kdDebug(5850) << "PRINT PLUGIN INFO: " << p->info() << endl; 00064 } 00065 } 00066 00067 plugins = KOCore::self()->availableParts(); 00068 for(it = plugins.begin(); it != plugins.end(); ++it) { 00069 kdDebug(5850) << "Part: " << (*it)->desktopEntryName() << " (" 00070 << (*it)->name() << ")" << endl; 00071 KOrg::Part *p = KOCore::self()->loadPart(*it,0); 00072 if (!p) { 00073 kdDebug(5850) << "Part loading failed." << endl; 00074 } else { 00075 kdDebug(5850) << "PART INFO: " << p->info() << endl; 00076 } 00077 } 00078 00079 plugins = KOCore::self()->availableCalendarDecorations(); 00080 for(it = plugins.begin(); it != plugins.end(); ++it) { 00081 kdDebug(5850) << "CalendarDecoration: " << (*it)->desktopEntryName() << " (" 00082 << (*it)->name() << ")" << endl; 00083 KOrg::CalendarDecoration *p = KOCore::self()->loadCalendarDecoration(*it); 00084 if (!p) { 00085 kdDebug(5850) << "Calendar decoration loading failed." << endl; 00086 } else { 00087 kdDebug(5850) << "CALENDAR DECORATION INFO: " << p->info() << endl; 00088 } 00089 } 00090 00091 }