KService

kservicetype.h
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1998, 1999 Torben Weis <[email protected]>
4  SPDX-FileCopyrightText: 1999 Waldo Bastian <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef __kservicetype_h__
10 #define __kservicetype_h__
11 
12 #include <ksycocaentry.h>
13 
14 #include <QString>
15 #include <QStringList>
16 #include <QMap>
17 #include <QVariant>
18 
19 #include <KConfig>
20 
21 class KDesktopFile;
22 class KServiceTypePrivate;
23 
33 class KSERVICE_EXPORT KServiceType : public KSycocaEntry // TODO KDE5: inherit kshared, but move KSycocaEntry to KServiceTypePrivate
34 {
35 public:
43  typedef QList<Ptr> List;
44 
49  explicit KServiceType(KDesktopFile *config);
50 
51  virtual ~KServiceType();
52 
57  QString comment() const;
58 
64  bool isDerived() const;
65 
72  QString parentServiceType() const;
73 
78  bool inherits(const QString &servTypeName) const;
79 
87  QVariant::Type propertyDef(const QString &_name) const;
88 
102  QStringList propertyDefNames() const;
103 
105  QMap<QString, QVariant::Type> propertyDefs() const;
106 
111  Ptr parentType();
116  void setServiceOffersOffset(int offset);
120  int serviceOffersOffset() const;
121 
129  static Ptr serviceType(const QString &_name);
130 
139  static List allServiceTypes();
140 
141 private:
142  friend class KServiceTypeFactory;
147  KServiceType(QDataStream &_str, int offset);
148 
149  Q_DECLARE_PRIVATE(KServiceType)
150 };
151 
152 //QDataStream& operator>>( QDataStream& _str, KServiceType& s );
153 //QDataStream& operator<<( QDataStream& _str, KServiceType& s );
154 
155 #endif
A service type is, well, a type of service, where a service is an application or plugin.
Definition: kservicetype.h:33
Base class for all Sycoca entries.
Definition: ksycocaentry.h:30
QExplicitlySharedDataPointer< KServiceType > Ptr
A shared data pointer for KServiceType.
Definition: kservicetype.h:39
QList< Ptr > List
A list of shared data pointers for KServiceType.
Definition: kservicetype.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:47:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.