kservicegroup.h
/* This file is part of the KDE project
Copyright (C) 2000 Waldo Bastian <bastian@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __kservicegroup_h__
#define __kservicegroup_h__
#include <qptrlist.h>
#include <qstring.h>
#include <qshared.h>
#include <qdatastream.h>
#include <qvariant.h>
#include <kdesktopfile.h>
#include "ksycocaentry.h"
#include "ksycocatype.h"
#include "kservice.h"
class KBuildServiceGroupFactory;
class KIO_EXPORT KServiceGroup : public KSycocaEntry
{
friend class KBuildServiceGroupFactory;
K_SYCOCATYPE( KST_KServiceGroup, KSycocaEntry )
public:
typedef KSharedPtr<KServiceGroup> Ptr;
typedef KSharedPtr<KSycocaEntry> SPtr;
typedef QValueList<SPtr> List;
public:
KServiceGroup( const QString & name );
KServiceGroup( const QString & _fullpath, const QString & _relpath );
KServiceGroup( QDataStream& _str, int offset, bool deep );
virtual ~KServiceGroup();
bool isValid() const { return true; }
virtual QString name() const { return entryPath(); }
virtual QString relPath() const { return entryPath(); }
QString caption() const { return m_strCaption; }
QString icon() const { return m_strIcon; }
QString comment() const { return m_strComment; }
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 { return m_strBaseGroupName; }
QString directoryEntryPath() const;
static Ptr baseGroup( const QString &baseGroupName );
static Ptr root();
static Ptr group(const QString &relPath);
static Ptr childGroup(const QString &parent);
void parseAttribute( const QString &item , bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias ,int &inlineValue );
protected:
void addEntry( KSycocaEntry *entry);
QString m_strCaption;
QString m_strIcon;
QString m_strComment;
List m_serviceList;
bool m_bDeep;
QString m_strBaseGroupName;
int m_childCount;
protected:
virtual void virtual_hook( int id, void* data );
private:
class Private;
Private* d;
};
class KIO_EXPORT KServiceSeparator : public KSycocaEntry
{
K_SYCOCATYPE( KST_KServiceSeparator, KSycocaEntry )
public:
typedef KSharedPtr<KServiceSeparator> Ptr;
public:
KServiceSeparator();
bool isValid() const { return true; }
// Dummy
virtual QString name() const { return "separator"; }
// Dummy
virtual void load( QDataStream& ) { };
// Dummy
virtual void save( QDataStream& ) { };
};
#endif
KServiceGroup
KServiceGroup represents a group of service, for example screensavers.
Definition: kservicegroup.h:67
KServiceGroup::relPath
virtual QString relPath() const
Returns the relative path of the service group.
Definition: kservicegroup.h:115
KServiceGroup::icon
QString icon() const
Returns the name of the icon associated with the group.
Definition: kservicegroup.h:128
KServiceGroup::caption
QString caption() const
Returns the caption of this group.
Definition: kservicegroup.h:121
KServiceGroup::baseGroupName
QString baseGroupName() const
Returns a non-empty string if the group is a special base group.
Definition: kservicegroup.h:251
KServiceGroup::isValid
bool isValid() const
Checks whether the entry is valid, returns always true.
Definition: kservicegroup.h:103
KServiceGroup::comment
QString comment() const
Returns the comment about this service group.
Definition: kservicegroup.h:135
KServiceGroup::name
virtual QString name() const
Name used for indexing.
Definition: kservicegroup.h:109

KDE Home | KDE Accessibility Home | Description of Access Keys