Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KParts::Part Class Reference

#include <part.h>

Inheritance diagram for KParts::Part:

KParts::PartBase KXMLGUIClient KParts::ReadOnlyPart KMediaPlayer::Player KParts::ReadWritePart KTextEditor::Editor List of all members.

Signals

void setWindowCaption (const QString &caption)
void setStatusBarText (const QString &text)

Public Methods

 Part (QObject *parent=0, const char *name=0)
virtual ~Part ()
virtual void embed (QWidget *parentWidget)
virtual QWidget * widget ()
PartManagermanager () const
virtual void setSelectable (bool selectable)
bool isSelectable () const

Protected Methods

virtual void setWidget (QWidget *widget)
virtual void partActivateEvent (PartActivateEvent *event)
virtual void partSelectEvent (PartSelectEvent *event)
virtual void guiActivateEvent (GUIActivateEvent *event)
QWidget * hostContainer (const QString &containerName)

Detailed Description

Base class for parts.

A "part" is a GUI component, featuring:

@sect About the widget Note that KParts::Part does not inherit QWidget. This is due to the fact that the "visual representation" will probably not be a mere QWidget, but an elaborate one. That's why when implementing your KParts::Part (or derived) you should call KParts::Part::setWidget() in your constructor.

@sect About the GUI elements Those elements trigger actions, defined by the part (action()). The layout of the actions in the GUI is defined by an XML file (setXMLFile()).

See also ReadOnlyPart and ReadWritePart, which define the framework for a "viewer" part and for an "editor"-like part. Use Part directly only if your part doesn't fit into those.

Definition at line 142 of file part.h.


Constructor & Destructor Documentation

KParts::Part::Part QObject *    parent = 0,
const char *    name = 0
 

Constructor.

Parameters:
parent  Parent object of the part.
name  QT-internal name of the part.

virtual KParts::Part::~Part   [virtual]
 

Destructor.


Member Function Documentation

virtual void KParts::Part::embed QWidget *    parentWidget [virtual]
 

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 QWidget::reparent(). Note that the Part is still the holder of the QWidget, meaning that if you delete the Part, 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.

virtual void KParts::Part::guiActivateEvent GUIActivateEvent   event [protected, virtual]
 

Convenience method which is called when the Part received a GUIActivateEvent . Reimplement this if you don't want to reimplement event and test for the event yourself or even install an event filter.

Reimplemented in KParts::ReadOnlyPart.

QWidget* KParts::Part::hostContainer const QString &    containerName [protected]
 

Convenience method for KXMLGUIFactory::container.

Returns:
a container widget owned by the Part's GUI.

bool KParts::Part::isSelectable  
 

Returns whether the part is selectable or not.

PartManager* KParts::Part::manager  
 

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

virtual void KParts::Part::partActivateEvent PartActivateEvent   event [protected, virtual]
 

Convenience method which is called when the Part received a PartActivateEvent . Reimplement this if you don't want to reimplement event and test for the event yourself or even install an event filter.

virtual void KParts::Part::partSelectEvent PartSelectEvent   event [protected, virtual]
 

Convenience method which is called when the Part received a PartSelectEvent . Reimplement this if you don't want to reimplement event and test for the event yourself or even install an event filter.

virtual void KParts::Part::setSelectable bool    selectable [virtual]
 

Parameters:
selectable  Indicates whether the part is selectable or not.

void KParts::Part::setStatusBarText const QString &    text [signal]
 

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

virtual void KParts::Part::setWidget QWidget *    widget [protected, virtual]
 

Set the main widget.

Call this in the Part-inherited class constructor.

void KParts::Part::setWindowCaption const QString &    caption [signal]
 

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

virtual QWidget* KParts::Part::widget   [virtual]
 

Returns:
The widget defined by this part, set by setWidget().


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:36 2003 for kdelibs by doxygen1.2.18