KontactInterface

core.h
1/*
2 This file is part of the KDE Kontact Plugin Interface Library.
3
4 SPDX-FileCopyrightText: 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
5 SPDX-FileCopyrightText: 2002-2003 Daniel Molkentin <molkentin@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8
9*/
10#pragma once
11
12#include "kontactinterface_export.h"
13
14#include <KParts/MainWindow>
15#include <KParts/Part>
16
17namespace KontactInterface
18{
19class Plugin;
20class CorePrivate;
21/**
22 * @short The abstract interface that represents the Kontact core.
23 *
24 * This class provides the interface to the Kontact core for the plugins.
25 */
26class KONTACTINTERFACE_EXPORT Core : public KParts::MainWindow
27{
28 Q_OBJECT
29
30public:
31 /**
32 * Destroys the core object.
33 */
34 ~Core() override;
35
36 /**
37 * Selects the given plugin and raises the associated part.
38 * @see selectPlugin(const QString &)
39 *
40 * @param plugin is a pointer to the Kontact Plugin to select.
41 */
42 virtual void selectPlugin(KontactInterface::Plugin *plugin) = 0;
43
44 /**
45 * This is an overloaded member function
46 * @see selectPlugin(KontactInterface::Plugin *)
47 *
48 * @param plugin is the name of the Kontact Plugin select.
49 */
50 virtual void selectPlugin(const QString &plugin) = 0;
51
52 /**
53 * Returns the pointer list of available plugins.
54 */
56
57 /**
58 * @internal (for Plugin)
59 *
60 * @param library the library to create part from
61 * Creates a part from the given @p library.
62 */
63 [[nodiscard]] KParts::Part *createPart(const char *library);
64
65 /**
66 * @internal (for Plugin)
67 *
68 * Tells the kontact core that a part has been loaded.
69 */
70 virtual void partLoaded(Plugin *plugin, KParts::Part *part) = 0;
71
72Q_SIGNALS:
73 /**
74 * This signal is emitted whenever a new day starts.
75 *
76 * @param date The date of the new day
77 */
78 void dayChanged(const QDate &date);
79
80protected:
81 /**
82 * Creates a new core object.
83 *
84 * @param parent The parent widget.
85 * @param flags The window flags.
86 */
87 explicit Core(QWidget *parent = nullptr, Qt::WindowFlags flags = {});
88
89 /**
90 * Returns the last error message for problems during
91 * KParts loading.
92 */
93 QString lastErrorMessage() const;
94
95private:
96 //@cond PRIVATE
97 friend class CorePrivate;
98 std::unique_ptr<CorePrivate> const d;
99 //@endcond
100};
101
102}
The abstract interface that represents the Kontact core.
Definition core.h:27
virtual void selectPlugin(KontactInterface::Plugin *plugin)=0
Selects the given plugin and raises the associated part.
virtual void partLoaded(Plugin *plugin, KParts::Part *part)=0
void dayChanged(const QDate &date)
This signal is emitted whenever a new day starts.
~Core() override
Destroys the core object.
virtual void selectPlugin(const QString &plugin)=0
This is an overloaded member function.
virtual QList< KontactInterface::Plugin * > pluginList() const =0
Returns the pointer list of available plugins.
Base class for all Plugins in Kontact.
Definition plugin.h:66
typedef WindowFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:49:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.