|
|
// ########################################################################## // #### #### // #### Prüfungsamt-Client #### // #### ============================ #### // #### #### // #### Tupel-Editor #### // #### #### // #### Version 1.00 -- 25. Juni 2000 #### // #### #### // #### Copyright (C) 2000 Thomas Dreibholz #### // #### Universität Bonn #### // #### EMail: Dreibholz@bigfoot.com #### // #### WWW: http://www.bigfoot.com/~dreibholz #### // #### #### // ########################################################################## #ifndef TUPLEEDITOR_H #define TUPLEEDITOR_H #include "system.h" #include "paclient.h" #include "tableviewer.h" #include "attributeeditor.h" #include <qapp.h> #if QT_VERSION < 210 #error ERROR: QT Version 2.1 or better required!!! #endif #include <qstring.h> #include <qlabel.h> #include <qwhatsthis.h> class TableViewer; class AttributeEditor; /** * Die Tuple-Struktur speichert Informationen für den Tupel-Editor. * * @short Tuple * @author Thomas Dreibholz (Dreibholz@bigfoot.com) * @version 1.0 */ struct Tuple { static const cardinal MaxAttributes = 32; QString ID; QString TableName; const ViewEntry* View; cardinal Attributes; QString Attribute[MaxAttributes]; bool IsKey[MaxAttributes]; QString Value[MaxAttributes]; }; /** * TupleEditor ist ein Qt-Widget für den Tupel-Editor. * * @short Tuple Editor * @author Thomas Dreibholz (Dreibholz@bigfoot.com) * @version 1.0 */ class TupleEditor : public QWidget { Q_OBJECT // ====== Constructor/Destructor ========================================= public: /** * Constructor. * * @param connection Datenbank-Verbindung. * @param tuple Tuple-Struktur, die zu editierendes Tupel beschreibt. * @param newTuple true, um neues Tupel zu erzeugen; false sonst. * @param joinAttribute Join-Attribut. * @param parent Parent QWidget; default: NULL. * @param name Widget-Name; default: NULL. */ TupleEditor(SQLConnectionInterface* connection, Tuple* tuple, const bool newTuple, const QString& joinAttribute, QWidget* parent = NULL, const char* name = NULL); /** * Destructor. */ ~TupleEditor(); // ====== Tupel-Struktur zurückgeben ===================================== /** * Rückgabe der Tuple-Struktur des Editors. * * @return Tuple */ const Tuple* getTuple() const; // ====== Slots für Qt =================================================== public slots: /** * Qt-Slot: Update bzw. Insert durchführen. */ void update(); /** * Qt-Slot: Delete durchführen. */ void remove(); /** * Qt-Slot: Abbrechen. */ void abort(); // ====== Signale für Qt ================================================= signals: /** * Qt-Signal: Editieren beendet. */ void done(TupleEditor* editor, const bool commited); // ====== Private Daten ================================================== private: void closeEvent(QCloseEvent* event); SQLConnectionInterface* Connection; QWhatsThis* WhatsThis; QLabel* StatusBar; AttributeEditor** AttrEdit; Tuple* EditorTuple; TableViewer* Selector; int SelectorID; bool NewTuple; }; #endif
Generated by: viper@odin on Wed Jul 12 17:11:55 2000, using kdoc 2.0a22. |