kio Library API Documentation

KServiceGroup Class Reference

This class is typically used like this:. More...

#include <kservicegroup.h>

Inheritance diagram for KServiceGroup:

KSycocaEntry KShared List of all members.

Public Methods

 KServiceGroup (const QString &name)
 Construct a dummy servicegroup indexed with name
Since:
3.1.


 KServiceGroup (const QString &_fullpath, const QString &_relpath)
 Construct a service and take all informations from a config file.

bool isValid () const
virtual QString name () const
 Name used for indexing.

QString caption () const
QString icon () const
QString comment () const
int childCount ()
bool noDisplay () const
virtual List entries (bool sorted, bool excludeNoDisplay)
 List of all Services and ServiceGroups within this ServiceGroup.

virtual List entries (bool sorted=false)
 As above with excludeNoDisplay true.

QString baseGroupName () const

Static Public Methods

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

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.

Definition at line 40 of file kservicegroup.cpp.

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

Definition at line 47 of file kservicegroup.cpp.

References QString::findRev(), QString::isEmpty(), QString::left(), QString::length(), QString::mid(), and QString::right().


Member Function Documentation

bool KServiceGroup::isValid   const [inline]
 

Returns:
true

Definition at line 97 of file kservicegroup.h.

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

Name used for indexing.

Definition at line 102 of file kservicegroup.h.

References KSycocaEntry::entryPath().

Referenced by entries().

QString KServiceGroup::caption   const [inline]
 

Returns:
the caption of this group

Definition at line 108 of file kservicegroup.h.

QString KServiceGroup::icon   const [inline]
 

Returns:
the icon associated with the group.

Definition at line 113 of file kservicegroup.h.

QString KServiceGroup::comment   const [inline]
 

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

Definition at line 118 of file kservicegroup.h.

int KServiceGroup::childCount  
 

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

Definition at line 93 of file kservicegroup.cpp.

References QValueList< SPtr >::begin(), QValueList< SPtr >::end(), and KService::noDisplay().

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

Definition at line 120 of file kservicegroup.cpp.

Referenced by entries().

KServiceGroup::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"

Definition at line 202 of file kservicegroup.cpp.

References QValueList< SPtr >::append(), QValueList< SPtr >::begin(), QValueList< SPtr >::end(), QString::findRev(), QString::fromUtf8(), KSortableValueList< T, Key >::insert(), KStdAccel::key(), QString::length(), QString::local8Bit(), m_serviceList, QString::mid(), KSycocaEntry::name(), name(), KService::noDisplay(), noDisplay(), QValueList< SPtr >::remove(), QCString::resize(), KSortableValueList< T, Key >::sort(), and QString::truncate().

Referenced by entries().

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

As above with excludeNoDisplay true.

Definition at line 196 of file kservicegroup.cpp.

References entries().

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.

KServiceGroup::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.

Definition at line 331 of file kservicegroup.cpp.

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

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

Definition at line 350 of file kservicegroup.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:37 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001