Kexi API Documentation (2.0 alpha)

KexiInternalPart Class Reference

#include <kexiinternalpart.h>

Inheritance diagram for KexiInternalPart:

KexiCSVImportExportPart KexiMigrationPart KexiRelationPartImpl List of all members.

Detailed Description

A prototype for Kexi Internal Parts (plugins) implementation.

Internal Kexi parts are parts that are not available for users, but loaded internally be application when needed. Example of such part is Relations Window. The internal part instance is unique and has no explicitly stored data. Parts may be able to create widgets or/and dialogs, depending on implementation (createWidgetInstance(), createDialogInstance()). Parts can have unique flag set for dialogs (true by default)

Definition at line 49 of file kexiinternalpart.h.

Public Member Functions

 KexiInternalPart (QObject *parent, const char *name, const QStringList &)
virtual ~KexiInternalPart ()
KexiDialogBaseinstance (KexiMainWindow *parent)
bool uniqueDialog () const
bool cancelled () const

Static Public Member Functions

static QWidgetcreateWidgetInstance (const char *partName, const char *widgetClass, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, QWidget *parent, const char *objName=0, QMap< QString, QString > *args=0)
static QWidgetcreateWidgetInstance (const char *partName, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, QWidget *parent, const char *objName=0, QMap< QString, QString > *args=0)
static KexiDialogBasecreateKexiDialogInstance (const char *partName, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, const char *objName=0)
static QDialogcreateModalDialogInstance (const char *partName, const char *dialogClass, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, const char *objName=0, QMap< QString, QString > *args=0)
static QDialogcreateModalDialogInstance (const char *partName, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, const char *objName=0, QMap< QString, QString > *args=0)
static bool executeCommand (const char *partName, KexiMainWindow *mainWin, const char *commandName, QMap< QString, QString > *args=0)
static const KexiInternalPartpart (KexiDB::MessageHandler *msgHdr, const char *partName)

Protected Member Functions

KexiDialogBasefindOrCreateKexiDialog (KexiMainWindow *mainWin, const char *objName)
virtual QWidgetcreateWidget (const char *widgetClass, KexiMainWindow *mainWin, QWidget *parent, const char *objName=0, QMap< QString, QString > *args=0)
virtual KexiViewBasecreateView (KexiMainWindow *mainWin, QWidget *parent, const char *objName=0)
virtual bool executeCommand (KexiMainWindow *mainWin, const char *commandName, QMap< QString, QString > *args=0)

Protected Attributes

QGuardedPtr< QWidgetm_uniqueWidget
 Unique dialog - we're using guarded ptr for the dialog so can know if it has been closed.
bool m_uniqueDialog: 1
 true if createDialogInstance() should return only one dialog
bool m_cancelled: 1
 Used in cancelled().


Constructor & Destructor Documentation

KexiInternalPart::KexiInternalPart QObject *  parent,
const char *  name,
const QStringList & 
 

Definition at line 74 of file kexiinternalpart.cpp.

KexiInternalPart::~KexiInternalPart  )  [virtual]
 

Definition at line 81 of file kexiinternalpart.cpp.


Member Function Documentation

bool KexiInternalPart::cancelled  )  const [inline]
 

Returns:
true if the part creation has been cancelled (eg. by a user) so it wasn't an error. Internal part's impelmentation should set it to true when needed. False by default.

Definition at line 124 of file kexiinternalpart.h.

KexiDialogBase * KexiInternalPart::createKexiDialogInstance const char *  partName,
KexiDB::MessageHandler msgHdr,
KexiMainWindow mainWin,
const char *  objName = 0
[static]
 

Creates a new dialog instance. If such instance already exists, and is unique (see uniqueDialog()) it is just returned. The part knows about destroying its dialog instance, (if it is uinque), so on another call the dialog will be created again. msgHdr is a message handler for displaying error messages. The dialog is assigned to mainWin as its parent, and objName name is set.

Definition at line 129 of file kexiinternalpart.cpp.

References findOrCreateKexiDialog().

Referenced by KexiMainWindowImpl::slotProjectRelations().

static QDialog* KexiInternalPart::createModalDialogInstance const char *  partName,
KexiDB::MessageHandler msgHdr,
KexiMainWindow mainWin,
const char *  objName = 0,
QMap< QString, QString > *  args = 0
[inline, static]
 

Adeded For convenience.

Definition at line 105 of file kexiinternalpart.h.

QDialog * KexiInternalPart::createModalDialogInstance const char *  partName,
const char *  dialogClass,
KexiDB::MessageHandler msgHdr,
KexiMainWindow mainWin,
const char *  objName = 0,
QMap< QString, QString > *  args = 0
[static]
 

Creates a new modal dialog instance (QDialog or a subclass). If such instance already exists, and is unique (see uniqueDialog()) it is just returned. dialogClass is a pseudo class used in case when the part offers more than one dialog type. msgHdr is a message handler for displaying error messages. args is two-way optional argument: it can contain custom options used on widget's creation. Depending on implementation, the created dialog can write its state (e.g. result or status information) back to this argument. The part knows about destroying its dialog instance, (if it is uinque), so on another call the dialog will be created again. The dialog is assigned to mainWin as its parent, and objName name is set.

