KServiceGroup Class Reference
KServiceGroup represents a group of service, for example screensavers. Represents a group of services. More...
#include <kservicegroup.h>
Inheritance diagram for KServiceGroup:


Public Types | |
typedef KSharedPtr< KServiceGroup > | Ptr |
typedef KSharedPtr< KSycocaEntry > | SPtr |
typedef QValueList< SPtr > | List |
Public Member Functions | |
KServiceGroup (const QString &name) | |
KServiceGroup (const QString &_fullpath, const QString &_relpath) | |
KServiceGroup (QDataStream &_str, int offset, bool deep) | |
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 |
bool | showEmptyMenu () const |
void | setShowEmptyMenu (bool b) |
bool | showInlineHeader () const |
void | setShowInlineHeader (bool _b) |
bool | inlineAlias () const |
void | setInlineAlias (bool _b) |
bool | allowInline () const |
void | setAllowInline (bool _b) |
int | inlineValue () const |
void | setInlineValue (int _val) |
QStringList | suppressGenericNames () const |
void | setLayoutInfo (const QStringList &layout) |
QStringList | layoutInfo () const |
virtual void | load (QDataStream &) |
virtual void | save (QDataStream &) |
List | entries (bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName=false) |
virtual List | entries (bool sorted, bool excludeNoDisplay) |
virtual List | entries (bool sorted=false) |
QString | baseGroupName () const |
QString | directoryEntryPath () const |
void | parseAttribute (const QString &item, bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool &showInlineAlias, int &inlineValue) |
Static Public Member Functions | |
Ptr | baseGroup (const QString &baseGroupName) |
Ptr | root () |
Ptr | group (const QString &relPath) |
Ptr | childGroup (const QString &parent) |
Protected Member Functions | |
void | addEntry (KSycocaEntry *entry) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
QString | m_strCaption |
QString | m_strIcon |
QString | m_strComment |
List | m_serviceList |
bool | m_bDeep |
QString | m_strBaseGroupName |
int | m_childCount |
Friends | |
class | KBuildServiceGroupFactory |
Detailed Description
KServiceGroup represents a group of service, for example screensavers. Represents a group of services.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\n", s->name().latin1()); } else if (p->isType(KST_KServiceGroup)) { KServiceGroup *g = static_cast<KServiceGroup *>(p); // Sub group ... } }
Definition at line 67 of file kservicegroup.h.
Constructor & Destructor Documentation
|
Construct a dummy servicegroup indexed with
Definition at line 48 of file kservicegroup.cpp. |
|
Construct a service and take all informations from a config file.
Definition at line 55 of file kservicegroup.cpp. References KConfigBase::hasKey(), kdDebug(), KConfigBase::readBoolEntry(), KConfigBase::readEntry(), KConfigBase::readListEntry(), and KConfigBase::setDesktopGroup(). |
Member Function Documentation
|
Checks whether the entry is valid, returns always true.
Implements KSycocaEntry. Definition at line 103 of file kservicegroup.h. |
|
Name used for indexing.
Implements KSycocaEntry. Definition at line 109 of file kservicegroup.h. References KSycocaEntry::entryPath(). |
|
Returns the relative path of the service group.
Definition at line 115 of file kservicegroup.h. References KSycocaEntry::entryPath(). Referenced by entries(). |
|
Returns the caption of this group.
Definition at line 121 of file kservicegroup.h. |
|
Returns the name of the icon associated with the group.
Definition at line 128 of file kservicegroup.h. |
|
Returns the comment about this service group.
Definition at line 135 of file kservicegroup.h. |
|
Returns the total number of displayable services in this group and any of its subgroups.
Definition at line 120 of file kservicegroup.cpp. References KSycocaEntry::isType(), and KService::noDisplay(). |
|
Returns true if the NoDisplay flag was set, i.e. if this group should be hidden from menus, while still being in ksycoca.
Definition at line 197 of file kservicegroup.cpp. Referenced by entries(). |
|
Return true if we want to display empty menu entry.
Definition at line 152 of file kservicegroup.cpp. Referenced by entries(). |
|
Definition at line 147 of file kservicegroup.cpp. Referenced by entries(). |
|
Returns a list of untranslated generic names that should be be supressed when showing this group. E.g. The group "Games/Arcade" might want to suppress the generic name "Arcade Game" since it's redundant in this particular context.
Definition at line 202 of file kservicegroup.cpp. |
|
List of all Services and ServiceGroups within this ServiceGroup.
Definition at line 314 of file kservicegroup.cpp. References group(), KSortableValueList< T, Key >::insert(), KSycocaEntry::isType(), KSycocaEntry::List, m_serviceList, KService::menuId(), KSycocaEntry::name(), KService::noDisplay(), noDisplay(), relPath(), setAllowInline(), setInlineAlias(), setInlineValue(), setShowEmptyMenu(), setShowInlineHeader(), showEmptyMenu(), showInlineHeader(), and KSortableValueList< T, Key >::sort(). Referenced by entries(). |
|
List of all Services and ServiceGroups within this ServiceGroup.
Definition at line 294 of file kservicegroup.cpp. References entries(). |
|
Returns a 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 242 of file kservicegroup.h. |
|
Returns a path to the .directory file describing this service group. The path is either absolute or relative to the "apps" resource.
Definition at line 665 of file kservicegroup.cpp. |
|
Returns the group for the given baseGroupName. Can return 0L if the directory (or the .directory file) was deleted.
Definition at line 640 of file kservicegroup.cpp. |
|
Returns the root service group.
Definition at line 646 of file kservicegroup.cpp. Referenced by group(). |
|
Returns the group with the given relative path.
Definition at line 652 of file kservicegroup.cpp. References root(). Referenced by entries(). |
|
Returns the group of services that have X-KDE-ParentApp equal to
Definition at line 659 of file kservicegroup.cpp. |
The documentation for this class was generated from the following files: