.TH "KParts::Part" 3 "28 Jan 2004" "kparts Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KParts::Part \- Base class for parts.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <part.h>\fP
.PP
Inherits \fBQObject\fP, and \fBKParts::PartBase\fP.
.PP
Inherited by \fBKParts::ReadOnlyPart\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBsetWindowCaption\fP (const  \fBQString\fP &caption)"
.br
.RI "\fIEmitted by the part, to set the caption of the window(s) hosting this part. \fP"
.ti -1c
.RI "void \fBsetStatusBarText\fP (const  \fBQString\fP &text)"
.br
.RI "\fIEmited by the part, to set a text in the statusbar of the window(s) hosting this part. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBPart\fP (\fBQObject\fP *\fBparent\fP=0, const  char *\fBname\fP=0)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "virtual \fB~Part\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "virtual void \fBembed\fP (\fBQWidget\fP *parentWidget)"
.br
.RI "\fIEmbed this part into a host widget. \fP"
.ti -1c
.RI "virtual \fBQWidget\fP * \fBwidget\fP ()"
.br
.ti -1c
.RI "virtual void \fBsetManager\fP (\fBPartManager\fP *manager)"
.br
.ti -1c
.RI "\fBPartManager\fP * \fBmanager\fP () const "
.br
.RI "\fIReturns the part manager handling this part, if any (0L otherwise). \fP"
.ti -1c
.RI "virtual \fBPart\fP * \fBhitTest\fP (\fBQWidget\fP *widget, const  \fBQPoint\fP &globalPos)"
.br
.ti -1c
.RI "virtual void \fBsetSelectable\fP (bool selectable)"
.br
.ti -1c
.RI "bool \fBisSelectable\fP () const "
.br
.RI "\fIReturns whether the part is selectable or not. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBsetWidget\fP (\fBQWidget\fP *widget)"
.br
.RI "\fISet the main widget. \fP"
.ti -1c
.RI "virtual void \fBcustomEvent\fP (\fBQCustomEvent\fP *\fBevent\fP)"
.br
.ti -1c
.RI "virtual void \fBpartActivateEvent\fP (\fBPartActivateEvent\fP *\fBevent\fP)"
.br
.RI "\fIConvenience method which is called when the \fBPart\fP received a \fBPartActivateEvent\fP . \fP"
.ti -1c
.RI "virtual void \fBpartSelectEvent\fP (\fBPartSelectEvent\fP *\fBevent\fP)"
.br
.RI "\fIConvenience method which is called when the \fBPart\fP received a \fBPartSelectEvent\fP . \fP"
.ti -1c
.RI "virtual void \fBguiActivateEvent\fP (\fBGUIActivateEvent\fP *\fBevent\fP)"
.br
.RI "\fIConvenience method which is called when the \fBPart\fP received a \fBGUIActivateEvent\fP . \fP"
.ti -1c
.RI "\fBQWidget\fP * \fBhostContainer\fP (const  \fBQString\fP &containerName)"
.br
.RI "\fIConvenience method for \fBKXMLGUIFactory::container\fP. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Base class for parts. 

