File indexing completed on 2024-12-01 09:55:30

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 1998, 1999 Torben Weis <weis@kde.org>
0004     SPDX-FileCopyrightText: 1999 Waldo Bastian <bastian@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef __kservicetype_p_h__
0010 #define __kservicetype_p_h__
0011 
0012 #include "kservicetype.h"
0013 #include <ksycocaentry_p.h>
0014 
0015 class KServiceTypePrivate : public KSycocaEntryPrivate
0016 {
0017 public:
0018     K_SYCOCATYPE(KST_KServiceType, KSycocaEntryPrivate)
0019 
0020     explicit KServiceTypePrivate(const QString &path)
0021         : KSycocaEntryPrivate(path)
0022         , m_serviceOffersOffset(-1)
0023         , m_bDerived(false)
0024         , m_parentTypeLoaded(false)
0025     {
0026     }
0027 
0028     KServiceTypePrivate(QDataStream &_str, int offset)
0029         : KSycocaEntryPrivate(_str, offset)
0030         , m_serviceOffersOffset(-1)
0031         , m_bDerived(false)
0032         , m_parentTypeLoaded(false)
0033     {
0034     }
0035 
0036     ~KServiceTypePrivate() override
0037     {
0038     }
0039 
0040     void save(QDataStream &) override;
0041 
0042     QString name() const override
0043     {
0044         return m_strName;
0045     }
0046 
0047     QVariant property(const QString &name) const override;
0048 
0049     QStringList propertyNames() const override;
0050 
0051     virtual QString comment() const
0052     {
0053         return m_strComment;
0054     }
0055 
0056     virtual int serviceOffersOffset() const
0057     {
0058         return m_serviceOffersOffset;
0059     }
0060 
0061     void init(KDesktopFile *config);
0062     void load(QDataStream &_str);
0063 
0064     KServiceType::Ptr parentType;
0065     QString m_strName;
0066     mutable /*remove mutable when kmimetype doesn't use this anymore*/ QString m_strComment;
0067     int m_serviceOffersOffset;
0068     QMap<QString, QVariant::Type> m_mapPropDefs;
0069     QMap<QString, QVariant> m_mapProps;
0070     unsigned m_bDerived : 1;
0071     unsigned m_parentTypeLoaded : 1;
0072 };
0073 
0074 #endif // __kservicetype_p_h__