.TH "KParts::PartManager" 3 "28 Jan 2004" "kparts Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KParts::PartManager \- The part manager is an object which knows about a collection of parts (even nested ones) and handles activation/deactivation.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <partmanager.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBSelectionPolicy\fP { \fBDirect\fP, \fBTriState\fP }"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBpartAdded\fP (\fBKParts::Part\fP *part)"
.br
.RI "\fIEmitted when a new part has been added. \fP"
.ti -1c
.RI "void \fBpartRemoved\fP (\fBKParts::Part\fP *part)"
.br
.RI "\fIEmitted when a part has been removed. \fP"
.ti -1c
.RI "void \fBactivePartChanged\fP (\fBKParts::Part\fP *newPart)"
.br
.RI "\fIEmitted when the active part has changed. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBPartManager\fP (\fBQWidget\fP *\fBparent\fP, const  char *\fBname\fP=0L)"
.br
.RI "\fIConstructs a part manager. \fP"
.ti -1c
.RI "\fBPartManager\fP (\fBQWidget\fP *topLevel, \fBQObject\fP *\fBparent\fP, const  char *\fBname\fP=0)"
.br
.RI "\fIConstructs a part manager. \fP"
.ti -1c
.RI "void \fBsetSelectionPolicy\fP (SelectionPolicy policy)"
.br
.RI "\fISets the selection policy of the partmanager. \fP"
.ti -1c
.RI "SelectionPolicy \fBselectionPolicy\fP () const "
.br
.RI "\fIReturns the current selection policy. \fP"
.ti -1c
.RI "void \fBsetAllowNestedParts\fP (bool allow)"
.br
.RI "\fISpecifies whether the partmanager should handle/allow nested parts or not. \fP"
.ti -1c
.RI "bool \fBallowNestedParts\fP () const "
.br
.ti -1c
.RI "void \fBsetIgnoreScrollBars\fP (bool ignore)"
.br
.RI "\fISpecifies whether the partmanager should ignore mouse click events for scrollbars or not. \fP"
.ti -1c
.RI "bool \fBignoreScrollBars\fP () const "
.br
.ti -1c
.RI "void \fBsetActivationButtonMask\fP (short int buttonMask)"
.br
.RI "\fISpecifies which mouse buttons the partmanager should react upon. \fP"
.ti -1c
.RI "short int \fBactivationButtonMask\fP () const "
.br
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *obj, \fBQEvent\fP *ev)"
.br
.ti -1c
.RI "virtual void \fBaddPart\fP (\fBPart\fP *part, bool setActive=true)"
.br
.RI "\fIAdds a part to the manager. \fP"
.ti -1c
.RI "virtual void \fBremovePart\fP (\fBPart\fP *part)"
.br
.RI "\fIRemoves a part from the manager (this does not delete the object) . \fP"
.ti -1c
.RI "virtual void \fBreplacePart\fP (\fBPart\fP *oldPart, \fBPart\fP *newPart, bool setActive=true)"
.br
.RI "\fIReplaces \fColdPart\fP with \fCnewPart\fP, and sets \fCnewPart\fP as active if \fCsetActive\fP is true. \fP"
.ti -1c
.RI "virtual void \fBsetActivePart\fP (\fBPart\fP *part, \fBQWidget\fP *widget=0L)"
.br
.RI "\fISets the active part. \fP"
.ti -1c
.RI "virtual \fBPart\fP * \fBactivePart\fP () const "
.br
.RI "\fIReturns the active part. \fP"
.ti -1c
.RI "virtual \fBQWidget\fP * \fBactiveWidget\fP () const "
.br
.RI "\fIReturns the active widget of the current active part (see \fBactivePart\fP ). \fP"
.ti -1c
.RI "virtual void \fBsetSelectedPart\fP (\fBPart\fP *part, \fBQWidget\fP *widget=0L)"
.br
.RI "\fISets the selected part. \fP"
.ti -1c
.RI "virtual \fBPart\fP * \fBselectedPart\fP () const "
.br
.RI "\fIReturns the current selected part. \fP"
.ti -1c
.RI "virtual \fBQWidget\fP * \fBselectedWidget\fP () const "
.br
.RI "\fIReturns the selected widget of the current selected part (see \fBselectedPart\fP ). \fP"
.ti -1c
.RI "const  \fBQPtrList\fP< \fBPart\fP > * \fBparts\fP () const "
.br
.RI "\fIReturns the list of parts being managed by the partmanager. \fP"
.ti -1c
.RI "void \fBaddManagedTopLevelWidget\fP (const  \fBQWidget\fP *topLevel)"
.br
.RI "\fIAdds the \fCtopLevel\fP widget to the list of managed toplevel widgets. \fP"
.ti -1c
.RI "void \fBremoveManagedTopLevelWidget\fP (const  \fBQWidget\fP *topLevel)"
.br
.RI "\fIRemoves the \fCtopLevel\fP widget from the list of managed toplevel widgets. \fP"
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotObjectDestroyed\fP ()"
.br
.RI "\fIRemoves a part when it is destroyed. \fP"
.ti -1c
.RI "void \fBslotWidgetDestroyed\fP ()"
.br
.ti -1c
.RI "void \fBslotManagedTopLevelWidgetDestroyed\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBsetActiveInstance\fP (\fBKInstance\fP *instance)"
.br
.RI "\fIChanges the active instance when the active part changes. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
The part manager is an object which knows about a collection of parts (even nested ones) and handles activation/deactivation. 