A 'part' is a GUI component, featuring: 
.IP "\(bu" 2
A widget embeddedable in any application. 
.IP "\(bu" 2
GUI elements that will be merged in the 'host' user interface (menubars, toolbars... ).
.PP
.PP
\fB About the widget Note that KParts::Part does not inherit \fBQWidget\fP. This is due to the fact that the 'visual representation' will probably not be a mere \fBQWidget\fP, but an elaborate one. That's why when implementing your KParts::Part (or derived) you should call \fBKParts::Part::setWidget()\fP in your constructor.\fP
.PP
\fB \fP
.PP
\fB\fB About the GUI elements Those elements trigger actions, defined by the part (\fBaction\fP()). The layout of the actions in the GUI is defined by an XML file (\fBsetXMLFile\fP()).\fP\fP
.PP
\fB\fB See also \fBReadOnlyPart\fP and \fBReadWritePart\fP, which define the framework for a 'viewer' part and for an 'editor'-like part. Use \fBPart\fP directly only if your part doesn't fit into those. \fP\fP
.PP
Definition at line 142 of file part.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "Part::Part (\fBQObject\fP * parent = 0, const char * name = 0)"
.PP
Constructor. \fBParameters:\fP
.RS 4
\fIparent\fP Parent object of the part. 
.br
\fIname\fP QT-internal name of the part. 
.RE
.PP
Definition at line 131 of file part.cpp.
.PP
References KStdAccel::name().
.SS "Part::~\fBPart\fP ()\fC [virtual]\fP"
.PP
Destructor. Definition at line 140 of file part.cpp.
.PP
References QObject::destroyed(), QObject::disconnect(), and KParts::PartManager::removePart().
.SH "Member Function Documentation"
.PP 
.SS "void Part::embed (\fBQWidget\fP * parentWidget)\fC [virtual]\fP"
.PP
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 \fBQWidget::reparent\fP(). Note that the \fBPart\fP is still the holder of the \fBQWidget\fP, meaning that if you delete the \fBPart\fP, 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.
.PP
References QWidget::reparent(), and widget().
.SS "\fBQWidget\fP * Part::widget ()\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
The widget defined by this part, set by \fBsetWidget\fP(). 
.RE
.PP
Definition at line 169 of file part.cpp.
.PP
Referenced by KParts::PartManager::addPart(), embed(), KParts::ReadWritePart::queryClose(), KParts::PartManager::setActivePart(), and KParts::PartManager::setSelectedPart().
.SS "\fBPartManager\fP * Part::manager () const"
.PP
Returns the part manager handling this part, if any (0L otherwise). Definition at line 179 of file part.cpp.
.SS "void Part::setSelectable (bool selectable)\fC [virtual]\fP"
.PP
\fBParameters:\fP
.RS 4
\fIselectable\fP Indicates whether the part is selectable or not. 
.RE
.PP
Definition at line 209 of file part.cpp.
.SS "bool Part::isSelectable () const"
.PP
Returns whether the part is selectable or not. Definition at line 214 of file part.cpp.
.SS "void KParts::Part::setWindowCaption (const \fBQString\fP & caption)\fC [signal]\fP"
.PP
Emitted by the part, to set the caption of the window(s) hosting this part. Referenced by KParts::ReadOnlyPart::guiActivateEvent(), KParts::ReadOnlyPart::openURL(), and KParts::ReadWritePart::saveAs().
.SS "void KParts::Part::setStatusBarText (const \fBQString\fP & text)\fC [signal]\fP"
.PP
Emited by the part, to set a text in the statusbar of the window(s) hosting this part. 
.SS "void Part::setWidget (\fBQWidget\fP * widget)\fC [protected, virtual]\fP"
.PP
Set the main widget. Call this in the Part-inherited class constructor. Definition at line 192 of file part.cpp.
.PP
References KXMLGUIClient::actionCollection(), QObject::connect(), QObject::destroyed(), KActionCollection::setAutoConnectShortcuts(), and KActionCollection::setWidget().
.SS "void Part::partActivateEvent (\fBPartActivateEvent\fP * event)\fC [protected, virtual]\fP"
.PP
Convenience method which is called when the \fBPart\fP received a \fBPartActivateEvent\fP . Reimplement this if you don't want to reimplement \fBevent\fP and test for the event yourself or even install an event filter. Definition at line 242 of file part.cpp.
.SS "void Part::partSelectEvent (\fBPartSelectEvent\fP * event)\fC [protected, virtual]\fP"
.PP
Convenience method which is called when the \fBPart\fP received a \fBPartSelectEvent\fP . Reimplement this if you don't want to reimplement \fBevent\fP and test for the event yourself or even install an event filter. Definition at line 246 of file part.cpp.
.SS "void Part::guiActivateEvent (\fBGUIActivateEvent\fP * event)\fC [protected, virtual]\fP"
.PP
Convenience method which is called when the \fBPart\fP received a \fBGUIActivateEvent\fP . Reimplement this if you don't want to reimplement \fBevent\fP and test for the event yourself or even install an event filter. Reimplemented in \fBKParts::ReadOnlyPart\fP.
.PP
Definition at line 250 of file part.cpp.
.SS "\fBQWidget\fP * Part::hostContainer (const \fBQString\fP & containerName)\fC [protected]\fP"
.PP
Convenience method for \fBKXMLGUIFactory::container\fP. \fBReturns:\fP
.RS 4
a container widget owned by the Part's GUI. 
.RE
.PP
Definition at line 254 of file part.cpp.
.PP
References KXMLGUIFactory::container(), and KXMLGUIClient::factory().

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