• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

kresources

resource.h
00001 /*
00002     This file is part of libkresources
00003 
00004     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 #ifndef KRESOURCES_RESOURCE_H
00023 #define KRESOURCES_RESOURCE_H
00024 
00025 #include "kresources_export.h"
00026 
00027 #include <kpluginfactory.h>
00028 
00029 #include <QtCore/QMutex>
00030 #include <QtGui/QWidget>
00031 
00032 class KConfig;
00033 class KConfigGroup;
00034 
00035 namespace KRES {
00036 
00037 class ConfigWidget;
00038 
00075 class KRESOURCES_EXPORT_DEPRECATED Resource : public QObject
00076 {
00077     friend class Factory;
00078     friend class ManagerImpl;
00079 
00080     Q_OBJECT
00081   public:
00082     typedef QList<Resource *> List;
00083 
00087     Resource();
00088 
00093     explicit Resource( const KConfigGroup &group );
00094 
00098     virtual ~Resource();
00099 
00106     virtual void writeConfig( KConfigGroup &group );
00107 
00117     bool open();
00118 
00125     void close();
00126 
00130     bool isOpen() const;
00131 
00135     void setIdentifier( const QString &identifier );
00136 
00143     QString identifier() const;
00144 
00148     void setType( const QString &type );
00149 
00153     QString type() const;
00154 
00159     virtual void setReadOnly( bool value );
00160 
00164     virtual bool readOnly() const;
00165 
00170     virtual void setResourceName( const QString &name );
00171 
00175     virtual QString resourceName() const;
00176 
00180     void setActive( bool active );
00181 
00185     bool isActive() const;
00186 
00190     virtual void dump() const;
00191 
00192   protected:
00202     virtual bool doOpen();
00203 
00208     virtual void doClose();
00209 
00210   private:
00211     class ResourcePrivate;
00212     ResourcePrivate *const d;
00213 };
00214 
00215 class KRESOURCES_EXPORT_DEPRECATED PluginFactoryBase : public KPluginFactory
00216 {
00217   public:
00218     explicit PluginFactoryBase( const char *componentName=0,
00219                                 const char *catalogName=0, QObject *parent=0 )
00220       : KPluginFactory( componentName, catalogName, parent ) {}
00221     explicit PluginFactoryBase( const KAboutData &aboutData, QObject *parent = 0 )
00222       : KPluginFactory( aboutData, parent ) {}
00223 
00224     virtual Resource *resource( const KConfigGroup &group ) = 0;
00225     virtual Resource *resource() = 0;
00226 
00227     virtual ConfigWidget *configWidget( QWidget *parent ) = 0;
00228 
00229   protected:
00230     virtual QObject *createObject( QObject *parent, const char *className,
00231                                    const QStringList &args );
00232 };
00233 
00234 template<class TR,class TC>
00235 class PluginFactory : public PluginFactoryBase
00236 {
00237   public:
00238     explicit PluginFactory( const char *componentName=0,
00239                             const char *catalogName=0, QObject *parent=0 )
00240       : PluginFactoryBase( componentName, catalogName, parent ) {}
00241     explicit PluginFactory( const KAboutData &aboutData, QObject *parent = 0 )
00242       : PluginFactoryBase( aboutData, parent ) {}
00243 
00244     virtual Resource *resource( const KConfigGroup &group )
00245     {
00246       return new TR( group );
00247     }
00248     virtual Resource *resource()
00249     {
00250       return new TR();
00251     }
00252 
00253     ConfigWidget *configWidget( QWidget *parent )
00254     {
00255       return new TC( parent );
00256     }
00257 };
00258 
00259 }
00260 
00261 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 22:18:10 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kresources

Skip menu "kresources"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal