File indexing completed on 2024-04-28 15:29:21

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
0004     SPDX-FileCopyrightText: 1999-2005 David Faure <faure@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef _KPARTS_PART_P_H
0010 #define _KPARTS_PART_P_H
0011 
0012 #include "part.h"
0013 #include "partbase_p.h"
0014 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 77)
0015 #include "partmetadatautil_p.h"
0016 #endif
0017 // KF
0018 #include <KPluginMetaData>
0019 // Qt
0020 #include <QPointer>
0021 #include <QWidget>
0022 
0023 namespace KParts
0024 {
0025 class PartPrivate : public PartBasePrivate
0026 {
0027 public:
0028     Q_DECLARE_PUBLIC(Part)
0029 
0030     explicit PartPrivate(Part *qq)
0031         : PartBasePrivate(qq)
0032         , m_iconLoader(nullptr)
0033         ,
0034 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 72)
0035         m_bSelectable(true)
0036         ,
0037 #endif
0038         m_autoDeleteWidget(true)
0039         , m_autoDeletePart(true)
0040         , m_manager(nullptr)
0041     {
0042     }
0043 
0044     ~PartPrivate() override
0045     {
0046     }
0047 
0048 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 77)
0049     void setComponentData(const KAboutData &componentData) override
0050     {
0051         m_metaData = PartMetaDataUtil::fromKAboutData(componentData);
0052         PartBasePrivate::setComponentData(componentData);
0053     }
0054 #endif
0055 
0056     KPluginMetaData m_metaData;
0057     KIconLoader *m_iconLoader;
0058 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 72)
0059     bool m_bSelectable;
0060 #endif
0061     bool m_autoDeleteWidget;
0062     bool m_autoDeletePart;
0063     PartManager *m_manager;
0064     QPointer<QWidget> m_widget;
0065 };
0066 
0067 } // namespace
0068 
0069 #endif