korganizer

korgplugins.cpp
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 #include <tdeaboutdata.h>
26 #include <tdeapplication.h>
27 #include <kdebug.h>
28 #include <tdelocale.h>
29 #include <tdecmdlineargs.h>
30 
31 #include <calendar/plugin.h>
32 
33 #include "kocore.h"
34 
35 int main(int argc,char **argv)
36 {
37  TDEAboutData aboutData("korgplugins",I18N_NOOP("KOrgPlugins"),"0.1");
38  TDECmdLineArgs::init(argc,argv,&aboutData);
39 
40  TDEApplication app;
41 
42  TDETrader::OfferList plugins = KOCore::self()->availablePlugins();
43  TDETrader::OfferList::ConstIterator it;
44  for(it = plugins.begin(); it != plugins.end(); ++it) {
45  kdDebug(5850) << "Plugin: " << (*it)->desktopEntryName() << " ("
46  << (*it)->name() << ")" << endl;
47  KOrg::Plugin *p = KOCore::self()->loadPlugin(*it);
48  if (!p) {
49  kdDebug(5850) << "Plugin loading failed." << endl;
50  } else {
51  kdDebug(5850) << "PLUGIN INFO: " << p->info() << endl;
52  }
53  }
54 
55  plugins = KOCore::self()->availablePrintPlugins();
56  for(it = plugins.begin(); it != plugins.end(); ++it) {
57  kdDebug(5850) << "Print plugin: " << (*it)->desktopEntryName() << " ("
58  << (*it)->name() << ")" << endl;
59  KOrg::PrintPlugin *p = KOCore::self()->loadPrintPlugin(*it);
60  if (!p) {
61  kdDebug(5850) << "Print plugin loading failed." << endl;
62  } else {
63  kdDebug(5850) << "PRINT PLUGIN INFO: " << p->info() << endl;
64  }
65  }
66 
67  plugins = KOCore::self()->availableParts();
68  for(it = plugins.begin(); it != plugins.end(); ++it) {
69  kdDebug(5850) << "Part: " << (*it)->desktopEntryName() << " ("
70  << (*it)->name() << ")" << endl;
71  KOrg::Part *p = KOCore::self()->loadPart(*it,0);
72  if (!p) {
73  kdDebug(5850) << "Part loading failed." << endl;
74  } else {
75  kdDebug(5850) << "PART INFO: " << p->info() << endl;
76  }
77  }
78 
79  plugins = KOCore::self()->availableCalendarDecorations();
80  for(it = plugins.begin(); it != plugins.end(); ++it) {
81  kdDebug(5850) << "CalendarDecoration: " << (*it)->desktopEntryName() << " ("
82  << (*it)->name() << ")" << endl;
83  KOrg::CalendarDecoration *p = KOCore::self()->loadCalendarDecoration(*it);
84  if (!p) {
85  kdDebug(5850) << "Calendar decoration loading failed." << endl;
86  } else {
87  kdDebug(5850) << "CALENDAR DECORATION INFO: " << p->info() << endl;
88  }
89  }
90 
91 }
This class provides the interface for a date dependent decoration.
Base class for KOrganizer printing classes.
Definition: printplugin.h:52
virtual TQString info()=0
Returns long description of print format.