22#ifndef TDERESOURCES_RESOURCE_H
23#define TDERESOURCES_RESOURCE_H
26#include <tqvaluelist.h>
29#include <klibloader.h>
255class TDERESOURCES_EXPORT
Resource :
public TQObject
257 friend class Factory;
258 friend class ManagerImpl;
262 typedef TQValueList<Resource *> List;
269 Resource(
const TDEConfig *config );
319 TQString
type()
const;
356 virtual void dump()
const;
376 void setIdentifier(
const TQString &identifier );
377 void setType(
const TQString &type );
380 class ResourcePrivate;
384class TDERESOURCES_EXPORT PluginFactoryBase :
public KLibFactory
387 virtual Resource *resource(
const TDEConfig *config ) = 0;
389 virtual ConfigWidget *configWidget( TQWidget *parent ) = 0;
392 virtual TQObject* createObject( TQObject *parent,
const char *name,
const char *className,
393 const TQStringList & args)
403template<
class TR,
class TC>
404class PluginFactory :
public PluginFactoryBase
407 Resource *resource(
const TDEConfig *config )
409 return new TR( config );
412 ConfigWidget *configWidget( TQWidget *parent )
414 return new TC( parent );
virtual void setReadOnly(bool value)
Mark the resource as read-only.
bool open()
Open this resource, if it not already open.
bool isOpen() const
Returns whether the resource is open or not.
virtual void doClose()
Close this resource.
virtual void dump() const
Print resource information as debug output.
virtual void setResourceName(const TQString &name)
Set the name of resource.
bool isActive() const
Return true, if the resource is active.
virtual void writeConfig(TDEConfig *config)
Write configuration information for this resource to a configuration file.
TQString type() const
Returns the type of this resource.
virtual bool readOnly() const
Returns, if the resource is read-only.
void close()
Decrease the open count of this object, and if the count reaches zero, close this resource by calling...
virtual bool doOpen()
Open this resource.
Resource(const TDEConfig *config)
Constructor.
void setActive(bool active)
Sets, if the resource is active.
TQString identifier() const
Returns a unique identifier.
virtual TQString resourceName() const
Returns the name of resource.