KDECore
kprotocolinfofactory.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Torben Weis <weis@kde.org> 00003 Copyright (C) 2000,2003 Waldo Bastian <bastian@kde.org> 00004 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 #ifndef kprotocolinfofactory_h 00021 #define kprotocolinfofactory_h 00022 00023 #include "kprotocolinfo.h" 00024 00025 #include <QtCore/QMap> 00026 #include <QtCore/QString> 00027 #include <QtCore/QStringList> 00028 #include <kurl.h> 00029 #include <ksycocafactory.h> 00030 00031 00043 class KDECORE_EXPORT KProtocolInfoFactory : public KSycocaFactory 00044 { 00045 K_SYCOCAFACTORY( KST_KProtocolInfoFactory ) 00046 public: 00051 static KProtocolInfoFactory* self(); 00052 00054 KProtocolInfoFactory(); 00055 virtual ~KProtocolInfoFactory(); 00056 00057 /* 00058 * Returns protocol info for @p protocol. 00059 * 00060 * Does not take proxy settings into account. 00061 * @param protocol the protocol to search for 00062 * @return the pointer to the KProtocolInfo, or 0 if not found 00063 */ 00064 KProtocolInfo::Ptr findProtocol(const QString &protocol); 00065 00069 KProtocolInfo::List allProtocols() const; 00070 00075 QStringList protocols() const; 00076 00077 protected: 00081 virtual KSycocaEntry *createEntry(const QString &, const char *) const 00082 { return 0; } 00083 00087 virtual KProtocolInfo *createEntry(int offset) const; 00088 00089 protected: 00093 virtual void virtual_hook( int id, void* data ); 00094 private: 00095 QMap<QString,KProtocolInfo::Ptr> m_cache; 00096 class KProtocolInfoFactoryPrivate* d; 00097 }; 00098 00099 #endif