Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KServiceGroup Class Reference

#include <kservicegroup.h>

Inheritance diagram for KServiceGroup:

KSycocaEntry KShared List of all members.

Public Types

typedef KSharedPtr< KServiceGroup > Ptr
typedef QValueList< SPtr > List

Public Methods

 KServiceGroup (const QString &name)
 KServiceGroup (const QString &_fullpath, const QString &_relpath)
bool isValid () const
virtual QString name () const
QString caption () const
QString icon () const
QString comment () const
int childCount ()
bool noDisplay () const
virtual void load (QDataStream &)
virtual void save (QDataStream &)
virtual List entries (bool sorted, bool excludeNoDisplay)
virtual List entries (bool sorted=false)
QString baseGroupName () const

Static Public Methods

Ptr baseGroup (const QString &baseGroupName)
Ptr childGroup (const QString &parent)

Protected Methods

virtual void virtual_hook (int id, void *data)

Detailed Description

This class is typically used like this:

// Lookup screensaver group KServiceGroup::Ptr group = KServiceGroup::baseGroup("screensavers"); if (!group || !group->isValid()) return;

KServiceGroup::List list = group->entries();

// Iterate over all entries in the group for( KServiceGroup::List::ConstIterator it = list.begin(); it != list.end(); it++) { KSycocaEntry *p = (*it); if (p->isType(KST_KService)) { KService *s = static_cast<KService *>(p); printf("Name = s
", s->name().latin1()); } else if (p->isType(KST_KServiceGroup)) { KServiceGroup *g = static_cast<KServiceGroup *>(p); // Sub group ... } }

Definition at line 63 of file kservicegroup.h.


Constructor & Destructor Documentation

KServiceGroup::KServiceGroup const QString &    name
 

Construct a dummy servicegroup indexed with name

Since:
3.1

KServiceGroup::KServiceGroup const QString &    _fullpath,
const QString &    _relpath
 

Construct a service and take all informations from a config file

Parameters:
_fullpath  full path to the config file
_relpath  relative path to the config file


Member Function Documentation

Ptr KServiceGroup::baseGroup const QString &    baseGroupName [static]
 

Returns:
the group for the given baseGroupName Can return 0L if the directory (or the .directory file) was deleted.

QString KServiceGroup::baseGroupName   const [inline]
 

Returns:
non-empty string if the group is a special base group. By default, "Settings/" is the kcontrol base group ("settings") and "System/Screensavers/" is the screensavers base group ("screensavers"). This allows moving the groups without breaking those apps.
The base group is defined by the X-KDE-BaseGroup key in the .directory file.

Definition at line 165 of file kservicegroup.h.

QString KServiceGroup::caption   const [inline]
 

Returns:
the caption of this group

Definition at line 108 of file kservicegroup.h.

int KServiceGroup::childCount  
 

Returns:
the total number of displayable services in this group and any of its subgroups.

Ptr KServiceGroup::childGroup const QString &    parent [static]
 

Returns:
the group of services that have X-KDE-ParentApp equal to parent
Since:
3.1

QString KServiceGroup::comment   const [inline]
 

Returns:
the descriptive comment for the group, if there is one.

Definition at line 118 of file kservicegroup.h.

virtual List KServiceGroup::entries bool    sorted = false [virtual]
 

As above with excludeNoDisplay true.

virtual List KServiceGroup::entries bool    sorted,
bool    excludeNoDisplay
[virtual]
 

List of all Services and ServiceGroups within this ServiceGroup

Parameters:
sorted  indicates whether to sort items
whether  to include items marked "NoDisplay"

QString KServiceGroup::icon   const [inline]
 

Returns:
the icon associated with the group.

Definition at line 113 of file kservicegroup.h.

bool KServiceGroup::isValid   const [inline, virtual]
 

Returns:
true

Implements KSycocaEntry.

Definition at line 97 of file kservicegroup.h.

virtual QString KServiceGroup::name   const [inline, virtual]
 

Name used for indexing.

Implements KSycocaEntry.

Definition at line 102 of file kservicegroup.h.

References KSycocaEntry::entryPath().

bool KServiceGroup::noDisplay  
 

Returns:
true if the NoDisplay flag was set, i.e. if this group should be hidden from menus, while still being in ksycoca.
Since:
3.1


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:23 2003 for kdelibs by doxygen1.2.18