• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
KServiceGroup Class Reference

#include <kservicegroup.h>

Inherits KSycocaEntry.

Public Types

typedef TDESharedPtr< KServiceGroup > Ptr
 
typedef TDESharedPtr< KSycocaEntry > SPtr
 
typedef TQValueList< SPtr > List
 

Public Member Functions

 KServiceGroup (const TQString &name)
 
 KServiceGroup (const TQString &_fullpath, const TQString &_relpath)
 
 KServiceGroup (TQDataStream &_str, int offset, bool deep)
 
bool isValid () const
 
virtual TQString name () const
 
virtual TQString relPath () const
 
TQString caption () const
 
TQString icon () const
 
TQString 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)
 
TQStringList suppressGenericNames () const
 
void setLayoutInfo (const TQStringList &layout)
 
bool SuSEshortMenu () const
 
bool SuSEgeneralDescription () const
 
TQStringList layoutInfo () const
 
virtual void load (TQDataStream &)
 
virtual void save (TQDataStream &)
 
List entries (bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName=false)
 
virtual List entries (bool sorted, bool excludeNoDisplay)
 
virtual List entries (bool sorted=false)
 
virtual List SuSEentries (bool sort, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName, bool excludeSuSEunimportant=false)
 
virtual List SuSEsortEntries (KSortableValueList< SPtr, TQCString > slist, KSortableValueList< SPtr, TQCString > glist, bool excludeNoDisplay, bool allowSeparators)
 
TQString baseGroupName () const
 
TQString directoryEntryPath () const
 
void parseAttribute (const TQString &item, bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool &showInlineAlias, int &inlineValue)
 

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

TQString m_strCaption
 
TQString m_strIcon
 
TQString m_strComment
 
List m_serviceList
 
bool m_bDeep
 
TQString m_strBaseGroupName
 
int m_childCount
 

Friends

class KBuildServiceGroupFactory
 

Detailed Description

KServiceGroup represents a group of service, for example screensavers.

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 ...
}
}
KServiceGroup
KServiceGroup represents a group of service, for example screensavers.
Definition: kservicegroup.h:69
KServiceGroup::group
static Ptr group(const TQString &relPath)
Returns the group with the given relative path.
Definition: kservicegroup.cpp:708
KServiceGroup::baseGroup
static Ptr baseGroup(const TQString &baseGroupName)
Returns the group for the given baseGroupName.
Definition: kservicegroup.cpp:696
KService
Represent a service, i.e.
Definition: kservice.h:49
KService::name
virtual TQString name() const
Returns the name of the service.
Definition: kservice.h:98

Represents a group of services

Definition at line 68 of file kservicegroup.h.

Member Typedef Documentation

◆ List

typedef TQValueList<SPtr> KServiceGroup::List

Definition at line 76 of file kservicegroup.h.

◆ Ptr

typedef TDESharedPtr<KServiceGroup> KServiceGroup::Ptr

Definition at line 74 of file kservicegroup.h.

◆ SPtr

typedef TDESharedPtr<KSycocaEntry> KServiceGroup::SPtr

Definition at line 75 of file kservicegroup.h.

Constructor & Destructor Documentation

◆ KServiceGroup() [1/3]

KServiceGroup::KServiceGroup ( const TQString &  name)

Construct a dummy servicegroup indexed with name.

Parameters
namethe name of the service group
Since
3.1

Definition at line 51 of file kservicegroup.cpp.

◆ KServiceGroup() [2/3]

KServiceGroup::KServiceGroup ( const TQString &  _fullpath,
const TQString &  _relpath 
)

Construct a service and take all informations from a config file.

Parameters
_fullpathfull path to the config file
_relpathrelative path to the config file

Definition at line 59 of file kservicegroup.cpp.

◆ KServiceGroup() [3/3]

KServiceGroup::KServiceGroup ( TQDataStream &  _str,
int  offset,
bool  deep 
)

Definition at line 124 of file kservicegroup.cpp.

◆ ~KServiceGroup()

KServiceGroup::~KServiceGroup ( )
virtual

Definition at line 132 of file kservicegroup.cpp.

Member Function Documentation

◆ addEntry()

void KServiceGroup::addEntry ( KSycocaEntry *  entry)
protected

Definition at line 283 of file kservicegroup.cpp.

◆ allowInline()

bool KServiceGroup::allowInline ( ) const
Returns
true if we allow to inline menu.
Since
3.5

Definition at line 209 of file kservicegroup.cpp.

◆ baseGroup()

KServiceGroup::Ptr KServiceGroup::baseGroup ( const TQString &  baseGroupName)
static

Returns the group for the given baseGroupName.

