19 #ifndef __kservicegroup_h__
20 #define __kservicegroup_h__
22 #include <tqptrlist.h>
25 #include <tqdatastream.h>
26 #include <tqvariant.h>
28 #include <kdesktopfile.h>
29 #include <ksortablevaluelist.h>
31 #include "tdesycocaentry.h"
32 #include "tdesycocatype.h"
35 class KBuildServiceGroupFactory;
70 friend class KBuildServiceGroupFactory;
71 K_SYCOCATYPE( KST_KServiceGroup, KSycocaEntry )
74 typedef TDESharedPtr<KServiceGroup> Ptr;
75 typedef TDESharedPtr<KSycocaEntry> SPtr;
76 typedef TQValueList<SPtr> List;
90 KServiceGroup(
const TQString & _fullpath,
const TQString & _relpath );
110 virtual TQString
name()
const {
return entryPath(); }
116 virtual TQString
relPath()
const {
return entryPath(); }
122 TQString
caption()
const {
return m_strCaption; }
129 TQString
icon()
const {
return m_strIcon; }
136 TQString
comment()
const {
return m_strComment; }
151 bool noDisplay()
const;
158 bool showEmptyMenu()
const;
159 void setShowEmptyMenu(
bool b);
165 bool showInlineHeader()
const;
166 void setShowInlineHeader(
bool _b);
172 bool inlineAlias()
const;
173 void setInlineAlias(
bool _b);
178 bool allowInline()
const;
179 void setAllowInline(
bool _b);
185 int inlineValue()
const;
186 void setInlineValue(
int _val);
196 TQStringList suppressGenericNames()
const;
202 void setLayoutInfo(
const TQStringList &layout);
207 bool SuSEshortMenu()
const;
208 bool SuSEgeneralDescription()
const;
214 TQStringList layoutInfo()
const;
220 virtual void load( TQDataStream& );
225 virtual void save( TQDataStream& );
237 List entries(
bool sorted,
bool excludeNoDisplay,
bool allowSeparators,
bool sortByGenericName=
false);
238 virtual List entries(
bool sorted,
bool excludeNoDisplay);
246 virtual List entries(
bool sorted =
false);
251 virtual List SuSEentries(
bool sort,
bool excludeNoDisplay,
bool allowSeparators,
bool sortByGenericName,
bool excludeSuSEunimportant =
false);
252 virtual List SuSEsortEntries( KSortableValueList<SPtr,TQCString> slist, KSortableValueList<SPtr,TQCString> glist,
bool excludeNoDisplay,
bool allowSeparators );
271 TQString directoryEntryPath()
const;
278 static Ptr baseGroup(
const TQString &baseGroupName );
291 static Ptr group(
const TQString &relPath);
300 static Ptr childGroup(
const TQString &parent);
306 void parseAttribute(
const TQString &item ,
bool &showEmptyMenu,
bool &showInline,
bool &showInlineHeader,
bool & showInlineAlias ,
int &inlineValue );
313 void addEntry( KSycocaEntry *entry);
315 TQString m_strCaption;
317 TQString m_strComment;
321 TQString m_strBaseGroupName;
324 virtual void virtual_hook(
int id,
void* data );
330 class TDEIO_EXPORT KServiceSeparator :
public KSycocaEntry
332 K_SYCOCATYPE( KST_KServiceSeparator, KSycocaEntry )
335 typedef TDESharedPtr<KServiceSeparator> Ptr;
343 bool isValid()
const {
return true; }
346 virtual TQString name()
const {
return "separator"; }
348 virtual void load( TQDataStream& ) { };
350 virtual void save( TQDataStream& ) { };
KServiceGroup represents a group of service, for example screensavers.
TQString comment() const
Returns the comment about this service group.
TQString baseGroupName() const
Returns a non-empty string if the group is a special base group.
TQString caption() const
Returns the caption of this group.
virtual TQString name() const
Name used for indexing.
TQString icon() const
Returns the name of the icon associated with the group.
virtual TQString relPath() const
Returns the relative path of the service group.
bool isValid() const
Checks whether the entry is valid, returns always true.