KParts::PartManager Class Reference
The part manager is an object which knows about a collection of parts (even nested ones) and handles activation/deactivation. More...
#include <partmanager.h>
Inheritance diagram for KParts::PartManager:

Public Types | |
enum | SelectionPolicy { Direct, TriState } |
enum | Reason { ReasonLeftClick = 100, ReasonMidClick, ReasonRightClick, NoReason } |
Signals | |
void | partAdded (KParts::Part *part) |
void | partRemoved (KParts::Part *part) |
void | activePartChanged (KParts::Part *newPart) |
Public Member Functions | |
PartManager (QWidget *parent, const char *name=0L) | |
PartManager (QWidget *topLevel, QObject *parent, const char *name=0) | |
void | setSelectionPolicy (SelectionPolicy policy) |
SelectionPolicy | selectionPolicy () const |
void | setAllowNestedParts (bool allow) |
bool | allowNestedParts () const |
void | setIgnoreScrollBars (bool ignore) |
bool | ignoreScrollBars () const |
void | setActivationButtonMask (short int buttonMask) |
short int | activationButtonMask () const |
virtual bool | eventFilter (QObject *obj, QEvent *ev) |
virtual void | addPart (Part *part, bool setActive=true) |
virtual void | removePart (Part *part) |
virtual void | replacePart (Part *oldPart, Part *newPart, bool setActive=true) |
virtual void | setActivePart (Part *part, QWidget *widget=0L) |
virtual Part * | activePart () const |
virtual QWidget * | activeWidget () const |
virtual void | setSelectedPart (Part *part, QWidget *widget=0L) |
virtual Part * | selectedPart () const |
virtual QWidget * | selectedWidget () const |
const QPtrList< Part > * | parts () const |
void | addManagedTopLevelWidget (const QWidget *topLevel) |
void | removeManagedTopLevelWidget (const QWidget *topLevel) |
int | reason () const |
Protected Slots | |
void | slotObjectDestroyed () |
void | slotWidgetDestroyed () |
void | slotManagedTopLevelWidgetDestroyed () |
Protected Member Functions | |
virtual void | setActiveInstance (KInstance *instance) |
virtual void | virtual_hook (int id, void *data) |
Properties | |
SelectionPolicy | selectionPolicy |
bool | allowNestedParts |
bool | ignoreScrollBars |
Detailed Description
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 KParts::MainWindow for example, in addition to a part manager.
Parts know about the part manager to add nested parts to it. See also KParts::Part::manager() and KParts::Part::setManager().
Definition at line 50 of file partmanager.h.
Member Enumeration Documentation
|
Selection policy. The default policy of a PartManager is Direct.
Definition at line 59 of file partmanager.h. |
|
This extends QFocusEvent::Reason with the non-focus-event reasons for partmanager to activate a part. To test for "any focusin reason", use < ReasonLeftClick NoReason usually means: explicit activation with setActivePart.
Definition at line 67 of file partmanager.h. |
Constructor & Destructor Documentation
|
Constructs a part manager.
Definition at line 95 of file partmanager.cpp. References addManagedTopLevelWidget(). |
|
Constructs a part manager.
Definition at line 107 of file partmanager.cpp. References addManagedTopLevelWidget(). |
Member Function Documentation
|
Sets the selection policy of the partmanager.
Definition at line 136 of file partmanager.cpp. |
|
Returns the current selection policy.
|
|
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 Part is nested (a child part) if its parent object inherits KParts::Part. 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 146 of file partmanager.cpp. |
|
|
|
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. The default value is false (read: scrollbars are NOT ignored). Definition at line 156 of file partmanager.cpp. |
|
|
|
Specifies which mouse buttons the partmanager should react upon. By default it reacts on all mouse buttons (LMB/MMB/RMB).
Definition at line 166 of file partmanager.cpp. |
|
Definition at line 171 of file partmanager.cpp. |
|
Adds a part to the manager.
Sets it to the active part automatically if Definition at line 333 of file partmanager.cpp. References k_funcinfo, kdBacktrace(), kdWarning(), partAdded(), setActivePart(), KParts::Part::setManager(), and KParts::Part::widget(). Referenced by replacePart(). |
|
Removes a part from the manager (this does not delete the object) .
Sets the active part to 0 if Definition at line 369 of file partmanager.cpp. References kdFatal(), partRemoved(), setActivePart(), KParts::Part::setManager(), and setSelectedPart(). Referenced by slotObjectDestroyed(), and KParts::Part::~Part(). |
|
Replaces This is an optimised version of removePart + addPart Definition at line 393 of file partmanager.cpp. References addPart(), kdFatal(), partRemoved(), and KParts::Part::setManager(). |
|
Sets the active part. The active part receives activation events.
Definition at line 411 of file partmanager.cpp. References activePartChanged(), kdDebug(), kdWarning(), setActiveInstance(), setSelectedPart(), and KParts::Part::widget(). Referenced by addPart(), and removePart(). |
|
Returns the active part.
Definition at line 495 of file partmanager.cpp. |
|
Returns the active widget of the current active part (see activePart ).
Definition at line 500 of file partmanager.cpp. |
|
Sets the selected part. The selected part receives selection events.
Definition at line 505 of file partmanager.cpp. References KParts::Part::widget(). Referenced by removePart(), and setActivePart(). |
|
Returns the current selected part.
Definition at line 534 of file partmanager.cpp. |
|
Returns the selected widget of the current selected part (see selectedPart ).
Definition at line 539 of file partmanager.cpp. |
|
Returns the list of parts being managed by the partmanager.
Definition at line 558 of file partmanager.cpp. |
|
Adds the Usually a PartManager 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 KDE dockwidget library) , it is necessary to extend this. Definition at line 563 of file partmanager.cpp. Referenced by PartManager(). |
|
Removes the
Definition at line 576 of file partmanager.cpp. |
|
Definition at line 593 of file partmanager.cpp. |
|
Emitted when a new part has been added.
Referenced by addPart(). |
|
Emitted when a part has been removed.
Referenced by removePart(), and replacePart(). |
|
Emitted when the active part has changed.
Referenced by setActivePart(). |
|
Changes the active instance when the active part changes. The active instance is used by KBugReport and KAboutDialog. Override if you really need to - usually you don't need to. Definition at line 489 of file partmanager.cpp. References KGlobal::_activeInstance. Referenced by setActivePart(). |
|
Removes a part when it is destroyed.
Definition at line 544 of file partmanager.cpp. References kdDebug(), and removePart(). |
The documentation for this class was generated from the following files: