1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1998, 1999 Torben Weis <weis@kde.org>
4 SPDX-FileCopyrightText: 1999-2006 David Faure <faure@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KSERVICEPRIVATE_H
10#define KSERVICEPRIVATE_H
11
12#include "kservice.h"
13#include <QList>
14
15#include <ksycocaentry_p.h>
16
17class KServicePrivate : public KSycocaEntryPrivate
18{
19public:
20 K_SYCOCATYPE(KST_KService, KSycocaEntryPrivate)
21
22 explicit KServicePrivate(const QString &path)
23 : KSycocaEntryPrivate(path)
24 , m_bValid(true)
25 {
26 }
27 KServicePrivate(QDataStream &_str, int _offset)
28 : KSycocaEntryPrivate(_str, _offset)
29 , m_bValid(true)
30 {
31 load(_str);
32 }
33 KServicePrivate(const KServicePrivate &other) = default;
34
35 void init(const KDesktopFile *config, KService *q);
36
37 void parseActions(const KDesktopFile *config, KService *q);
38 void load(QDataStream &);
39 void save(QDataStream &) override;
40
41 QString name() const override
42 {
43 return m_strName;
44 }
45
46 QString storageId() const override
47 {
48 if (!menuId.isEmpty()) {
49 return menuId;
50 }
51 return path;
52 }
53
54 bool isValid() const override
55 {
56 return m_bValid;
57 }
58
59 QVariant property(const QString &_name, QMetaType::Type t) const;
60
61 QStringList categories;
62 QString menuId;
63 QString m_strType;
64 QString m_strName;
65 QString m_strExec;
66 QString m_strIcon;
67 QString m_strTerminalOptions;
68 QString m_strWorkingDirectory;
69 QString m_strComment;
70 QString m_strLibrary;
71 QStringList m_mimeTypes;
72 QString m_strDesktopEntryName;
73 QMap<QString, QVariant> m_mapProps;
74 QStringList m_lstFormFactors;
75 QStringList m_lstKeywords;
76 QString m_strGenName;
77 QString m_untranslatedGenericName;
78 QString m_untranslatedName;
79 QList<KServiceAction> m_actions;
80 bool m_bAllowAsDefault : 1;
81 bool m_bTerminal : 1;
82 bool m_bValid : 1;
83};
84#endif
85

source code of kservice/src/services/kservice_p.h