Can return 0L if the directory (or the .directory file) was deleted.

Returns
the base group with the given name, or 0 if not available.

Definition at line 696 of file kservicegroup.cpp.

◆ baseGroupName()

TQString KServiceGroup::baseGroupName ( ) const
inline

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-TDE-BaseGroup key in the .directory file.

Returns
the base group name, or null if no base group

Definition at line 264 of file kservicegroup.h.

◆ caption()

TQString KServiceGroup::caption ( ) const
inline

Returns the caption of this group.

Returns
the caption of this group

Definition at line 122 of file kservicegroup.h.

◆ childCount()

int KServiceGroup::childCount ( )

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

Returns
the number of child services

Definition at line 137 of file kservicegroup.cpp.

◆ childGroup()

KServiceGroup::Ptr KServiceGroup::childGroup ( const TQString &  parent)
static

Returns the group of services that have X-TDE-ParentApp equal to parent (siblings).

Parameters
parentthe name of the service's parent
Returns
the services group
Since
3.1

Definition at line 715 of file kservicegroup.cpp.

◆ comment()

TQString KServiceGroup::comment ( ) const
inline

Returns the comment about this service group.

Returns
the descriptive comment for the group, if there is one, or TQString::null if not set

Definition at line 136 of file kservicegroup.h.

◆ directoryEntryPath()

TQString KServiceGroup::directoryEntryPath ( ) const

Returns a path to the .directory file describing this service group.

The path is either absolute or relative to the "apps" resource.

Since
3.2

Definition at line 721 of file kservicegroup.cpp.

◆ entries() [1/3]

KServiceGroup::List KServiceGroup::entries ( bool  sorted,
bool  excludeNoDisplay 
)
virtual

Definition at line 334 of file kservicegroup.cpp.

◆ entries() [2/3]

KServiceGroup::List KServiceGroup::entries ( bool  sorted,
bool  excludeNoDisplay,
bool  allowSeparators,
bool  sortByGenericName = false 
)

List of all Services and ServiceGroups within this ServiceGroup.

Parameters
sortedtrue to sort items
excludeNoDisplaytrue to exclude items marked "NoDisplay"
allowSeparatorstrue to allow separator items to be included
sortByGenericNametrue to sort GenericName+Name instead of Name+GenericName
Returns
the list of entries
Since
3.2

Definition at line 348 of file kservicegroup.cpp.

◆ entries() [3/3]

KServiceGroup::List KServiceGroup::entries ( bool  sorted = false)
virtual

List of all Services and ServiceGroups within this ServiceGroup.

Parameters
sortedtrue to sort items
Returns
the list of entried

Definition at line 328 of file kservicegroup.cpp.

◆ group()

KServiceGroup::Ptr KServiceGroup::group ( const TQString &  relPath)
static

Returns the group with the given relative path.

Parameters
relPaththe path of the service group
Returns
the group with the given relative path name.

Definition at line 708 of file kservicegroup.cpp.

◆ icon()

TQString KServiceGroup::icon ( ) const
inline

Returns the name of the icon associated with the group.

Returns
the name of the icon associated with the group, or TQString::null if not set

Definition at line 129 of file kservicegroup.h.

◆ inlineAlias()

bool KServiceGroup::inlineAlias ( ) const
Returns
true to show an inline alias item into menu
Since
3.5

Definition at line 179 of file kservicegroup.cpp.

◆ inlineValue()

int KServiceGroup::inlineValue ( ) const
Returns
inline limite value
Since
3.5

Definition at line 199 of file kservicegroup.cpp.

◆ isValid()

bool KServiceGroup::isValid ( ) const
inline

Checks whether the entry is valid, returns always true.

Returns
true

Definition at line 104 of file kservicegroup.h.

◆ layoutInfo()

TQStringList KServiceGroup::layoutInfo ( ) const

Definition at line 690 of file kservicegroup.cpp.

◆ load()

void KServiceGroup::load ( TQDataStream &  s)
virtual

Definition at line 239 of file kservicegroup.cpp.

◆ name()

virtual TQString KServiceGroup::name ( ) const
inlinevirtual

Name used for indexing.

Returns
the service group's name

Definition at line 110 of file kservicegroup.h.

◆ noDisplay()

bool KServiceGroup::noDisplay ( ) const

Returns true if the NoDisplay flag was set, i.e.

if this group should be hidden from menus, while still being in tdesycoca.

Returns
true to hide this service group, false to display it
Since
3.1

Definition at line 219 of file kservicegroup.cpp.

◆ parseAttribute()

void KServiceGroup::parseAttribute ( const TQString &  item,
bool &  showEmptyMenu,
bool &  showInline,
bool &  showInlineHeader,
bool &  showInlineAlias,
int &  inlineValue 
)

