Add context, this fordward is different from the fordward when we are in mail context
[kdepim.git] / korganizer / kocore.h
blobd7a1ceac10352894955cf58a72eb6f1f5e3f6300
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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.
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.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
25 #ifndef KOCORE_H
26 #define KOCORE_H
28 #include "korganizer_export.h"
30 #include <calendar/calendardecoration.h>
31 #include <korganizer/part.h>
32 #include <korganizer/printplugin.h>
34 #include <kservice.h>
36 namespace KPIMIdentities { class IdentityManager; }
38 class KORGANIZERPRIVATE_EXPORT KOCore
40 public:
41 ~KOCore();
43 static KOCore *self();
45 KService::List availablePlugins();
46 KService::List availableCalendarDecorations();
47 KService::List availableParts();
48 KService::List availablePrintPlugins();
50 KOrg::Plugin *loadPlugin( KService::Ptr service );
51 KOrg::Plugin *loadPlugin( const QString & );
53 KOrg::CalendarDecoration::Decoration *loadCalendarDecoration( KService::Ptr service );
54 KOrg::CalendarDecoration::Decoration *loadCalendarDecoration( const QString & );
56 KOrg::Part *loadPart( KService::Ptr, KOrg::MainWindow *parent );
57 KOrg::Part *loadPart( const QString &, KOrg::MainWindow *parent );
59 KOrg::PrintPlugin *loadPrintPlugin( KService::Ptr service );
60 KOrg::PrintPlugin *loadPrintPlugin( const QString & );
62 KOrg::CalendarDecoration::Decoration::List loadCalendarDecorations();
63 KOrg::PrintPlugin::List loadPrintPlugins();
64 KOrg::Part::List loadParts( KOrg::MainWindow *parent );
66 void addXMLGUIClient( QWidget *, KXMLGUIClient *guiclient );
67 void removeXMLGUIClient( QWidget * );
68 KXMLGUIClient *xmlguiClient( QWidget * ) const;
70 /**
71 Unload the parts in &p parts for this main window. Clears
72 parts.
73 @param parent the parent main window for all parts
74 @param parts the list of parts to be undloaded
76 void unloadParts( KOrg::MainWindow *parent, KOrg::Part::List &parts );
77 void unloadPlugins();
79 void reloadPlugins();
81 /**
82 Unloads the parts from the main window. Loads the parts that
83 are listed in KOPrefs and returns a list of these parts.
84 @param parent the parent main window for all parts
85 @param parts the list of parts to be reloaded
87 KOrg::Part::List reloadParts( KOrg::MainWindow *parent, KOrg::Part::List &parts );
89 KPIMIdentities::IdentityManager *identityManager();
91 protected:
92 KOCore();
93 KService::List availablePlugins( const QString &type, int pluginInterfaceVersion = -1 );
95 private:
96 static KOCore *mSelf;
98 KOrg::CalendarDecoration::Decoration::List mCalendarDecorations;
99 bool mCalendarDecorationsLoaded;
101 QMap<QWidget*, KXMLGUIClient*> mXMLGUIClients;
103 KPIMIdentities::IdentityManager *mIdentityManager;
106 #endif