| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-only |
| 6 | */ |
| 7 | |
| 8 | #ifndef KSERVICEGROUPPRIVATE_H |
| 9 | #define KSERVICEGROUPPRIVATE_H |
| 10 | |
| 11 | #include "kservicegroup.h" |
| 12 | #include <ksycocaentry_p.h> |
| 13 | |
| 14 | #include <QStringList> |
| 15 | |
| 16 | class KServiceGroupPrivate : public KSycocaEntryPrivate |
| 17 | { |
| 18 | public: |
| 19 | K_SYCOCATYPE(KST_KServiceGroup, KSycocaEntryPrivate) |
| 20 | |
| 21 | explicit KServiceGroupPrivate(const QString &path) |
| 22 | : KSycocaEntryPrivate(path) |
| 23 | , m_bNoDisplay(false) |
| 24 | , m_bShowEmptyMenu(false) |
| 25 | , m_bShowInlineHeader(false) |
| 26 | , m_bInlineAlias(false) |
| 27 | , m_bAllowInline(false) |
| 28 | , m_inlineValue(4) |
| 29 | , m_bDeep(false) |
| 30 | , m_childCount(-1) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | KServiceGroupPrivate(QDataStream &str, int offset) |
| 35 | : KSycocaEntryPrivate(str, offset) |
| 36 | , m_bNoDisplay(false) |
| 37 | , m_bShowEmptyMenu(false) |
| 38 | , m_bShowInlineHeader(false) |
| 39 | , m_bInlineAlias(false) |
| 40 | , m_bAllowInline(false) |
| 41 | , m_inlineValue(4) |
| 42 | , m_bDeep(false) |
| 43 | , m_childCount(-1) |
| 44 | |
| 45 | { |
| 46 | } |
| 47 | |
| 48 | void save(QDataStream &s) override; |
| 49 | |
| 50 | QString name() const override |
| 51 | { |
| 52 | return path; |
| 53 | } |
| 54 | |
| 55 | void load(const QString &cfg); |
| 56 | void load(QDataStream &s); |
| 57 | |
| 58 | int childCount() const; |
| 59 | |
| 60 | KServiceGroup::List entries(KServiceGroup *group, bool sort, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName); |
| 61 | /*! |
| 62 | * This function parse attributes into menu |
| 63 | */ |
| 64 | void parseAttribute(const QString &item, bool &, bool &showInline, bool &, bool &showInlineAlias, int &inlineValue); |
| 65 | |
| 66 | bool m_bNoDisplay : 1; |
| 67 | bool : 1; |
| 68 | bool : 1; |
| 69 | bool m_bInlineAlias : 1; |
| 70 | bool m_bAllowInline : 1; |
| 71 | int m_inlineValue; |
| 72 | QStringList suppressGenericNames; |
| 73 | QString directoryEntryPath; |
| 74 | QStringList sortOrder; |
| 75 | QString m_strCaption; |
| 76 | QString m_strIcon; |
| 77 | QString ; |
| 78 | |
| 79 | KServiceGroup::List m_serviceList; |
| 80 | bool m_bDeep; |
| 81 | QString m_strBaseGroupName; |
| 82 | mutable int m_childCount; |
| 83 | }; |
| 84 | |
| 85 | class KServiceSeparator : public KSycocaEntry // krazy:exclude=dpointer (dummy class) |
| 86 | { |
| 87 | public: |
| 88 | typedef QExplicitlySharedDataPointer<KServiceSeparator> Ptr; |
| 89 | |
| 90 | public: |
| 91 | /*! |
| 92 | * Construct a service separator |
| 93 | */ |
| 94 | KServiceSeparator(); |
| 95 | ~KServiceSeparator() override; |
| 96 | }; |
| 97 | |
| 98 | #endif |
| 99 | |