.TH "KParts::GenericFactory" 3 "28 Jan 2004" "kparts Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KParts::GenericFactory \- A template for a \fBKParts::Factory\fP implementation.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <genericfactory.h>\fP
.PP
Inherits GenericFactoryBase.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBKParts::Part\fP * \fBcreatePartObject\fP (\fBQWidget\fP *parentWidget, const  char *widgetName, \fBQObject\fP *parent, const  char *name, const  char *className, const  \fBQStringList\fP &args)"
.br
.in -1c
.SH "Detailed Description"
.PP 

.SS "template<class T> class KParts::GenericFactory< T >"
A template for a \fBKParts::Factory\fP implementation. 

It implements the pure virtual createPartObject method by instantiating the template argument when requested through the className field. In addition it is a container for a part's \fBKInstance\fP object, by providing a static \fBKInstance\fP *instance() method.
.PP
The template argument has to inherit from \fBKParts::Part\fP and has to implement two methods: 1) There needs to be a public constructor with the following signature: MyPart( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const QStringList& args )
.PP
2) It needs to provide one static method to create a \fBKAboutData\fP object per request, holding information about the component's name, its authors, license, etc. The signature of that static method has to be \fBKAboutData\fP *createAboutData()
.PP
The template will take care of memory management of the \fBKInstance\fP and the \fBKAboutData\fP object.
.PP
For advanced use you can also inherit from the template and re-implement additionally the virtual \fBKInstance\fP *createInstance() method, for example in case you want to extend the paths of your instance's \fBKStandardDirs\fP object.
.PP
If a \fBKParts::ReadOnlyPart\fP is requested through this factory and the template argument implements a \fBKParts::ReadWritePart\fP then setReadWrite( false ) will automatically be called in createPartObject.
.PP
Use the factory through the K_EXPORT_COMPONENT_FACTORY macro, like that: 
.PP
.nf

 typedef KParts::GenericFactory<YourKPart> YourKPartFactory;
 K_EXPORT_COMPONENT_FACTORY( yourlibrary, YourKPartFactory );
 
.PP
 yourlibrary is the library name that you compiled your KPart into. 
.PP
Definition at line 83 of file genericfactory.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kparts Library from the source code.
