KServiceGroup Class Reference
#include <kservicegroup.h>
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.
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) | |
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 |
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 | |
static Ptr | baseGroup (const QString &baseGroupName) |
static Ptr | root () |
static Ptr | group (const QString &relPath) |
static 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 |
Constructor & Destructor Documentation
|
Construct a dummy servicegroup indexed with
Definition at line 46 of file kservicegroup.cpp. |
|
Construct a service and take all informations from a config file.
Definition at line 54 of file kservicegroup.cpp. |
Member Function Documentation
|
Definition at line 186 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 637 of file kservicegroup.cpp. |
|
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 251 of file kservicegroup.h. |
|
Returns the caption of this group.
Definition at line 121 of file kservicegroup.h. |
|
Returns the total number of displayable services in this group and any of its subgroups.
Definition at line 119 of file kservicegroup.cpp. |
|
Returns the group of services that have X-KDE-ParentApp equal to
Definition at line 656 of file kservicegroup.cpp. |
|
Returns the comment about this service group.
Definition at line 135 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 662 of file kservicegroup.cpp. |
|
List of all Services and ServiceGroups within this ServiceGroup.
Definition at line 293 of file kservicegroup.cpp. |
|
List of all Services and ServiceGroups within this ServiceGroup.
Definition at line 313 of file kservicegroup.cpp. |
|
Returns the group with the given relative path.
Definition at line 649 of file kservicegroup.cpp. |
|
Returns the name of the icon associated with the group.
Definition at line 128 of file kservicegroup.h. |
|
Definition at line 156 of file kservicegroup.cpp. |
|
Definition at line 176 of file kservicegroup.cpp. |
|
Checks whether the entry is valid, returns always true.
Definition at line 103 of file kservicegroup.h. |
|
Name used for indexing.
Definition at line 109 of file kservicegroup.h. |
|
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 196 of file kservicegroup.cpp. |
|
This function parse attributes into menu.
Definition at line 593 of file kservicegroup.cpp. |
|
Returns the relative path of the service group.
Definition at line 115 of file kservicegroup.h. |
|
Returns the root service group.
Definition at line 643 of file kservicegroup.cpp. |
|
Return true if we want to display empty menu entry.
Definition at line 151 of file kservicegroup.cpp. |
|
Definition at line 146 of file kservicegroup.cpp. |
|
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 201 of file kservicegroup.cpp. |
The documentation for this class was generated from the following files: