SVN_SILENT made messages (.desktop file) - always resolve ours
[kdepim.git] / korganizer / kocore.h
blob1e2446969ff5a37ea14ae5e3d614bf762d2e273b
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.
26 #ifndef KORG_KOCORE_H
27 #define KORG_KOCORE_H
29 #include "korganizer_core_export.h"
30 #include "part.h"
32 #include <calendarviews/agenda/calendardecoration.h>
34 #include <KService>
36 namespace KIdentityManagement
38 class IdentityManager;
41 class KORGANIZER_CORE_EXPORT KOCore
43 public:
44 ~KOCore();
46 static KOCore *self();
48 KService::List availablePlugins();
49 KService::List availableCalendarDecorations();
50 KService::List availableParts();
52 CalendarSupport::Plugin *loadPlugin(const KService::Ptr &service);
53 CalendarSupport::Plugin *loadPlugin(const QString &);
55 EventViews::CalendarDecoration::Decoration *loadCalendarDecoration(const KService::Ptr &service);
56 EventViews::CalendarDecoration::Decoration *loadCalendarDecoration(const QString &);
58 KOrg::Part *loadPart(const KService::Ptr &, KOrg::MainWindow *parent);
59 KOrg::Part *loadPart(const QString &, KOrg::MainWindow *parent);
61 EventViews::CalendarDecoration::Decoration::List loadCalendarDecorations();
62 KOrg::Part::List loadParts(KOrg::MainWindow *parent);
64 void addXMLGUIClient(QWidget *, KXMLGUIClient *guiclient);
65 void removeXMLGUIClient(QWidget *);
66 KXMLGUIClient *xmlguiClient(QWidget *) const;
68 /**
69 Unload the parts in &p parts for this main window. Clears
70 parts.
71 @param parent the parent main window for all parts
72 @param parts the list of parts to be undloaded
74 void unloadParts(KOrg::MainWindow *parent, KOrg::Part::List &parts);
75 void unloadPlugins();
77 void reloadPlugins();
79 /**
80 Unloads the parts from the main window. Loads the parts that
81 are listed in KOPrefs and returns a list of these parts.
82 @param parent the parent main window for all parts
83 @param parts the list of parts to be reloaded
85 KOrg::Part::List reloadParts(KOrg::MainWindow *parent, KOrg::Part::List &parts);
87 KIdentityManagement::IdentityManager *identityManager();
89 protected:
90 KOCore();
91 KService::List availablePlugins(const QString &type, int pluginInterfaceVersion = -1);
93 private:
94 static KOCore *mSelf;
96 EventViews::CalendarDecoration::Decoration::List mCalendarDecorations;
97 bool mCalendarDecorationsLoaded;
99 QMap<QWidget *, KXMLGUIClient *> mXMLGUIClients;
101 KIdentityManagement::IdentityManager *mIdentityManager;
104 #endif