\section{KParts::Part Class Reference}
\label{classKParts_1_1Part}\index{KParts::Part@{KParts::Part}}
Base class for parts.  


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

Inheritance diagram for KParts::Part:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=99pt]{classKParts_1_1Part__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KParts::Part:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=240pt]{classKParts_1_1Part__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf set\-Window\-Caption} (const  {\bf QString} \&caption)
\begin{CompactList}\small\item\em Emitted by the part, to set the caption of the window(s) hosting this part. \item\end{CompactList}\item 
void {\bf set\-Status\-Bar\-Text} (const  {\bf QString} \&text)
\begin{CompactList}\small\item\em Emited by the part, to set a text in the statusbar of the window(s) hosting this part. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Part} ({\bf QObject} $\ast${\bf parent}=0, const  char $\ast${\bf name}=0)
\begin{CompactList}\small\item\em Constructor. \item\end{CompactList}\item 
virtual {\bf $\sim$Part} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
virtual void {\bf embed} ({\bf QWidget} $\ast$parent\-Widget)
\begin{CompactList}\small\item\em Embed this part into a host widget. \item\end{CompactList}\item 
virtual {\bf QWidget} $\ast$ {\bf widget} ()
\item 
virtual void {\bf set\-Manager} ({\bf Part\-Manager} $\ast$manager)\label{classKParts_1_1Part_a4}

\item 
{\bf Part\-Manager} $\ast$ {\bf manager} () const 
\begin{CompactList}\small\item\em Returns the part manager handling this part, if any (0L otherwise). \item\end{CompactList}\item 
virtual {\bf Part} $\ast$ {\bf hit\-Test} ({\bf QWidget} $\ast$widget, const  {\bf QPoint} \&global\-Pos)\label{classKParts_1_1Part_a6}

\item 
virtual void {\bf set\-Selectable} (bool selectable)
\item 
bool {\bf is\-Selectable} () const 
\begin{CompactList}\small\item\em Returns whether the part is selectable or not. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf set\-Widget} ({\bf QWidget} $\ast$widget)
\begin{CompactList}\small\item\em Set the main widget. \item\end{CompactList}\item 
virtual void {\bf custom\-Event} ({\bf QCustom\-Event} $\ast${\bf event})\label{classKParts_1_1Part_b1}

\item 
virtual void {\bf part\-Activate\-Event} ({\bf Part\-Activate\-Event} $\ast${\bf event})
\begin{CompactList}\small\item\em Convenience method which is called when the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} received a {\bf Part\-Activate\-Event}{\rm (p.\,\pageref{classKParts_1_1PartActivateEvent})} . \item\end{CompactList}\item 
virtual void {\bf part\-Select\-Event} ({\bf Part\-Select\-Event} $\ast${\bf event})
\begin{CompactList}\small\item\em Convenience method which is called when the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} received a {\bf Part\-Select\-Event}{\rm (p.\,\pageref{classKParts_1_1PartSelectEvent})} . \item\end{CompactList}\item 
virtual void {\bf gui\-Activate\-Event} ({\bf GUIActivate\-Event} $\ast${\bf event})
\begin{CompactList}\small\item\em Convenience method which is called when the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} received a {\bf GUIActivate\-Event}{\rm (p.\,\pageref{classKParts_1_1GUIActivateEvent})} . \item\end{CompactList}\item 
{\bf QWidget} $\ast$ {\bf host\-Container} (const  {\bf QString} \&container\-Name)
\begin{CompactList}\small\item\em Convenience method for {\bf KXMLGUIFactory::container}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Base class for parts. 

A \char`\"{}part\char`\"{} is a GUI component, featuring: \begin{itemize}
\item A widget embeddedable in any application. \item GUI elements that will be merged in the \char`\"{}host\char`\"{} user interface (menubars, toolbars... ).\end{itemize}


