kservicegroup.h
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 <qlist.h>
00023 #include <qstring.h>
00024 #include <qshared.h>
00025 #include <qdatastream.h>
00026 #include <qvariant.h>
00027
00028 #include <kdesktopfile.h>
00029
00030 #include "ksycocaentry.h"
00031 #include "ksycocatype.h"
00032 #include "kservice.h"
00033
00034 class KBuildServiceGroupFactory;
00035
00063 class KServiceGroup : public KSycocaEntry
00064 {
00065 friend class KBuildServiceGroupFactory;
00066 K_SYCOCATYPE( KST_KServiceGroup, KSycocaEntry )
00067
00068 public:
00069 typedef KSharedPtr<KServiceGroup> Ptr;
00070 typedef KSharedPtr<KSycocaEntry> SPtr;
00071 typedef QValueList<SPtr> List;
00072 public:
00077 KServiceGroup( const QString & name );
00078
00084 KServiceGroup( const QString & _fullpath, const QString & _relpath );
00085
00090 KServiceGroup( QDataStream& _str, int offset, bool deep );
00091
00092 virtual ~KServiceGroup();
00093
00097 bool isValid() const { return true; }
00098
00102 virtual QString name() const { return entryPath(); }
00103 virtual QString relPath() const { return entryPath(); }
00104
00108 QString caption() const { return m_strCaption; }
00109
00113 QString icon() const { return m_strIcon; }
00114
00118 QString comment() const { return m_strComment; }
00119
00124 int childCount();
00125
00131 bool noDisplay() const;
00132
00137 virtual void load( QDataStream& );
00142 virtual void save( QDataStream& );
00143
00150 virtual List entries(bool sorted, bool excludeNoDisplay);
00154 virtual List entries(bool sorted = false);
00155
00165 QString baseGroupName() const { return m_strBaseGroupName; }
00166
00171 static Ptr baseGroup( const QString &baseGroupName );
00172
00173 static Ptr root();
00174 static Ptr group(const QString &relPath);
00175
00181 static Ptr childGroup(const QString &parent);
00182
00183 protected:
00188 void addEntry( KSycocaEntry *entry);
00189
00190 QString m_strCaption;
00191 QString m_strIcon;
00192 QString m_strComment;
00193
00194 List m_serviceList;
00195 bool m_bDeep;
00196 QString m_strBaseGroupName;
00197 int m_childCount;
00198 protected:
00199 virtual void virtual_hook( int id, void* data );
00200 private:
00201 class Private;
00202 Private* d;
00203 };
00204 #endif
This file is part of the documentation for kdelibs Version 3.1.0.