Applications that want to embed parts without merging GUIs only use a KParts::PartManager. Those who want to merge GUIs use a \fBKParts::MainWindow\fP for example, in addition to a part manager.
.PP
Parts know about the part manager to add nested parts to it. See also \fBKParts::Part::manager\fP() and \fBKParts::Part::setManager\fP(). 
.PP
Definition at line 47 of file partmanager.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "PartManager::PartManager (\fBQWidget\fP * parent, const char * name = 0L)"
.PP
Constructs a part manager. \fBParameters:\fP
.RS 4
\fIparent\fP The toplevel widget (window / dialog) the partmanager should monitor for activation/selection events 
.RE
.PP
Definition at line 73 of file partmanager.cpp.
.PP
References addManagedTopLevelWidget(), and KStdAccel::name().
.SS "PartManager::PartManager (\fBQWidget\fP * topLevel, \fBQObject\fP * parent, const char * name = 0)"
.PP
Constructs a part manager. \fBParameters:\fP
.RS 4
\fItopLevel\fP The toplevel widget (window / dialog ) the partmanager should monitor for activation/selection events 
.br
\fIparent\fP The parent \fBQObject\fP. 
.RE
.PP
Definition at line 85 of file partmanager.cpp.
.PP
References addManagedTopLevelWidget(), and KStdAccel::name().
.SH "Member Function Documentation"
.PP 
.SS "void PartManager::setSelectionPolicy (SelectionPolicy policy)"
.PP
Sets the selection policy of the partmanager. Definition at line 112 of file partmanager.cpp.
.SS "PartManager::SelectionPolicy PartManager::selectionPolicy () const"
.PP
Returns the current selection policy. Definition at line 117 of file partmanager.cpp.
.SS "void PartManager::setAllowNestedParts (bool allow)"
.PP
Specifies whether the partmanager should handle/allow nested parts or not. This is a property the shell has to set/specify. Per default we assume that the shell cannot handle nested parts. However in case of a KOffice shell for example we allow nested parts. A \fBPart\fP is nested (a child part) if its parent object inherits \fBKParts::Part\fP. If a child part is activated and nested parts are not allowed/handled, then the top parent part in the tree is activated. Definition at line 122 of file partmanager.cpp.
.SS "bool PartManager::allowNestedParts () const"
.PP
\fBSee also:\fP
.RS 4
\fBsetAllowNestedParts\fP 
.RE
.PP
Definition at line 127 of file partmanager.cpp.
.SS "void PartManager::setIgnoreScrollBars (bool ignore)"
.PP
Specifies whether the partmanager should ignore mouse click events for scrollbars or not. If the partmanager ignores them, then clicking on the scrollbars of a non-active/non-selected part will not change the selection or activation state.
.PP
The default value is false (read: scrollbars are NOT ignored). Definition at line 132 of file partmanager.cpp.
.SS "bool PartManager::ignoreScrollBars () const"
.PP
\fBSee also:\fP
.RS 4
\fBsetIgnoreScrollBars\fP 
.RE
.PP
Definition at line 137 of file partmanager.cpp.
.SS "void PartManager::setActivationButtonMask (short int buttonMask)"
.PP
Specifies which mouse buttons the partmanager should react upon. By default it reacts on all mouse buttons (LMB/MMB/RMB). 
.PP
\fBParameters:\fP
.RS 4
\fImouseButtons\fP a combination of Qt::ButtonState values e.g. Qt::LeftButton | Qt::MidButton 
.RE
.PP
Definition at line 142 of file partmanager.cpp.
.SS "short int PartManager::activationButtonMask () const"
.PP
\fBSee also:\fP
.RS 4
\fBsetActivationButtonMask\fP 
.RE
.PP
Definition at line 147 of file partmanager.cpp.
.SS "void PartManager::addPart (\fBPart\fP * part, bool setActive = true)\fC [virtual]\fP"
.PP
Adds a part to the manager. Sets it to the active part automatically if \fCsetActive\fP is true (default ). Definition at line 301 of file partmanager.cpp.
.PP
References QWidget::focusPolicy(), QObject::name(), partAdded(), setActivePart(), QWidget::setFocus(), KParts::Part::setManager(), QWidget::show(), and KParts::Part::widget().
.PP
Referenced by replacePart().
.SS "void PartManager::removePart (\fBPart\fP * part)\fC [virtual]\fP"
.PP
Removes a part from the manager (this does not delete the object) . Sets the active part to 0 if \fCpart\fP is the \fBactivePart\fP() . Definition at line 332 of file partmanager.cpp.
.PP
References QObject::name(), partRemoved(), setActivePart(), KParts::Part::setManager(), and setSelectedPart().
.PP
Referenced by slotObjectDestroyed(), and KParts::Part::~Part().
.SS "void PartManager::replacePart (\fBPart\fP * oldPart, \fBPart\fP * newPart, bool setActive = true)\fC [virtual]\fP"
.PP
Replaces \fColdPart\fP with \fCnewPart\fP, and sets \fCnewPart\fP as active if \fCsetActive\fP is true. This is an optimised version of \fBremovePart\fP + \fBaddPart\fP Definition at line 353 of file partmanager.cpp.
.PP
References addPart(), QObject::name(), partRemoved(), and KParts::Part::setManager().
.SS "void PartManager::setActivePart (\fBPart\fP * part, \fBQWidget\fP * widget = 0L)\fC [virtual]\fP"
.PP
Sets the active part. The active part receives activation events.
.PP
\fCwidget\fP can be used to specify which widget was responsible for the activation. This is important if you have multiple views for a document/part , like in KOffice . Definition at line 371 of file partmanager.cpp.
.PP
References activePartChanged(), QObject::connect(), QObject::destroyed(), QObject::disconnect(), QObject::inherits(), QObject::name(), QObject::parent(), QApplication::sendEvent(), setActiveInstance(), setSelectedPart(), and KParts::Part::widget().
.PP
Referenced by addPart(), and removePart().
.SS "\fBPart\fP * PartManager::activePart () const\fC [virtual]\fP"
.PP
Returns the active part. Definition at line 453 of file partmanager.cpp.
.SS "\fBQWidget\fP * PartManager::activeWidget () const\fC [virtual]\fP"
.PP
Returns the active widget of the current active part (see \fBactivePart\fP ). Definition at line 458 of file partmanager.cpp.
.SS "void PartManager::setSelectedPart (\fBPart\fP * part, \fBQWidget\fP * widget = 0L)\fC [virtual]\fP"
.PP
Sets the selected part. The selected part receives selection events.
.PP
\fCwidget\fP can be used to specify which widget was responsible for the selection. This is important if you have multiple views for a document/part , like in KOffice . Definition at line 463 of file partmanager.cpp.
.PP
References QApplication::sendEvent(), and KParts::Part::widget().
.PP
Referenced by removePart(), and setActivePart().
.SS "\fBPart\fP * PartManager::selectedPart () const\fC [virtual]\fP"
.PP
Returns the current selected part. Definition at line 492 of file partmanager.cpp.
.SS "\fBQWidget\fP * PartManager::selectedWidget () const\fC [virtual]\fP"
.PP
Returns the selected widget of the current selected part (see \fBselectedPart\fP ). Definition at line 497 of file partmanager.cpp.
.SS "const  \fBQPtrList\fP< \fBPart\fP > * PartManager::parts () const"
.PP
Returns the list of parts being managed by the partmanager. Definition at line 516 of file partmanager.cpp.
.SS "void PartManager::addManagedTopLevelWidget (const \fBQWidget\fP * topLevel)"
.PP
Adds the \fCtopLevel\fP widget to the list of managed toplevel widgets. Usually a \fBPartManager\fP only listens for events (for activation/selection) for one toplevel widget (and its children) , the one specified in the constructor. Sometimes however (like for example when using the \fBKDE\fP dockwidget library) , it is necessary to extend this. Definition at line 521 of file partmanager.cpp.
.PP
References QObject::connect(), QObject::destroyed(), and QWidget::isTopLevel().
.PP
Referenced by PartManager().
.SS "void PartManager::removeManagedTopLevelWidget (const \fBQWidget\fP * topLevel)"
.PP
Removes the \fCtopLevel\fP widget from the list of managed toplevel widgets. \fBSee also:\fP
.RS 4
\fBaddManagedTopLevelWidget\fP 
.RE
.PP
Definition at line 534 of file partmanager.cpp.
.PP
References QWidget::isTopLevel().
.SS "void KParts::PartManager::partAdded (\fBKParts::Part\fP * part)\fC [signal]\fP"
.PP
Emitted when a new part has been added. \fBSee also:\fP
.RS 4
\fBaddPart()\fP 
.RE
.PP
Referenced by addPart().
.SS "void KParts::PartManager::partRemoved (\fBKParts::Part\fP * part)\fC [signal]\fP"
.PP
Emitted when a part has been removed. \fBSee also:\fP
.RS 4
\fBremovePart()\fP 
.RE
.PP
Referenced by removePart(), and replacePart().
.SS "void KParts::PartManager::activePartChanged (\fBKParts::Part\fP * newPart)\fC [signal]\fP"
.PP
Emitted when the active part has changed. \fBSee also:\fP
.RS 4
\fBsetActivePart()\fP 
.RE
.PP
Referenced by setActivePart().
.SS "void PartManager::setActiveInstance (\fBKInstance\fP * instance)\fC [protected, virtual]\fP"
.PP
Changes the active instance when the active part changes. The active instance is used by \fBKBugReport\fP and \fBKAboutDialog\fP. Override if you really need to - usually you don't need to. Definition at line 447 of file partmanager.cpp.
.PP
References KGlobal::_activeInstance, and KNotifyClient::instance().
.PP
Referenced by setActivePart().
.SS "void PartManager::slotObjectDestroyed ()\fC [protected, slot]\fP"
.PP
Removes a part when it is destroyed. Definition at line 502 of file partmanager.cpp.
.PP
References removePart(), and QObject::sender().

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