\section{KParts::Factory Class Reference}
\label{classKParts_1_1Factory}\index{KParts::Factory@{KParts::Factory}}
A generic factory object to create a {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})}.  


{\tt \#include $<$factory.h$>$}

Inheritance diagram for KParts::Factory:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=60pt]{classKParts_1_1Factory__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KParts::Factory:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=60pt]{classKParts_1_1Factory__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Factory} ({\bf QObject} $\ast${\bf parent}=0, const  char $\ast${\bf name}=0)\label{classKParts_1_1Factory_a0}

\item 
{\bf Part} $\ast$ {\bf create\-Part} ({\bf QWidget} $\ast$parent\-Widget=0, const  char $\ast$widget\-Name=0, {\bf QObject} $\ast${\bf parent}=0, const  char $\ast${\bf name}=0, const  char $\ast$classname=\char`\"{}KParts::Part\char`\"{}, const  {\bf QString\-List} \&args={\bf QString\-List}())
\begin{CompactList}\small\item\em Creates a part. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf Part} $\ast$ {\bf create\-Part\-Object} ({\bf QWidget} $\ast$parent\-Widget=0, const  char $\ast$widget\-Name=0, {\bf QObject} $\ast${\bf parent}=0, const  char $\ast${\bf name}=0, const  char $\ast$classname=\char`\"{}KParts::Part\char`\"{}, const  {\bf QString\-List} \&args={\bf QString\-List}())=0
\begin{CompactList}\small\item\em Reimplement this method in your implementation to create the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})}. \item\end{CompactList}\item 
virtual {\bf QObject} $\ast$ {\bf create\-Object} ({\bf QObject} $\ast${\bf parent}=0, const  char $\ast${\bf name}=0, const  char $\ast$classname=\char`\"{}QObject\char`\"{}, const  {\bf QString\-List} \&args={\bf QString\-List}())
\begin{CompactList}\small\item\em Reimplemented from {\bf KLib\-Factory}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
A generic factory object to create a {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})}. 

{\bf Factory}{\rm (p.\,\pageref{classKParts_1_1Factory})} is an abstract class. Reimplement the {\bf create\-Part\-Object}{\rm (p.\,\pageref{classKParts_1_1Factory_b0})}() method to give it functionality.

\begin{Desc}
\item[See also:]{\bf KLib\-Factory}. \end{Desc}




Definition at line 40 of file factory.h.

\subsection{Member Function Documentation}
\index{KParts::Factory@{KParts::Factory}!createPart@{createPart}}
\index{createPart@{createPart}!KParts::Factory@{KParts::Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Part} $\ast$ Factory::create\-Part ({\bf QWidget} $\ast$ {\em parent\-Widget} = 0, const char $\ast$ {\em widget\-Name} = 0, {\bf QObject} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0, const char $\ast$ {\em classname} = \char`\"{}KParts::Part\char`\"{}, const {\bf QString\-List} \& {\em args} = {\bf QString\-List}())}\label{classKParts_1_1Factory_a2}


Creates a part. 

The {\bf QString\-List} can be used to pass additional arguments to the part. If the part needs additional arguments, it should take them as name=\char`\"{}value\char`\"{} 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: \small\begin{alltt}
    
        
        
    
 \end{alltt}\normalsize 
 This could result in a call to \small\begin{alltt}
     createPart( parentWidget, name, parentObject, parentName, "Kparts::Part",
                 {\bf QStringList}("name1="value1"", "name2="value2") );
 \end{alltt}\normalsize 


\begin{Desc}
\item[Returns:]the newly created part.\end{Desc}
{\bf create\-Part()}{\rm (p.\,\pageref{classKParts_1_1Factory_a2})} automatically emits a signal {\bf KLib\-Factory::object\-Created} 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.

References create\-Part\-Object(), KStd\-Accel::name(), and KLib\-Factory::object\-Created().

Referenced by create\-Object().\index{KParts::Factory@{KParts::Factory}!createPartObject@{createPartObject}}
\index{createPartObject@{createPartObject}!KParts::Factory@{KParts::Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Part} $\ast$ Factory::create\-Part\-Object ({\bf QWidget} $\ast$ {\em parent\-Widget} = 0, const char $\ast$ {\em widget\-Name} = 0, {\bf QObject} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0, const char $\ast$ {\em classname} = \char`\"{}KParts::Part\char`\"{}, const {\bf QString\-List} \& {\em args} = {\bf QString\-List}())\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classKParts_1_1Factory_b0}


Reimplement this method in your implementation to create the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})}. 

The {\bf QString\-List} can be used to pass additional arguments to the part. If the part needs additional arguments, it should take them as name=\char`\"{}value\char`\"{} 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: \small\begin{alltt}
    
        
        
    
 \end{alltt}\normalsize 
 This could result in a call to \small\begin{alltt}
     createPart( parentWidget, name, parentObject, parentName, "Kparts::Part",
                 {\bf QStringList}("name1="value1"", "name2="value2") );
 \end{alltt}\normalsize 


\begin{Desc}
\item[Returns:]the newly created part. \end{Desc}


Definition at line 50 of file factory.cpp.

Referenced by create\-Part().\index{KParts::Factory@{KParts::Factory}!createObject@{createObject}}
\index{createObject@{createObject}!KParts::Factory@{KParts::Factory}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QObject} $\ast$ Factory::create\-Object ({\bf QObject} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0, const char $\ast$ {\em classname} = \char`\"{}QObject\char`\"{}, const {\bf QString\-List} \& {\em args} = {\bf QString\-List}())\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKParts_1_1Factory_b1}


Reimplemented from {\bf KLib\-Factory}. 

Calls {\bf create\-Part}{\rm (p.\,\pageref{classKParts_1_1Factory_a2})}() 

Implements {\bf KLib\-Factory}.

Definition at line 55 of file factory.cpp.

References create\-Part(), QObject::is\-Widget\-Type(), and KStd\-Accel::name().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
factory.h\item 
factory.cpp\end{CompactItemize}
