kexi
kexialtertabledialog.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KEXIALTERTABLEDIALOG_H
00021 #define KEXIALTERTABLEDIALOG_H
00022
00023 #include <kexidatatable.h>
00024 #include "kexitablepart.h"
00025
00026 class KexiTableItem;
00027 class KexiAlterTableDialogPrivate;
00028
00029 namespace KoProperty {
00030 class Set;
00031 class Property;
00032 }
00033
00034 class KexiAlterTableDialog : public KexiDataTable
00035 {
00036 Q_OBJECT
00037
00038 public:
00040 KexiAlterTableDialog(KexiMainWindow *win, QWidget *parent,
00041 const char *name = 0);
00042
00043 virtual ~KexiAlterTableDialog();
00044
00045 KexiTablePart::TempData* tempData() const;
00046
00047
00048
00049
00050
00051
00052
00053 protected slots:
00056 void updateActions();
00057
00058
00059 virtual void slotUpdateRowActions(int row);
00060
00062 void slotBeforeCellChanged(KexiTableItem *item, int colnum,
00063 QVariant& newValue, KexiDB::ResultInfo* result);
00064
00066 void slotRowUpdated(KexiTableItem *item);
00067
00069 void slotAboutToInsertRow(KexiTableItem* item, KexiDB::ResultInfo* result, bool repaint);
00070
00072 void slotAboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool repaint);
00073
00076 void slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property);
00077
00080 void slotTogglePrimaryKey();
00081
00082
00083
00084
00085
00086
00087
00088 protected:
00089 virtual void updateActions(bool activated);
00090
00092 void initData();
00093
00098 KoProperty::Set* createPropertySet( int row, KexiDB::Field *field, bool newOne = false );
00099
00100 virtual tristate beforeSwitchTo(int mode, bool &dontStore);
00101 virtual tristate afterSwitchFrom(int mode);
00102
00105 virtual KoProperty::Set *propertySet();
00106
00107 void removeCurrentPropertySet();
00108
00110 virtual KexiDB::SchemaData* storeNewData(const KexiDB::SchemaData& sdata, bool &cancel);
00111
00113 virtual tristate storeData(bool dontAsk = false);
00114
00115 tristate buildSchema(KexiDB::TableSchema &schema);
00116
00117 QString messageForSavingChanges(bool &emptyTable);
00118
00123 void setPrimaryKey(KoProperty::Set &propertySet, bool set, bool aWasPKey = false);
00124
00126 void getSubTypeListData(KexiDB::Field::TypeGroup fieldTypeGroup,
00127 QStringList& stringsList, QStringList& namesList);
00128
00129 private:
00130 KexiAlterTableDialogPrivate *d;
00131 };
00132
00133 #endif
00134
|