libkdepim Library API Documentation

resourcefactory.h

00001 /*
00002     This file is part of libkdepim.
00003     Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
00004     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
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 as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef KPIM_RESOURCEFACTORY_H
00023 #define KPIM_RESOURCEFACTORY_H
00024 
00025 #include <qdict.h>
00026 #include <qstring.h>
00027 
00028 #include <kconfig.h>
00029 #include <klibloader.h>
00030 
00031 #include "resource.h"
00032 #include "resourceconfigwidget.h"
00033 
00034 namespace KPIM {
00035 
00036 struct ResourceInfo {
00037   QString library;
00038   QString nameLabel;
00039   QString descriptionLabel;
00040 };
00041 
00059 class ResourceFactory
00060 {
00061 public:
00062     
00066   static ResourceFactory *self( QString resourceType );
00067 
00075   ResourceConfigWidget *configWidget( const QString& type, QWidget *parent = 0 );
00076 
00085   Resource *resource( const QString& type, const KConfig *config );
00086 
00090   QStringList resources();
00091 
00095   ResourceInfo *info( const QString &type );
00096 
00097 protected:
00098   ResourceFactory( QString resourceType );
00099   ~ResourceFactory();
00100 
00101   QString mResourceType;
00102 
00103 private:
00104   KLibrary *openLibrary( const QString& libName );
00105 
00106   static ResourceFactory *mSelf;
00107 
00108   QDict<ResourceInfo> mResourceList;
00109 };
00110 
00111 }
00112 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:22 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001