KParts

partbase.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
4 SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef _KPARTS_PARTBASE_H
10#define _KPARTS_PARTBASE_H
11
12#include <kparts/kparts_export.h>
13
14#include <QObject>
15
16#include <KXMLGUIClient>
17#include <memory>
18
19// Internal:
20// As KParts::PartBase is inherited by KParts::Part which also inheriting from QObject,
21// which already has a protected d_ptr member, the macro Q_DECLARE_PRIVATE cannot be used
22// as it references d_ptr without any class qualifier, which is ambiguous then.
23#define KPARTS_DECLARE_PRIVATE(Class) Q_DECLARE_PRIVATE_D(PartBase::d_ptr, Class)
24
25namespace KParts
26{
27class PartBasePrivate;
28
29/**
30 * @class PartBase partbase.h <KParts/PartBase>
31 *
32 * @short Base class for all parts.
33 */
34class KPARTS_EXPORT PartBase : virtual public KXMLGUIClient
35{
36 KPARTS_DECLARE_PRIVATE(PartBase)
37
38public:
39 /**
40 * Constructor.
41 */
42 PartBase();
43
44 /**
45 * Destructor.
46 */
47 ~PartBase() override;
48
49 /**
50 * Internal method. Called by KParts::Part to specify the parent object for plugin objects.
51 *
52 * @internal
53 */
54 void setPartObject(QObject *object);
55 QObject *partObject() const;
56
57protected:
58 KPARTS_NO_EXPORT explicit PartBase(PartBasePrivate &dd);
59
60 std::unique_ptr<PartBasePrivate> const d_ptr;
61
62private:
63 Q_DISABLE_COPY(PartBase)
64};
65
66} // namespace
67
68#endif
Base class for all parts.
Definition partbase.h:35
~PartBase() override
Destructor.
The KParts namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.