.TH "KParts::Factory" 3 "28 Jan 2004" "kparts Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KParts::Factory \- A generic factory object to create a \fBPart\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <factory.h>\fP
.PP
Inherits \fBKLibFactory\fP.
.PP
Inherited by KParts::GenericFactoryBase< T >.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBFactory\fP (\fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.ti -1c
.RI "\fBPart\fP * \fBcreatePart\fP (\fBQWidget\fP *parentWidget=0, const  char *widgetName=0, \fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0, const  char *classname='KParts::Part', const  \fBQStringList\fP &args=\fBQStringList\fP())"
.br
.RI "\fICreates a part. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBPart\fP * \fBcreatePartObject\fP (\fBQWidget\fP *parentWidget=0, const  char *widgetName=0, \fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0, const  char *classname='KParts::Part', const  \fBQStringList\fP &args=\fBQStringList\fP())=0"
.br
.RI "\fIReimplement this method in your implementation to create the \fBPart\fP. \fP"
.ti -1c
.RI "virtual \fBQObject\fP * \fBcreateObject\fP (\fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0, const  char *classname='QObject', const  \fBQStringList\fP &args=\fBQStringList\fP())"
.br
.RI "\fIReimplemented from \fBKLibFactory\fP. \fP"
.in -1c
.SH "Detailed Description"
.PP 
A generic factory object to create a \fBPart\fP. 

\fBFactory\fP is an abstract class. Reimplement the \fBcreatePartObject\fP() method to give it functionality.
.PP
\fBSee also:\fP
.RS 4
\fBKLibFactory\fP. 
.RE
.PP

.PP
Definition at line 40 of file factory.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBPart\fP * Factory::createPart (\fBQWidget\fP * parentWidget = 0, const char * widgetName = 0, \fBQObject\fP * parent = 0, const char * name = 0, const char * classname = 'KParts::Part', const \fBQStringList\fP & args = \fBQStringList\fP())"
.PP
Creates a part. The \fBQStringList\fP can be used to pass additional arguments to the part. If the part needs additional arguments, it should take them as name='value' pairs. This is the way additional arguments will get passed to the part from eg. khtml. You can for example emebed the part into HTML by using the following code: 
.PP
.nf

    
        
        
    
 
.PP
 This could result in a call to 
.PP
.nf

     createPart( parentWidget, name, parentObject, parentName, 'Kparts::Part',
                 \fBQStringList\fP('name1='value1'', 'name2='value2') );
 
.PP
.PP
\fBReturns:\fP
.RS 4
the newly created part.
.RE
.PP
\fBcreatePart()\fP automatically emits a signal \fBKLibFactory::objectCreated\fP to tell the library about its newly created object. This is very important for reference counting, and allows unloading the library automatically once all its objects have been destroyed. Definition at line 42 of file factory.cpp.
.PP
References createPartObject(), KStdAccel::name(), and KLibFactory::objectCreated().
.PP
Referenced by createObject().
.SS "\fBPart\fP * Factory::createPartObject (\fBQWidget\fP * parentWidget = 0, const char * widgetName = 0, \fBQObject\fP * parent = 0, const char * name = 0, const char * classname = 'KParts::Part', const \fBQStringList\fP & args = \fBQStringList\fP())\fC [protected, pure virtual]\fP"
.PP
Reimplement this method in your implementation to create the \fBPart\fP. The \fBQStringList\fP can be used to pass additional arguments to the part. If the part needs additional arguments, it should take them as name='value' pairs. This is the way additional arguments will get passed to the part from eg. khtml. You can for example emebed the part into HTML by using the following code: 
.PP
.nf

    
        
        
    
 
.PP
 This could result in a call to 
.PP
.nf

     createPart( parentWidget, name, parentObject, parentName, 'Kparts::Part',
                 \fBQStringList\fP('name1='value1'', 'name2='value2') );
 
.PP
.PP
\fBReturns:\fP
.RS 4
the newly created part. 
.RE
.PP
Definition at line 50 of file factory.cpp.
.PP
Referenced by createPart().
.SS "\fBQObject\fP * Factory::createObject (\fBQObject\fP * parent = 0, const char * name = 0, const char * classname = 'QObject', const \fBQStringList\fP & args = \fBQStringList\fP())\fC [protected, virtual]\fP"
.PP
Reimplemented from \fBKLibFactory\fP. Calls \fBcreatePart\fP() Implements \fBKLibFactory\fP.
.PP
Definition at line 55 of file factory.cpp.
.PP
References createPart(), QObject::isWidgetType(), and KStdAccel::name().

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