kexi

#include <kexiinternalpart.h>

Inheritance diagram for KexiInternalPart:
KexiCSVImportExportPart KexiMigrationPart

Public Member Functions

 KexiInternalPart (TQObject *parent, const char *name, const TQStringList &)
KexiDialogBase * instance (KexiMainWindow *parent)
bool uniqueDialog () const
bool cancelled () const

Static Public Member Functions

static TQWidget * createWidgetInstance (const char *partName, const char *widgetClass, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, TQWidget *parent, const char *objName=0, TQMap< TQString, TQString > *args=0)
static TQWidget * createWidgetInstance (const char *partName, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, TQWidget *parent, const char *objName=0, TQMap< TQString, TQString > *args=0)
static KexiDialogBase * createKexiDialogInstance (const char *partName, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, const char *objName=0)
static TQDialog * createModalDialogInstance (const char *partName, const char *dialogClass, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, const char *objName=0, TQMap< TQString, TQString > *args=0)
static TQDialog * createModalDialogInstance (const char *partName, KexiDB::MessageHandler *msgHdr, KexiMainWindow *mainWin, const char *objName=0, TQMap< TQString, TQString > *args=0)
static bool executeCommand (const char *partName, KexiMainWindow *mainWin, const char *commandName, TQMap< TQString, TQString > *args=0)
static const KexiInternalPart * part (KexiDB::MessageHandler *msgHdr, const char *partName)

Protected Member Functions

KexiDialogBase * findOrCreateKexiDialog (KexiMainWindow *mainWin, const char *objName)
virtual TQWidget * createWidget (const char *widgetClass, KexiMainWindow *mainWin, TQWidget *parent, const char *objName=0, TQMap< TQString, TQString > *args=0)
virtual KexiViewBase * createView (KexiMainWindow *mainWin, TQWidget *parent, const char *objName=0)
virtual bool executeCommand (KexiMainWindow *mainWin, const char *commandName, TQMap< TQString, TQString > *args=0)

Protected Attributes

TQGuardedPtr< TQWidget > m_uniqueWidget
bool m_uniqueDialog: 1
bool m_cancelled: 1

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)

  • then a dialog created by createDialogInstance() is unique.

Definition at line 49 of file kexiinternalpart.h.

Constructor & Destructor Documentation

◆ KexiInternalPart()

KexiInternalPart::KexiInternalPart ( TQObject * parent,
const char * name,
const TQStringList &  )

Definition at line 74 of file kexiinternalpart.cpp.

◆ ~KexiInternalPart()

KexiInternalPart::~KexiInternalPart ( )
virtual

Definition at line 81 of file kexiinternalpart.cpp.

Member Function Documentation

◆ cancelled()

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 125 of file kexiinternalpart.h.

◆ createKexiDialogInstance()

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.

◆ createModalDialogInstance() [1/2]

TQDialog * KexiInternalPart::createModalDialogInstance ( const char * partName,
const char * dialogClass,
KexiDB::MessageHandler * msgHdr,
KexiMainWindow * mainWin,
const char * objName = 0,
TQMap< TQString, TQString > * args = 0 )
static

Creates a new modal dialog instance (TQDialog 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.

◆ createModalDialogInstance() [2/2]

TQDialog * KexiInternalPart::createModalDialogInstance ( const char * partName,
KexiDB::MessageHandler * msgHdr,
KexiMainWindow * mainWin,
const char * objName = 0,
TQMap< TQString, TQString > * args = 0 )
inlinestatic

Adeded For convenience.

Definition at line 106 of file kexiinternalpart.h.

◆ createView()

KexiViewBase * KexiInternalPart::createView ( KexiMainWindow * mainWin,
TQWidget * parent,
const char * objName = 0 )
protectedvirtual

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

Definition at line 191 of file kexiinternalpart.cpp.

◆ createWidget()

TQWidget * KexiInternalPart::createWidget ( const char * widgetClass,
KexiMainWindow * mainWin,
TQWidget * parent,
const char * objName = 0,
TQMap< TQString, TQString > * args = 0 )
protectedvirtual

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

Reimplemented in KexiCSVImportExportPart, and KexiMigrationPart.

Definition at line 180 of file kexiinternalpart.cpp.

◆ createWidgetInstance() [1/2]

TQWidget * KexiInternalPart::createWidgetInstance ( const char * partName,
const char * widgetClass,
KexiDB::MessageHandler * msgHdr,
KexiMainWindow * mainWin,
TQWidget * parent,
const char * objName = 0,
TQMap< TQString, TQString > * 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.

◆ createWidgetInstance() [2/2]

TQWidget * KexiInternalPart::createWidgetInstance ( const char * partName,
KexiDB::MessageHandler * msgHdr,
KexiMainWindow * mainWin,
TQWidget * parent,
const char * objName = 0,
TQMap< TQString, TQString > * args = 0 )
inlinestatic

For convenience.

Definition at line 73 of file kexiinternalpart.h.

◆ executeCommand() [1/2]

bool KexiInternalPart::executeCommand ( const char * partName,
KexiMainWindow * mainWin,
const char * commandName,
TQMap< TQString, TQString > * 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.

◆ executeCommand() [2/2]

bool KexiInternalPart::executeCommand ( KexiMainWindow * mainWin,
const char * commandName,
TQMap< TQString, TQString > * args = 0 )
protectedvirtual

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.

◆ findOrCreateKexiDialog()

KexiDialogBase * KexiInternalPart::findOrCreateKexiDialog ( KexiMainWindow * mainWin,
const char * objName )
protected

Used internally

Definition at line 103 of file kexiinternalpart.cpp.

◆ part()

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.

◆ uniqueDialog()

bool KexiInternalPart::uniqueDialog ( ) const
inline
Returns
true if the part can create only one (unique) dialog.

Definition at line 120 of file kexiinternalpart.h.

Member Data Documentation

◆ m_cancelled

bool KexiInternalPart::m_cancelled
protected

Used in cancelled().

Definition at line 157 of file kexiinternalpart.h.

◆ m_uniqueDialog

bool KexiInternalPart::m_uniqueDialog
protected

true if createDialogInstance() should return only one dialog

Definition at line 155 of file kexiinternalpart.h.

◆ m_uniqueWidget

TQGuardedPtr<TQWidget> 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 153 of file kexiinternalpart.h.


The documentation for this class was generated from the following files: