kservicetypefactory.h
/* This file is part of the KDE project
Copyright (C) 1998, 1999 Torben Weis <weis@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 __k_service_type_factory_h__
#define __k_service_type_factory_h__
#include <assert.h>
#include <qstringlist.h>
#include <qvaluevector.h>
#include "ksycocafactory.h"
#include "kmimetype.h"
class KSycoca;
class KSycocaDict;
class KServiceType;
class KFolderType;
class KDEDesktopMimeType;
class KExecMimeType;
class KIO_EXPORT KServiceTypeFactory : public KSycocaFactory
{
K_SYCOCAFACTORY( KST_KServiceTypeFactory )
public:
KServiceTypeFactory();
virtual ~KServiceTypeFactory();
virtual KSycocaEntry *createEntry(const QString &, const char *)
{ assert(0); return 0; }
virtual KServiceType * findServiceTypeByName(const QString &_name);
QVariant::Type findPropertyTypeByName(const QString &_name);
KMimeType * findFromPattern(const QString &_filename, QString *match = 0);
KMimeType::List allMimeTypes();
KServiceType::List allServiceTypes();
bool checkMimeTypes();
static KServiceTypeFactory * self();
protected:
virtual KServiceType *createEntry(int offset);
private:
static KServiceTypeFactory *_self;
protected:
int m_fastPatternOffset;
int m_otherPatternOffset;
QMap<QString,int> m_propertyTypeDict;
private:
QStringList m_patterns;
QValueVector<Q_INT32> m_pattern_offsets;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KServiceTypeFactoryPrivate* d;
};
#endif
KMimeType
Represent a mime type, like "text/plain", and the data that is associated with it.
Definition: kmimetype.h:47
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
KDEDesktopMimeType
Mime type for desktop files.
Definition: kmimetype.h:506
KFolderType
Folder mime type.
Definition: kmimetype.h:477
KExecMimeType
The mime type for executable files.
Definition: kmimetype.h:622

KDE Home | KDE Accessibility Home | Description of Access Keys