{\bf  About the widget Note that KParts::Part does not inherit {\bf QWidget}. This is due to the fact that the \char`\"{}visual representation\char`\"{} will probably not be a mere {\bf QWidget}, but an elaborate one. That's why when implementing your KParts::Part (or derived) you should call {\bf KParts::Part::set\-Widget()}{\rm (p.\,\pageref{classKParts_1_1Part_b0})} in your constructor.}

{\bf  }

{\bf {\bf  About the GUI elements Those elements trigger actions, defined by the part ({\bf action}()). The layout of the actions in the GUI is defined by an XML file ({\bf set\-XMLFile}()).}}

{\bf {\bf  See also {\bf Read\-Only\-Part}{\rm (p.\,\pageref{classKParts_1_1ReadOnlyPart})} and {\bf Read\-Write\-Part}{\rm (p.\,\pageref{classKParts_1_1ReadWritePart})}, which define the framework for a \char`\"{}viewer\char`\"{} part and for an \char`\"{}editor\char`\"{}-like part. Use {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} directly only if your part doesn't fit into those. }}



Definition at line 142 of file part.h.

\subsection{Constructor \& Destructor Documentation}
\index{KParts::Part@{KParts::Part}!Part@{Part}}
\index{Part@{Part}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Part::Part ({\bf QObject} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKParts_1_1Part_a0}


Constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]Parent object of the part. \item[{\em name}]QT-internal name of the part. \end{description}
\end{Desc}


Definition at line 131 of file part.cpp.

References KStd\-Accel::name().\index{KParts::Part@{KParts::Part}!~Part@{$\sim$Part}}
\index{~Part@{$\sim$Part}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Part::$\sim${\bf Part} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKParts_1_1Part_a1}


Destructor. 



Definition at line 140 of file part.cpp.

References QObject::destroyed(), QObject::disconnect(), and KParts::Part\-Manager::remove\-Part().

\subsection{Member Function Documentation}
\index{KParts::Part@{KParts::Part}!embed@{embed}}
\index{embed@{embed}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Part::embed ({\bf QWidget} $\ast$ {\em parent\-Widget})\hspace{0.3cm}{\tt  [virtual]}}\label{classKParts_1_1Part_a2}


Embed this part into a host widget. 

You don't need to do this if you created the widget with the correct parent widget - this is just a {\bf QWidget::reparent}(). Note that the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} is still the holder of the {\bf QWidget}, meaning that if you delete the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})}, then the widget gets destroyed as well, and vice-versa. This method is not recommended since creating the widget with the correct parent is simpler anyway. 

Definition at line 163 of file part.cpp.

References QWidget::reparent(), and widget().\index{KParts::Part@{KParts::Part}!widget@{widget}}
\index{widget@{widget}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QWidget} $\ast$ Part::widget ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKParts_1_1Part_a3}


\begin{Desc}
\item[Returns:]The widget defined by this part, set by {\bf set\-Widget}{\rm (p.\,\pageref{classKParts_1_1Part_b0})}(). \end{Desc}


Definition at line 169 of file part.cpp.

Referenced by KParts::Part\-Manager::add\-Part(), embed(), KParts::Read\-Write\-Part::query\-Close(), KParts::Part\-Manager::set\-Active\-Part(), and KParts::Part\-Manager::set\-Selected\-Part().\index{KParts::Part@{KParts::Part}!manager@{manager}}
\index{manager@{manager}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Part\-Manager} $\ast$ Part::manager () const}\label{classKParts_1_1Part_a5}


Returns the part manager handling this part, if any (0L otherwise). 



Definition at line 179 of file part.cpp.\index{KParts::Part@{KParts::Part}!setSelectable@{setSelectable}}
\index{setSelectable@{setSelectable}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Part::set\-Selectable (bool {\em selectable})\hspace{0.3cm}{\tt  [virtual]}}\label{classKParts_1_1Part_a7}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em selectable}]Indicates whether the part is selectable or not. \end{description}
\end{Desc}


Definition at line 209 of file part.cpp.\index{KParts::Part@{KParts::Part}!isSelectable@{isSelectable}}
\index{isSelectable@{isSelectable}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Part::is\-Selectable () const}\label{classKParts_1_1Part_a8}


Returns whether the part is selectable or not. 



