KService

kservicegroup.h
1 /* This file is part of the KDE project
2  Copyright (C) 2000 Waldo Bastian <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef KSERVICEGROUP_H
20 #define KSERVICEGROUP_H
21 
22 #include <kservice_export.h>
23 #include <kservice.h>
24 
25 class KBuildServiceGroupFactory;
26 
27 class KServiceGroupPrivate;
28 
63 class KSERVICE_EXPORT KServiceGroup : public KSycocaEntry
64 {
65  friend class KBuildServiceGroupFactory;
66 public:
78  typedef QList<SPtr> List;
79 public:
84  KServiceGroup(const QString &name);
85 
91  KServiceGroup(const QString &_fullpath, const QString &_relpath);
92 
93  virtual ~KServiceGroup();
94 
99  QString relPath() const;
100 
105  QString caption() const;
106 
112  QString icon() const;
113 
119  QString comment() const;
120 
126  int childCount() const;
127 
133  bool noDisplay() const;
134 
139  bool showEmptyMenu() const;
140  void setShowEmptyMenu(bool b);
141 
145  bool showInlineHeader() const;
146  void setShowInlineHeader(bool _b);
147 
151  bool inlineAlias() const;
152  void setInlineAlias(bool _b);
156  bool allowInline() const;
157  void setAllowInline(bool _b);
158 
162  int inlineValue() const;
163  void setInlineValue(int _val);
164 
171  QStringList suppressGenericNames() const;
172 
177  void setLayoutInfo(const QStringList &layout);
178 
183  QStringList layoutInfo() const;
184 
194  List entries(bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName = false);
195  List entries(bool sorted, bool excludeNoDisplay);
196 
203  List entries(bool sorted = false);
204 
210  NoOptions = 0x0,
211  SortEntries = 0x1,
212  ExcludeNoDisplay = 0x2,
213  AllowSeparators = 0x4,
214  SortByGenericName = 0x8
215  };
219  Q_DECLARE_FLAGS(EntriesOptions, EntriesOption)
220 
221 
224  QList<Ptr> groupEntries(EntriesOptions options = ExcludeNoDisplay);
225 
229  KService::List serviceEntries(EntriesOptions options = ExcludeNoDisplay);
230 
241  QString baseGroupName() const;
242 
247  QString directoryEntryPath() const;
248 
253  static Ptr root();
254 
260  static Ptr group(const QString &relPath);
261 
268  static Ptr childGroup(const QString &parent);
269 
270 protected:
275  void addEntry(const KSycocaEntry::Ptr &entry);
276 
277 private:
278  friend class KServiceGroupFactory;
283  KServiceGroup(QDataStream &_str, int offset, bool deep);
284 
285  Q_DECLARE_PRIVATE(KServiceGroup)
286 };
287 
288 #endif
EntriesOption
options for groupEntries and serviceEntries
KServiceGroup represents a group of service, for example screensavers.
Definition: kservicegroup.h:63
QExplicitlySharedDataPointer< KSycocaEntry > SPtr
A shared data pointer for KSycocaEntry.
Definition: kservicegroup.h:74
Represent a service, like an application or plugin bound to one or several mimetypes (or servicetypes...
Definition: kservice.h:57
QExplicitlySharedDataPointer< KServiceGroup > Ptr
A shared data pointer for KServiceGroup.
Definition: kservicegroup.h:70
Base class for all Sycoca entries.
Definition: ksycocaentry.h:41
QList< SPtr > List
A list of shared data pointers for KSycocaEntry.
Definition: kservicegroup.h:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 5 2020 22:45:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.