kservicetype.h
/* This file is part of the KDE project
Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
1999 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 as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
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 __kservicetype_h__
#define __kservicetype_h__
#include "ksycocaentry.h"
#include "kservice.h"
#include <qstring.h>
#include <qstringlist.h>
#include <qptrlist.h>
#include <qmap.h>
#include <qshared.h>
#include <qdatastream.h>
#include <qvariant.h>
#include <ksimpleconfig.h>
class KIO_EXPORT KServiceType : public KSycocaEntry
{
K_SYCOCATYPE( KST_KServiceType, KSycocaEntry )
public:
typedef KSharedPtr<KServiceType> Ptr;
typedef QValueList<Ptr> List;
public:
KServiceType( const QString & _fullpath, const QString& _name,
const QString& _icon, const QString& _comment);
KServiceType( const QString & _fullpath );
KServiceType( KDesktopFile *config);
KServiceType( QDataStream& _str, int offset );
virtual ~KServiceType();
QString icon() const { return m_strIcon; }
QString comment() const { return m_strComment; }
QString name() const { return m_strName; }
QString desktopEntryPath() const { return entryPath(); }
bool isDerived() const { return m_bDerived; }
QString parentServiceType() const;
bool inherits( const QString& servTypeName ) const;
virtual QVariant property( const QString& _name ) const;
virtual QStringList propertyNames() const;
bool isValid() const { return m_bValid; }
virtual QVariant::Type propertyDef( const QString& _name ) const;
virtual QStringList propertyDefNames() const;
virtual const QMap<QString,QVariant::Type>& propertyDefs() const { return m_mapPropDefs; }
virtual void save( QDataStream& );
virtual void load( QDataStream& );
// gcc 2.95.x doesn't understand KServiceType::Ptr here
/* KServiceType:: */ Ptr parentType();
void addService(KService::Ptr service);
KService::List services();
static Ptr serviceType( const QString& _name );
static KService::List offers( const QString& _servicetype );
static List allServiceTypes();
protected:
void init( KDesktopFile *config );
protected:
QString m_strName;
QString m_strIcon;
QString m_strComment;
QMap<QString,QVariant> m_mapProps;
QMap<QString,QVariant::Type> m_mapPropDefs;
bool m_bValid:1;
bool m_bDerived:1;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KServiceTypePrivate;
KServiceTypePrivate* d;
};
//QDataStream& operator>>( QDataStream& _str, KServiceType& s );
//QDataStream& operator<<( QDataStream& _str, KServiceType& s );
#endif
KServiceType::icon
QString icon() const
Returns the icon associated with this service type.
Definition: kservicetype.h:94
KServiceType::name
QString name() const
Returns the name of this service type.
Definition: kservicetype.h:106
KServiceType
A service type is the generic notion for a mimetype, a type of service instead of a type of file...
Definition: kservicetype.h:45
KServiceType::isDerived
bool isDerived() const
Checks whether this service type inherits another one.
Definition: kservicetype.h:121
KServiceType::desktopEntryPath
QString desktopEntryPath() const
Returns the relative path to the desktop entry file responsible for this servicetype.
Definition: kservicetype.h:114
KServiceType::isValid
bool isValid() const
Checks whether the service type is valid.
Definition: kservicetype.h:158
KServiceType::comment
QString comment() const
Returns the descriptive comment associated, if any.
Definition: kservicetype.h:100

KDE Home | KDE Accessibility Home | Description of Access Keys