KParts
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>
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
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.
- Since:
- 3.3
Definition at line 67 of file partmanager.h.
Selection policy. The default policy of a PartManager is Direct.
Definition at line 59 of file partmanager.h.
Constructor & Destructor Documentation
PartManager::PartManager | ( | QWidget * | parent, | |
const char * | name = 0L | |||
) |
Constructs a part manager.
- Parameters:
-
parent The toplevel widget (window / dialog) the partmanager should monitor for activation/selection events name The object's name, if any.
Definition at line 95 of file partmanager.cpp.
Constructs a part manager.
- Parameters:
-
topLevel The toplevel widget (window / dialog ) the partmanager should monitor for activation/selection events parent The parent QObject. name The object's name, if any.
Definition at line 107 of file partmanager.cpp.
PartManager::~PartManager | ( | ) | [virtual] |
Definition at line 119 of file partmanager.cpp.
Member Function Documentation
short int PartManager::activationButtonMask | ( | ) | const |
Part * PartManager::activePart | ( | ) | const [virtual] |
void KParts::PartManager::activePartChanged | ( | KParts::Part * | newPart | ) | [signal] |
QWidget * PartManager::activeWidget | ( | ) | const [virtual] |
Returns the active widget of the current active part (see activePart()).
Definition at line 500 of file partmanager.cpp.
void PartManager::addManagedTopLevelWidget | ( | const QWidget * | topLevel | ) |
Adds the topLevel
widget to the list of managed toplevel widgets.
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.
Adds a part to the manager.
Sets it to the active part automatically if setActive
is true (default ). Behavior fix in KDE3.4: the part's widget is shown only if setActive
is true, it used to be shown in all cases before.
Definition at line 333 of file partmanager.cpp.
bool KParts::PartManager::allowNestedParts | ( | ) | const |
- See also:
- setAllowNestedParts
bool KParts::PartManager::ignoreScrollBars | ( | ) | const |
- See also:
- setIgnoreScrollBars
void KParts::PartManager::partAdded | ( | KParts::Part * | part | ) | [signal] |
void KParts::PartManager::partRemoved | ( | KParts::Part * | part | ) | [signal] |
Returns the list of parts being managed by the partmanager.
Definition at line 558 of file partmanager.cpp.
int PartManager::reason | ( | ) | const |
- Returns:
- the reason for the last activePartChanged signal emitted.
- See also:
- Reason
- Since:
- 3.3
Definition at line 593 of file partmanager.cpp.
void PartManager::removeManagedTopLevelWidget | ( | const QWidget * | topLevel | ) |
Removes the topLevel
widget from the list of managed toplevel widgets.
- See also:
- addManagedTopLevelWidget
Definition at line 576 of file partmanager.cpp.
void PartManager::removePart | ( | Part * | part | ) | [virtual] |
Removes a part from the manager (this does not delete the object) .
Sets the active part to 0 if part
is the activePart() .
Definition at line 369 of file partmanager.cpp.
Replaces oldPart
with newPart
, and sets newPart
as active if setActive
is true.
This is an optimised version of removePart + addPart
Definition at line 393 of file partmanager.cpp.
Part * PartManager::selectedPart | ( | ) | const [virtual] |
QWidget * PartManager::selectedWidget | ( | ) | const [virtual] |
Returns the selected widget of the current selected part (see selectedPart()).
Definition at line 539 of file partmanager.cpp.
SelectionPolicy KParts::PartManager::selectionPolicy | ( | ) | const |
Returns the current selection policy.
void PartManager::setActivationButtonMask | ( | short int | buttonMask | ) |
Specifies which mouse buttons the partmanager should react upon.
By default it reacts on all mouse buttons (LMB/MMB/RMB).
- Parameters:
-
buttonMask a combination of Qt::ButtonState values e.g. Qt::LeftButton | Qt::MidButton
Definition at line 166 of file partmanager.cpp.
void PartManager::setActiveInstance | ( | KInstance * | instance | ) | [protected, virtual] |
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.
Sets the active part.
The active part receives activation events.
widget
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 411 of file partmanager.cpp.
void PartManager::setAllowNestedParts | ( | bool | allow | ) |
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.
void PartManager::setIgnoreScrollBars | ( | bool | ignore | ) |
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.
Sets the selected part.
The selected part receives selection events.
widget
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 505 of file partmanager.cpp.
void PartManager::setSelectionPolicy | ( | SelectionPolicy | policy | ) |
void PartManager::slotManagedTopLevelWidgetDestroyed | ( | ) | [protected, slot] |
void PartManager::slotObjectDestroyed | ( | ) | [protected, slot] |
void PartManager::slotWidgetDestroyed | ( | ) | [protected, slot] |
void PartManager::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
Definition at line 598 of file partmanager.cpp.
Property Documentation
bool PartManager::allowNestedParts [read, write] |
Definition at line 55 of file partmanager.h.
bool PartManager::ignoreScrollBars [read, write] |
Definition at line 56 of file partmanager.h.
PartManager::SelectionPolicy PartManager::selectionPolicy [read, write] |
Definition at line 54 of file partmanager.h.
The documentation for this class was generated from the following files: