\section{KService\-Group Class Reference}
\label{classKServiceGroup}\index{KServiceGroup@{KServiceGroup}}
KService\-Group represents a group of service, for example screensavers. Represents a group of services.  


{\tt \#include $<$kservicegroup.h$>$}

Inheritance diagram for KService\-Group:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=60pt]{classKServiceGroup__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KService\-Group:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=194pt]{classKServiceGroup__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef {\bf KShared\-Ptr}$<$ {\bf KService\-Group} $>$ {\bf Ptr}\label{classKServiceGroup_w0}

\item 
typedef {\bf KShared\-Ptr}$<$ {\bf KSycoca\-Entry} $>$ {\bf SPtr}\label{classKServiceGroup_w1}

\item 
typedef {\bf QValue\-List}$<$ {\bf SPtr} $>$ {\bf List}\label{classKServiceGroup_w2}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KService\-Group} (const {\bf QString} \&name)
\item 
{\bf KService\-Group} (const {\bf QString} \&\_\-fullpath, const {\bf QString} \&\_\-relpath)
\item 
{\bf KService\-Group} ({\bf QData\-Stream} \&\_\-str, int {\bf offset}, bool deep)\label{classKServiceGroup_a2}

\item 
bool {\bf is\-Valid} () const 
\item 
virtual {\bf QString} {\bf name} () const 
\item 
virtual {\bf QString} {\bf rel\-Path} () const 
\item 
{\bf QString} {\bf caption} () const 
\item 
{\bf QString} {\bf icon} () const 
\item 
{\bf QString} {\bf comment} () const 
\item 
int {\bf child\-Count} ()
\item 
bool {\bf no\-Display} () const 
\item 
{\bf QString\-List} {\bf suppress\-Generic\-Names} () const 
\item 
void {\bf set\-Layout\-Info} (const {\bf QString\-List} \&layout)\label{classKServiceGroup_a13}

\item 
{\bf QString\-List} {\bf layout\-Info} () const \label{classKServiceGroup_a14}

\item 
virtual void {\bf load} ({\bf QData\-Stream} \&)\label{classKServiceGroup_a15}

\item 
virtual void {\bf save} ({\bf QData\-Stream} \&)\label{classKServiceGroup_a16}

\item 
{\bf List} {\bf entries} (bool sorted, bool exclude\-No\-Display, bool allow\-Separators, bool sort\-By\-Generic\-Name=false)
\item 
virtual {\bf List} {\bf entries} (bool sorted, bool exclude\-No\-Display)\label{classKServiceGroup_a18}

\item 
virtual {\bf List} {\bf entries} (bool sorted=false)
\item 
{\bf QString} {\bf base\-Group\-Name} () const 
\item 
{\bf QString} {\bf directory\-Entry\-Path} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf Ptr} {\bf base\-Group} (const {\bf QString} \&base\-Group\-Name)
\item 
static {\bf Ptr} {\bf root} ()
\item 
static {\bf Ptr} {\bf group} (const {\bf QString} \&rel\-Path)
\item 
static {\bf Ptr} {\bf child\-Group} (const {\bf QString} \&parent)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf add\-Entry} ({\bf KSycoca\-Entry} $\ast$entry)\label{classKServiceGroup_b0}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKServiceGroup_b1}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QString} {\bf m\_\-str\-Caption}\label{classKServiceGroup_p0}

\item 
{\bf QString} {\bf m\_\-str\-Icon}\label{classKServiceGroup_p1}

\item 
{\bf QString} {\bf m\_\-str\-Comment}\label{classKServiceGroup_p2}

\item 
{\bf List} {\bf m\_\-service\-List}\label{classKServiceGroup_p3}

\item 
bool {\bf m\_\-b\-Deep}\label{classKServiceGroup_p4}

\item 
{\bf QString} {\bf m\_\-str\-Base\-Group\-Name}\label{classKServiceGroup_p5}

\item 
int {\bf m\_\-child\-Count}\label{classKServiceGroup_p6}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KBuild\-Service\-Group\-Factory}\label{classKServiceGroup_n0}

\end{CompactItemize}


\subsection{Detailed Description}
KService\-Group represents a group of service, for example screensavers. Represents a group of services. 

This class is typically used like this:



\footnotesize\begin{verbatim} // 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 ...
    }
 }
\end{verbatim}
\normalsize
 



Definition at line 67 of file kservicegroup.h.

\subsection{Constructor \& Destructor Documentation}
\index{KServiceGroup@{KService\-Group}!KServiceGroup@{KServiceGroup}}
\index{KServiceGroup@{KServiceGroup}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KService\-Group::KService\-Group (const {\bf QString} \& {\em name})}\label{classKServiceGroup_a0}


Construct a dummy servicegroup indexed with {\tt name}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]the name of the service group \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 43 of file kservicegroup.cpp.

References name().\index{KServiceGroup@{KService\-Group}!KServiceGroup@{KServiceGroup}}
\index{KServiceGroup@{KServiceGroup}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KService\-Group::KService\-Group (const {\bf QString} \& {\em \_\-fullpath}, const {\bf QString} \& {\em \_\-relpath})}\label{classKServiceGroup_a1}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-fullpath}]full path to the config file \item[{\em \_\-relpath}]relative path to the config file \end{description}
\end{Desc}


Definition at line 50 of file kservicegroup.cpp.

References QString::find\-Rev(), KConfig\-Base::has\-Key(), QString::is\-Empty(), QString::left(), QString::length(), QString::mid(), KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Entry(), KConfig\-Base::read\-List\-Entry(), QString::right(), and KConfig\-Base::set\-Desktop\-Group().

\subsection{Member Function Documentation}
\index{KServiceGroup@{KService\-Group}!isValid@{isValid}}
\index{isValid@{isValid}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KService\-Group::is\-Valid () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKServiceGroup_a4}


Checks whether the entry is valid, returns always true. 

\begin{Desc}
\item[Returns:]true \end{Desc}


Implements {\bf KSycoca\-Entry}.

Definition at line 103 of file kservicegroup.h.\index{KServiceGroup@{KService\-Group}!name@{name}}
\index{name@{name}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KService\-Group::name () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKServiceGroup_a5}


Name used for indexing. 

\begin{Desc}
\item[Returns:]the service group's name \end{Desc}


Implements {\bf KSycoca\-Entry}.

Definition at line 109 of file kservicegroup.h.

References KSycoca\-Entry::entry\-Path().

Referenced by entries(), and KService\-Group().\index{KServiceGroup@{KService\-Group}!relPath@{relPath}}
\index{relPath@{relPath}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KService\-Group::rel\-Path () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKServiceGroup_a6}


Returns the relative path of the service group. 

\begin{Desc}
\item[Returns:]the service group's relative path \end{Desc}


Definition at line 115 of file kservicegroup.h.

References KSycoca\-Entry::entry\-Path().

Referenced by entries(), and group().\index{KServiceGroup@{KService\-Group}!caption@{caption}}
\index{caption@{caption}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Group::caption () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceGroup_a7}


Returns the caption of this group. 

\begin{Desc}
\item[Returns:]the caption of this group \end{Desc}


Definition at line 121 of file kservicegroup.h.\index{KServiceGroup@{KService\-Group}!icon@{icon}}
\index{icon@{icon}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Group::icon () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceGroup_a8}


Returns the name of the icon associated with the group. 

\begin{Desc}
\item[Returns:]the name of the icon associated with the group, or QString::null if not set \end{Desc}


Definition at line 128 of file kservicegroup.h.\index{KServiceGroup@{KService\-Group}!comment@{comment}}
\index{comment@{comment}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Group::comment () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceGroup_a9}


Returns the comment about this service group. 

\begin{Desc}
\item[Returns:]the descriptive comment for the group, if there is one, or QString::null if not set \end{Desc}


Definition at line 135 of file kservicegroup.h.\index{KServiceGroup@{KService\-Group}!childCount@{childCount}}
\index{childCount@{childCount}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KService\-Group::child\-Count ()}\label{classKServiceGroup_a10}


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

\begin{Desc}
\item[Returns:]the number of child services \end{Desc}


Definition at line 114 of file kservicegroup.cpp.

References QValue\-List::begin(), QValue\-List::end(), KSycoca\-Entry::is\-Type(), and KService::no\-Display().\index{KServiceGroup@{KService\-Group}!noDisplay@{noDisplay}}
\index{noDisplay@{noDisplay}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KService\-Group::no\-Display () const}\label{classKServiceGroup_a11}


Returns true if the No\-Display flag was set, i.e. 

if this group should be hidden from menus, while still being in ksycoca. \begin{Desc}
\item[Returns:]true to hide this service group, false to display it \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 141 of file kservicegroup.cpp.

References QString::starts\-With().

Referenced by entries().\index{KServiceGroup@{KService\-Group}!suppressGenericNames@{suppressGenericNames}}
\index{suppressGenericNames@{suppressGenericNames}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KService\-Group::suppress\-Generic\-Names () const}\label{classKServiceGroup_a12}


Returns a list of untranslated generic names that should be be supressed when showing this group. 

E.g. The group \char`\"{}Games/Arcade\char`\"{} might want to suppress the generic name \char`\"{}Arcade Game\char`\"{} since it's redundant in this particular context. \begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 146 of file kservicegroup.cpp.\index{KServiceGroup@{KService\-Group}!entries@{entries}}
\index{entries@{entries}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Group::List} KService\-Group::entries (bool {\em sorted}, bool {\em exclude\-No\-Display}, bool {\em allow\-Separators}, bool {\em sort\-By\-Generic\-Name} = {\tt false})}\label{classKServiceGroup_a17}


