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
00061 class KDECORE_EXPORT KServiceGroup : public KSycocaEntry
00062 {
00063 friend class KBuildServiceGroupFactory;
00064 public:
00065 typedef KSharedPtr<KServiceGroup> Ptr;
00066 typedef KSharedPtr<KSycocaEntry> SPtr;
00067 typedef QList<SPtr> List;
00068 public:
00073 KServiceGroup( const QString & name );
00074
00080 KServiceGroup( const QString & _fullpath, const QString & _relpath );
00081
00086 KServiceGroup( QDataStream& _str, int offset, bool deep );
00087
00088 virtual ~KServiceGroup();
00089
00094 QString relPath() const;
00095
00100 QString caption() const;
00101
00107 QString icon() const;
00108
00114 QString comment() const;
00115
00121 int childCount() const;
00122
00128 bool noDisplay() const;
00129
00134 bool showEmptyMenu() const;
00135 void setShowEmptyMenu( bool b);
00136
00140 bool showInlineHeader() const;
00141 void setShowInlineHeader(bool _b);
00142
00146 bool inlineAlias() const;
00147 void setInlineAlias(bool _b);
00151 bool allowInline() const;
00152 void setAllowInline(bool _b);
00153
00157 int inlineValue() const;
00158 void setInlineValue(int _val);
00159
00160
00167 QStringList suppressGenericNames() const;
00168
00173 void setLayoutInfo(const QStringList &layout);
00174
00179 QStringList layoutInfo() const;
00180
00190 List entries(bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName=false);
00191 List entries(bool sorted, bool excludeNoDisplay);
00192
00199 List entries(bool sorted = false);
00200
00204 enum EntriesOption
00205 {
00206 NoOptions = 0x0,
00207 SortEntries = 0x1,
00208 ExcludeNoDisplay = 0x2,
00209 AllowSeparators = 0x4,
00210 SortByGenericName = 0x8
00211 };
00212 Q_DECLARE_FLAGS(EntriesOptions, EntriesOption)
00213
00214
00217 QList<Ptr> groupEntries(EntriesOptions options = ExcludeNoDisplay);
00218
00222 KService::List serviceEntries(EntriesOptions options = ExcludeNoDisplay);
00223
00234 QString baseGroupName() const;
00235
00240 QString directoryEntryPath() const;
00241
00247 static Ptr baseGroup( const QString &baseGroupName );
00248
00253 static Ptr root();
00254
00260 static Ptr group(const QString &relPath);
00261
00268 static Ptr childGroup(const QString &parent);
00269
00270 protected:
00275 void addEntry( const KSycocaEntry::Ptr& entry);
00276 private:
00277 Q_DECLARE_PRIVATE(KServiceGroup)
00278 };
00279
00280 #endif