Definition at line 142 of file kexiinternalpart.cpp.

References createWidget(), m_uniqueWidget, and uniqueDialog().

Referenced by KexiMacro::DataTableAction::activate(), KexiMainWindowImpl::copyItemToClipboardAsDataTable(), KexiMainWindowImpl::exportItemAsDataTable(), KexiMainWindowImpl::showProjectMigrationWizard(), KexiMainWindowImpl::slotEditPasteSpecialDataTable(), and KexiMainWindowImpl::slotProjectImportDataTable().

KexiViewBase * KexiInternalPart::createView KexiMainWindow mainWin,
QWidget parent,
const char *  objName = 0
[protected, virtual]
 

Reimplement this if your internal part has to return a view object.

Reimplemented in KexiRelationPartImpl.

Definition at line 191 of file kexiinternalpart.cpp.

Referenced by findOrCreateKexiDialog().

QWidget * KexiInternalPart::createWidget const char *  widgetClass,
KexiMainWindow mainWin,
QWidget parent,
const char *  objName = 0,
QMap< QString, QString > *  args = 0
[protected, virtual]
 

Reimplement this if your internal part has to return widgets or QDialog objects.

Reimplemented in KexiCSVImportExportPart, and KexiMigrationPart.

Definition at line 180 of file kexiinternalpart.cpp.

Referenced by createModalDialogInstance(), and createWidgetInstance().

static QWidget* KexiInternalPart::createWidgetInstance const char *  partName,
KexiDB::MessageHandler msgHdr,
KexiMainWindow mainWin,
QWidget parent,
const char *  objName = 0,
QMap< QString, QString > *  args = 0
[inline, static]
 

For convenience.

Definition at line 72 of file kexiinternalpart.h.

QWidget * KexiInternalPart::createWidgetInstance const char *  partName,
const char *  widgetClass,
KexiDB::MessageHandler msgHdr,
KexiMainWindow mainWin,
QWidget parent,
const char *  objName = 0,
QMap< QString, QString > *  args = 0
[static]
 

Creates a new widget instance using part partName. widgetClass is a pseudo class used in case when the part offers more than one widget type. msgHdr is a message handler for displaying error messages. args is two-way optional argument: it can contain custom options used on widget's creation. Depending on implementation, the created widget can write its state (e.g. result or status information) back to this argument. Created widget will have assigned parent widget and objName name.

Definition at line 93 of file kexiinternalpart.cpp.

References createWidget().

bool KexiInternalPart::executeCommand KexiMainWindow mainWin,
const char *  commandName,
QMap< QString, QString > *  args = 0
[protected, virtual]
 

Reimplement this if your internal part has to execute a command commandName (usually nonvisual). Arguments are put into args and the result can be put into the args.

Returns:
true on successful calling.

Reimplemented in KexiCSVImportExportPart.

Definition at line 200 of file kexiinternalpart.cpp.

bool KexiInternalPart::executeCommand const char *  partName,
KexiMainWindow mainWin,
const char *  commandName,
QMap< QString, QString > *  args = 0
[static]
 

Executes a command commandName (usually nonvisual) using part called partName. The result can be put into the args.

Returns:
true on successful calling.

Definition at line 169 of file kexiinternalpart.cpp.

References executeCommand().

Referenced by executeCommand().

KexiDialogBase * KexiInternalPart::findOrCreateKexiDialog KexiMainWindow mainWin,
const char *  objName
[protected]
 

Used internally

Definition at line 103 of file kexiinternalpart.cpp.

References KexiDialogBase::addView(), createView(), m_uniqueDialog, m_uniqueWidget, KexiDialogBase::registerDialog(), and KexiDialogBase::setId().

Referenced by createKexiDialogInstance().

KexiDialogBase* KexiInternalPart::instance KexiMainWindow parent  ) 
 

const KexiInternalPart * KexiInternalPart::part KexiDB::MessageHandler msgHdr,
const char *  partName
[static]
 

Returns:
internal part of a name partName. Shouldn't be usable.

Definition at line 87 of file kexiinternalpart.cpp.

bool KexiInternalPart::uniqueDialog  )  const [inline]
 

Returns:
true if the part can create only one (unique) dialog.

Definition at line 119 of file kexiinternalpart.h.

Referenced by createModalDialogInstance().


Member Data Documentation

bool KexiInternalPart::m_cancelled [protected]
 

Used in cancelled().

Definition at line 156 of file kexiinternalpart.h.

Referenced by KexiCSVImportExportPart::createWidget().

bool KexiInternalPart::m_uniqueDialog [protected]
 

true if createDialogInstance() should return only one dialog

Definition at line 154 of file kexiinternalpart.h.

Referenced by findOrCreateKexiDialog().

QGuardedPtr<QWidget> KexiInternalPart::m_uniqueWidget [protected]
 

Unique dialog - we're using guarded ptr for the dialog so can know if it has been closed.

Definition at line 152 of file kexiinternalpart.h.

Referenced by createModalDialogInstance(), and findOrCreateKexiDialog().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:04 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003