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

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_PARTBASE_P_H
0010 #define _KPARTS_PARTBASE_P_H
0011 
0012 #include "partbase.h"
0013 
0014 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 77)
0015 #include <KAboutData>
0016 #endif
0017 
0018 namespace KParts
0019 {
0020 class PartBasePrivate
0021 {
0022 public:
0023     Q_DECLARE_PUBLIC(PartBase)
0024 
0025     PartBasePrivate(PartBase *qq)
0026         : q_ptr(qq)
0027 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 103)
0028         , m_pluginInterfaceVersion(0)
0029 #endif
0030         , m_obj(nullptr)
0031 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 77)
0032         , m_componentData(KAboutData::applicationData())
0033 #endif
0034     {
0035     }
0036 
0037     virtual ~PartBasePrivate()
0038     {
0039     }
0040 
0041 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 77)
0042     // allows the KPart-subclasses to catch in its overridden method
0043     // the deprecated setting of KAboutData and update its KPluginMetaData to that
0044     virtual void setComponentData(const KAboutData &componentData)
0045     {
0046         m_componentData = componentData;
0047     }
0048     const KAboutData &componentData() const
0049     {
0050         return m_componentData;
0051     }
0052 #endif
0053 
0054     PartBase *q_ptr;
0055 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 90)
0056     PartBase::PluginLoadingMode m_pluginLoadingMode = PartBase::LoadPlugins;
0057 #endif
0058 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 103)
0059     int m_pluginInterfaceVersion;
0060 #endif
0061     QObject *m_obj;
0062 
0063 #if KPARTS_BUILD_DEPRECATED_SINCE(5, 77)
0064 private:
0065     KAboutData m_componentData;
0066 #endif
0067 };
0068 
0069 } // namespace
0070 
0071 #endif