This function parse attributes into menu.

Since
3.5

Definition at line 652 of file kservicegroup.cpp.

◆ relPath()

virtual TQString KServiceGroup::relPath ( ) const
inlinevirtual

Returns the relative path of the service group.

Returns
the service group's relative path

Definition at line 116 of file kservicegroup.h.

◆ root()

KServiceGroup::Ptr KServiceGroup::root ( )
static

Returns the root service group.

Returns
the root service group

Definition at line 702 of file kservicegroup.cpp.

◆ save()

void KServiceGroup::save ( TQDataStream &  s)
virtual

Definition at line 288 of file kservicegroup.cpp.

◆ setAllowInline()

void KServiceGroup::setAllowInline ( bool  _b)

Definition at line 214 of file kservicegroup.cpp.

◆ setInlineAlias()

void KServiceGroup::setInlineAlias ( bool  _b)

Definition at line 184 of file kservicegroup.cpp.

◆ setInlineValue()

void KServiceGroup::setInlineValue ( int  _val)

Definition at line 204 of file kservicegroup.cpp.

◆ setLayoutInfo()

void KServiceGroup::setLayoutInfo ( const TQStringList &  layout)

Definition at line 685 of file kservicegroup.cpp.

◆ setShowEmptyMenu()

void KServiceGroup::setShowEmptyMenu ( bool  b)

Definition at line 189 of file kservicegroup.cpp.

◆ setShowInlineHeader()

void KServiceGroup::setShowInlineHeader ( bool  _b)

Definition at line 194 of file kservicegroup.cpp.

◆ showEmptyMenu()

bool KServiceGroup::showEmptyMenu ( ) const

Return true if we want to display empty menu entry.

Returns
true to show this service group as menu entry is empty, false to hide it
Since
3.4

Definition at line 174 of file kservicegroup.cpp.

◆ showInlineHeader()

bool KServiceGroup::showInlineHeader ( ) const
Returns
true to show an inline header into menu
Since
3.5

Definition at line 169 of file kservicegroup.cpp.

◆ suppressGenericNames()

TQStringList KServiceGroup::suppressGenericNames ( ) const

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.

Since
3.2

Definition at line 224 of file kservicegroup.cpp.

◆ SuSEentries()

KServiceGroup::List KServiceGroup::SuSEentries ( bool  sort,
bool  excludeNoDisplay,
bool  allowSeparators,
bool  sortByGenericName,
bool  excludeSuSEunimportant = false 
)
virtual

Definition at line 354 of file kservicegroup.cpp.

◆ SuSEgeneralDescription()

bool KServiceGroup::SuSEgeneralDescription ( ) const

Definition at line 229 of file kservicegroup.cpp.

◆ SuSEshortMenu()

bool KServiceGroup::SuSEshortMenu ( ) const

Original API and feature kindly provided by SuSE.

Definition at line 234 of file kservicegroup.cpp.

◆ SuSEsortEntries()

KServiceGroup::List KServiceGroup::SuSEsortEntries ( KSortableValueList< SPtr, TQCString >  slist,
KSortableValueList< SPtr, TQCString >  glist,
bool  excludeNoDisplay,
bool  allowSeparators 
)
virtual

Definition at line 430 of file kservicegroup.cpp.

◆ virtual_hook()

void KServiceGroup::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 727 of file kservicegroup.cpp.

Friends And Related Function Documentation

◆ KBuildServiceGroupFactory

friend class KBuildServiceGroupFactory
friend

Definition at line 70 of file kservicegroup.h.

Member Data Documentation

◆ m_bDeep

bool KServiceGroup::m_bDeep
protected

Definition at line 320 of file kservicegroup.h.

◆ m_childCount

int KServiceGroup::m_childCount
protected

Definition at line 322 of file kservicegroup.h.

◆ m_serviceList

List KServiceGroup::m_serviceList
protected

Definition at line 319 of file kservicegroup.h.

◆ m_strBaseGroupName

TQString KServiceGroup::m_strBaseGroupName
protected

Definition at line 321 of file kservicegroup.h.

◆ m_strCaption

TQString KServiceGroup::m_strCaption
protected

Definition at line 315 of file kservicegroup.h.

◆ m_strComment

TQString KServiceGroup::m_strComment
protected

Definition at line 317 of file kservicegroup.h.

◆ m_strIcon

TQString KServiceGroup::m_strIcon
protected

Definition at line 316 of file kservicegroup.h.


The documentation for this class was generated from the following files:
  • kservicegroup.h
  • kservicegroup.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.4
This website is maintained by Timothy Pearson.