List of all Services and Service\-Groups within this Service\-Group. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sorted}]true to sort items \item[{\em exclude\-No\-Display}]true to exclude items marked \char`\"{}No\-Display\char`\"{} \item[{\em allow\-Separators}]true to allow separator items to be included \item[{\em sort\-By\-Generic\-Name}]true to sort Generic\-Name+Name instead of Name+Generic\-Name \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the list of entries \end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 246 of file kservicegroup.cpp.

References QValue\-List$<$ KSortable\-Item$<$ T, Key $>$ $>$::begin(), QValue\-List::begin(), QValue\-List$<$ KSortable\-Item$<$ T, Key $>$ $>$::end(), QValue\-List::end(), group(), KSortable\-Value\-List$<$ T, Key $>$::insert(), QString::is\-Empty(), KSycoca\-Entry::is\-Type(), QString::length(), QString::local8Bit(), m\_\-service\-List, KService::menu\-Id(), QString::mid(), KSycoca\-Entry::name(), name(), KService::no\-Display(), no\-Display(), rel\-Path(), QValue\-List$<$ KSortable\-Item$<$ T, Key $>$ $>$::remove(), and KSortable\-Value\-List$<$ T, Key $>$::sort().

Referenced by entries().\index{KServiceGroup@{KService\-Group}!entries@{entries}}
\index{entries@{entries}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Group::List} KService\-Group::entries (bool {\em sorted} = {\tt false})\hspace{0.3cm}{\tt  [virtual]}}\label{classKServiceGroup_a19}


List of all Services and Service\-Groups within this Service\-Group. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sorted}]true to sort items \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the list of entried \end{Desc}


Definition at line 226 of file kservicegroup.cpp.

References entries().\index{KServiceGroup@{KService\-Group}!baseGroupName@{baseGroupName}}
\index{baseGroupName@{baseGroupName}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Group::base\-Group\-Name () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceGroup_a20}


Returns a non-empty string if the group is a special base group. 

By default, \char`\"{}Settings/\char`\"{} is the kcontrol base group (\char`\"{}settings\char`\"{}) and \char`\"{}System/Screensavers/\char`\"{} is the screensavers base group (\char`\"{}screensavers\char`\"{}). This allows moving the groups without breaking those apps.

The base group is defined by the X-KDE-Base\-Group key in the .directory file. \begin{Desc}
\item[Returns:]the base group name, or null if no base group \end{Desc}


Definition at line 215 of file kservicegroup.h.\index{KServiceGroup@{KService\-Group}!directoryEntryPath@{directoryEntryPath}}
\index{directoryEntryPath@{directoryEntryPath}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Group::directory\-Entry\-Path () const}\label{classKServiceGroup_a21}


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

The path is either absolute or relative to the \char`\"{}apps\char`\"{} resource. \begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 504 of file kservicegroup.cpp.\index{KServiceGroup@{KService\-Group}!baseGroup@{baseGroup}}
\index{baseGroup@{baseGroup}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Group::Ptr} KService\-Group::base\-Group (const {\bf QString} \& {\em base\-Group\-Name})\hspace{0.3cm}{\tt  [static]}}\label{classKServiceGroup_e0}


Returns the group for the given base\-Group\-Name. 

Can return 0L if the directory (or the .directory file) was deleted. \begin{Desc}
\item[Returns:]the base group with the given name, or 0 if not available. \end{Desc}


Definition at line 479 of file kservicegroup.cpp.\index{KServiceGroup@{KService\-Group}!root@{root}}
\index{root@{root}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Group::Ptr} KService\-Group::root ()\hspace{0.3cm}{\tt  [static]}}\label{classKServiceGroup_e1}


Returns the root service group. 

\begin{Desc}
\item[Returns:]the root service group \end{Desc}


Definition at line 485 of file kservicegroup.cpp.

Referenced by group().\index{KServiceGroup@{KService\-Group}!group@{group}}
\index{group@{group}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Group::Ptr} KService\-Group::group (const {\bf QString} \& {\em rel\-Path})\hspace{0.3cm}{\tt  [static]}}\label{classKServiceGroup_e2}


Returns the group with the given relative path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rel\-Path}]the path of the service group \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the group with the given relative path name. \end{Desc}


Definition at line 491 of file kservicegroup.cpp.

References QString::is\-Empty(), rel\-Path(), and root().

Referenced by entries().\index{KServiceGroup@{KService\-Group}!childGroup@{childGroup}}
\index{childGroup@{childGroup}!KServiceGroup@{KService\-Group}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Group::Ptr} KService\-Group::child\-Group (const {\bf QString} \& {\em parent})\hspace{0.3cm}{\tt  [static]}}\label{classKServiceGroup_e3}


Returns the group of services that have X-KDE-Parent\-App equal to {\tt parent} (siblings). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]the name of the service's parent \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the services group \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 498 of file kservicegroup.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kservicegroup.h\item 
kservicegroup.cpp\end{CompactItemize}
