class KServiceGroup

# class KServiceGroup | This class is typically used like this: More...
Definition | `#include <kservicegroup.h>`
Inherits | KSycocaEntry (kdecore) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- typedef KSharedPtr Ptr
- typedef KSharedPtr SPtr
- typedef QValueList List

#### Public Methods

- KServiceGroup ( const QString & name )
- KServiceGroup ( const QString & _fullpath, const QString & _relpath )
- KServiceGroup ( QDataStream& _str, int offset, bool deep )
- virtual ~KServiceGroup ()
- bool isValid () const
- virtual QString name () const
- virtual QString relPath () 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

#### Public Static Methods

- static Ptr baseGroup ( const QString &baseGroupName )
- static Ptr root ()
- static Ptr group (const QString &relPath)
- static Ptr childGroup (const QString &parent)

#### Protected Methods

- void addEntry ( KSycocaEntry *entry)
- virtual void virtual_hook ( int id, void* data )

#### Protected Members

- QString m_strCaption
- QString m_strIcon
- QString m_strComment
- List m_serviceList
- bool m_bDeep
- QString m_strBaseGroupName
- int m_childCount

## 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(p); printf("Name = %s\n", s->name().latin1()); } else if (p->isType(KST_KServiceGroup)) { KServiceGroup *g = static_cast(p); // Sub group ... } }

typedef KSharedPtr<KServiceGroup> Ptr | ### Ptr

typedef KSharedPtr<KSycocaEntry> SPtr | ### SPtr

typedef QValueList List | ### List

KServiceGroup ( const QString & name ) | ### KServiceGroup

Construct a dummy servicegroup indexed with `name`

KServiceGroup ( const QString & _fullpath, const QString & _relpath ) | ### KServiceGroup

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

KServiceGroup ( QDataStream& _str, int offset, bool deep ) | ### KServiceGroup

The stream must already be positionned at the correct offset

~KServiceGroup () | ### ~KServiceGroup

[virtual]

bool isValid () | ### isValid

[const]

Returns: true

Reimplemented from KSycocaEntry.

QString name () | ### name

[const virtual]

Name used for indexing.

Reimplemented from KSycocaEntry.

QString relPath () | ### relPath

[const virtual]

QString caption () | ### caption

[const]

Returns: the caption of this group

QString icon () | ### icon

[const]

Returns: the icon associated with the group.

QString comment () | ### comment

[const]

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

int childCount () | ### childCount

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

bool noDisplay () | ### noDisplay

[const]

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

void load ( QDataStream& ) | ### load

[virtual]

Load the service from a stream.

Reimplemented from KSycocaEntry.

void save ( QDataStream& ) | ### save

[virtual]

Save the service to a stream.

Reimplemented from KSycocaEntry.

List entries (bool sorted, bool excludeNoDisplay) | ### entries

[virtual]

List of all Services and ServiceGroups within this ServiceGroup

Parameters:

sorted | indicates whether to sort items
whether | to include items marked "NoDisplay"

List entries (bool sorted = false) | ### entries

[virtual]

As above with excludeNoDisplay true.

QString baseGroupName () | ### baseGroupName

[const]

The base group is defined by the X-KDE-BaseGroup key in the .directory file.

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.

Ptr baseGroup ( const QString &baseGroupName ) | ### baseGroup

[static]

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

Ptr root () | ### root

[static]

Ptr group (const QString &relPath) | ### group

[static]

Ptr childGroup (const QString &parent) | ### childGroup

[static]

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

void addEntry ( KSycocaEntry *entry) | ### addEntry

[protected]

Add a service to this group

QString m_strCaption | ### m_strCaption

[protected]

QString m_strIcon | ### m_strIcon

[protected]

QString m_strComment | ### m_strComment

[protected]

List m_serviceList | ### m_serviceList

[protected]

bool m_bDeep | ### m_bDeep

[protected]

QString m_strBaseGroupName | ### m_strBaseGroupName

[protected]

int m_childCount | ### m_childCount

[protected]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

Reimplemented from KSycocaEntry.

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:57 2003, using kdoc 2.0a54.