Definition at line 214 of file part.cpp.\index{KParts::Part@{KParts::Part}!setWindowCaption@{setWindowCaption}}
\index{setWindowCaption@{setWindowCaption}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KParts::Part::set\-Window\-Caption (const {\bf QString} \& {\em caption})\hspace{0.3cm}{\tt  [signal]}}\label{classKParts_1_1Part_l0}


Emitted by the part, to set the caption of the window(s) hosting this part. 



Referenced by KParts::Read\-Only\-Part::gui\-Activate\-Event(), KParts::Read\-Only\-Part::open\-URL(), and KParts::Read\-Write\-Part::save\-As().\index{KParts::Part@{KParts::Part}!setStatusBarText@{setStatusBarText}}
\index{setStatusBarText@{setStatusBarText}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KParts::Part::set\-Status\-Bar\-Text (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [signal]}}\label{classKParts_1_1Part_l1}


Emited by the part, to set a text in the statusbar of the window(s) hosting this part. 

\index{KParts::Part@{KParts::Part}!setWidget@{setWidget}}
\index{setWidget@{setWidget}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Part::set\-Widget ({\bf QWidget} $\ast$ {\em widget})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKParts_1_1Part_b0}


Set the main widget. 

Call this in the Part-inherited class constructor. 

Definition at line 192 of file part.cpp.

References KXMLGUIClient::action\-Collection(), QObject::connect(), QObject::destroyed(), KAction\-Collection::set\-Auto\-Connect\-Shortcuts(), and KAction\-Collection::set\-Widget().\index{KParts::Part@{KParts::Part}!partActivateEvent@{partActivateEvent}}
\index{partActivateEvent@{partActivateEvent}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Part::part\-Activate\-Event ({\bf Part\-Activate\-Event} $\ast$ {\em event})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKParts_1_1Part_b2}


Convenience method which is called when the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} received a {\bf Part\-Activate\-Event}{\rm (p.\,\pageref{classKParts_1_1PartActivateEvent})} . 

Reimplement this if you don't want to reimplement {\bf event} and test for the event yourself or even install an event filter. 

Definition at line 242 of file part.cpp.\index{KParts::Part@{KParts::Part}!partSelectEvent@{partSelectEvent}}
\index{partSelectEvent@{partSelectEvent}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Part::part\-Select\-Event ({\bf Part\-Select\-Event} $\ast$ {\em event})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKParts_1_1Part_b3}


Convenience method which is called when the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} received a {\bf Part\-Select\-Event}{\rm (p.\,\pageref{classKParts_1_1PartSelectEvent})} . 

Reimplement this if you don't want to reimplement {\bf event} and test for the event yourself or even install an event filter. 

Definition at line 246 of file part.cpp.\index{KParts::Part@{KParts::Part}!guiActivateEvent@{guiActivateEvent}}
\index{guiActivateEvent@{guiActivateEvent}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Part::gui\-Activate\-Event ({\bf GUIActivate\-Event} $\ast$ {\em event})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKParts_1_1Part_b4}


Convenience method which is called when the {\bf Part}{\rm (p.\,\pageref{classKParts_1_1Part})} received a {\bf GUIActivate\-Event}{\rm (p.\,\pageref{classKParts_1_1GUIActivateEvent})} . 

Reimplement this if you don't want to reimplement {\bf event} and test for the event yourself or even install an event filter. 

Reimplemented in {\bf KParts::Read\-Only\-Part} {\rm (p.\,\pageref{classKParts_1_1ReadOnlyPart_b2})}.

Definition at line 250 of file part.cpp.\index{KParts::Part@{KParts::Part}!hostContainer@{hostContainer}}
\index{hostContainer@{hostContainer}!KParts::Part@{KParts::Part}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QWidget} $\ast$ Part::host\-Container (const {\bf QString} \& {\em container\-Name})\hspace{0.3cm}{\tt  [protected]}}\label{classKParts_1_1Part_b5}


Convenience method for {\bf KXMLGUIFactory::container}. 

\begin{Desc}
\item[Returns:]a container widget owned by the Part's GUI. \end{Desc}


Definition at line 254 of file part.cpp.

References KXMLGUIFactory::container(), and KXMLGUIClient::factory().

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