KDECore
kservicegroup.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KSERVICEGROUP_H
00020 #define KSERVICEGROUP_H
00021
00022 #include <kdecore_export.h>
00023 #include <ksycocaentry.h>
00024 #include <kservice.h>
00025
00026 class KBuildServiceGroupFactory;
00027
00028 class KServiceGroupPrivate;
00029
00062 class KDECORE_EXPORT KServiceGroup : public KSycocaEntry
00063 {
00064 friend class KBuildServiceGroupFactory;
00065 public:
00066 typedef KSharedPtr<KServiceGroup> Ptr;
00067 typedef KSharedPtr<KSycocaEntry> SPtr;
00068 typedef QList<SPtr> List;
00069 public:
00074 KServiceGroup( const QString & name );
00075
00081 KServiceGroup( const QString & _fullpath, const QString & _relpath );
00082
00087 KServiceGroup( QDataStream& _str, int offset, bool deep );
00088
00089 virtual ~KServiceGroup();
00090
00095 QString relPath() const;
00096
00101 QString caption() const;
00102
00108 QString icon() const;
00109
00115 QString comment() const;
00116
00122 int childCount() const;
00123
00129 bool noDisplay() const;
00130
00135 bool showEmptyMenu() const;
00136 void setShowEmptyMenu( bool b);
00137
00141 bool showInlineHeader() const;
00142 void setShowInlineHeader(bool _b);
00143
00147 bool inlineAlias() const;
00148 void setInlineAlias(bool _b);
00152 bool allowInline() const;
00153 void setAllowInline(bool _b);
00154
00158 int inlineValue() const;
00159 void setInlineValue(int _val);
00160
00161
00168 QStringList suppressGenericNames() const;
00169
00174 void setLayoutInfo(const QStringList &layout);
00175
00180 QStringList layoutInfo() const;
00181
00191 List entries(bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName=false);
00192 List entries(bool sorted, bool excludeNoDisplay);
00193
00200 List entries(bool sorted = false);
00201
00205 enum EntriesOption
00206 {
00207 NoOptions = 0x0,
00208 SortEntries = 0x1,
00209 ExcludeNoDisplay = 0x2,
00210 AllowSeparators = 0x4,
00211 SortByGenericName = 0x8
00212 };
00213 Q_DECLARE_FLAGS(EntriesOptions, EntriesOption)
00214
00215
00218 QList<Ptr> groupEntries(EntriesOptions options = ExcludeNoDisplay);
00219
00223 KService::List serviceEntries(EntriesOptions options = ExcludeNoDisplay);
00224
00235 QString baseGroupName() const;
00236
00241 QString directoryEntryPath() const;
00242
00252 static KDE_DEPRECATED Ptr baseGroup( const QString &baseGroupName );
00253
00258 static Ptr root();
00259
00265 static Ptr group(const QString &relPath);
00266
00273 static Ptr childGroup(const QString &parent);
00274
00275 protected:
00280 void addEntry( const KSycocaEntry::Ptr& entry);
00281 private:
00282 Q_DECLARE_PRIVATE(KServiceGroup)
00283 };
00284
00285 #endif