korganizer

kocore.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2001,2003 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 Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef KOCORE_H
00026 #define KOCORE_H
00027 
00028 #include <calendar/calendardecoration.h>
00029 #include <korganizer/part.h>
00030 #include <korganizer/printplugin.h>
00031 
00032 #include <kdepimmacros.h>
00033 #include <ktrader.h>
00034 
00035 namespace KPIM { class IdentityManager; }
00036 
00037 class KDE_EXPORT KOCore
00038 {
00039   public:
00040     ~KOCore();
00041 
00042     static KOCore *self();
00043 
00044     KTrader::OfferList availablePlugins();
00045     KTrader::OfferList availableCalendarDecorations();
00046     KTrader::OfferList availableParts();
00047     KTrader::OfferList availablePrintPlugins();
00048 
00049     KOrg::Plugin *loadPlugin( KService::Ptr service );
00050     KOrg::Plugin *loadPlugin( const QString & );
00051 
00052     KOrg::CalendarDecoration *loadCalendarDecoration( KService::Ptr service );
00053     KOrg::CalendarDecoration *loadCalendarDecoration( const QString & );
00054 
00055     KOrg::Part *loadPart( KService::Ptr, KOrg::MainWindow *parent );
00056     KOrg::Part *loadPart( const QString &, KOrg::MainWindow *parent );
00057     
00058     KOrg::PrintPlugin *loadPrintPlugin( KService::Ptr service );
00059     KOrg::PrintPlugin *loadPrintPlugin( const QString & );
00060 
00061     KOrg::CalendarDecoration::List calendarDecorations();
00062     KOrg::PrintPlugin::List loadPrintPlugins();
00063     KOrg::Part::List loadParts( KOrg::MainWindow *parent );
00064 
00065     void addXMLGUIClient( QWidget*, KXMLGUIClient *guiclient );
00066     void removeXMLGUIClient( QWidget* );
00067     KXMLGUIClient *xmlguiClient( QWidget* ) const;
00068 
00073     void unloadParts( KOrg::MainWindow *parent, KOrg::Part::List &parts );
00074     void unloadPlugins();
00075 
00076     void reloadPlugins();
00077 
00082     KOrg::Part::List reloadParts( KOrg::MainWindow *parent,
00083                                   KOrg::Part::List &parts );
00084 
00085     KPIM::IdentityManager* identityManager();
00086 
00087   protected:
00088     KOCore();
00089 
00090     KTrader::OfferList availablePlugins( const QString &type,
00091                                          int pluginInterfaceVersion = -1 );
00092 
00093   private:
00094     static KOCore *mSelf;
00095 
00096     KOrg::CalendarDecoration::List mCalendarDecorations;
00097     bool mCalendarDecorationsLoaded;
00098 
00099     QMap<QWidget*, KXMLGUIClient*> mXMLGUIClients;
00100 
00101     KPIM::IdentityManager *mIdentityManager;
00102 };
00103 
00104 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys