<HTML> <HEAD> <TITLE>Source: hk_kdeclasses/hk_kdeclasses/hk_kdetabledesign.h</TITLE> <META NAME="Generator" CONTENT="KDOC "> </HEAD> <BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff"> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE BORDER="0"> <TR><TD valign="top" align="left" cellspacing="10"> <h1>Source: hk_kdeclasses/hk_kdeclasses/hk_kdetabledesign.h</h1> </TD> <TD valign="top" align="right" colspan="1"></TD></TR> </TABLE> <HR> <TABLE BORDER="0"> </TABLE> </TD> <TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR> <TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR> <TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR> <TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR> <TR><TD><small><A HREF="index.html">Index</A></small></TD></TR> </TABLE></TD></TR></TABLE> <pre> // **************************************************************************** // copyright (c) 2000-2002 Horst Knorr <hk_classes@knoda.org> // This file is part of the hk_kdeclasses library. // This file may be distributed and/or modified under the terms of the // GNU Library Public License version 2 as published by the Free Software // Foundation and appearing in the file LGPL included in the // packaging of this file. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // **************************************************************************** #ifndef HK_KDETABLEDESIGN_H #define HK_KDETABLEDESIGN_H #include <hk_dsgrid.h> #include <hk_dsvisible.h> #include <qvariant.h> #include <qwidget.h> #include <hk_column.h> #include <qstring.h> #include <qstringlist.h> #include <list> class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QButtonGroup; class QCheckBox; class QComboBox; class QLabel; class QLineEdit; class QListView; class QListViewItem; class QPushButton; class QSpinBox; class QToolButton; class hk_kdeindexwindow; /** * *@short KDE widget to alter tables. *@version $Revision: 1.2 $ *@author Horst Knorr (hk_classes@knoda.org) *hk_kdetabledesign is a widget to interactively define and alter the *table structure. * */ class hk_kdetabledesign : public QWidget ,public hk_dsvisible { Q_OBJECT public: hk_kdetabledesign( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); virtual ~hk_kdetabledesign(); virtual void set_datasource(hk_datasource* d); hk_datasource* datasource(void); public slots: /** *call this function at the end to alter the table */ virtual bool alter_table(); virtual void load_fieldinfo(); void set_designmode(); protected slots: virtual void delete_clicked(); virtual void index_clicked(); virtual void alterbutton_clicked(); virtual void name_changed(); virtual void new_clicked(); virtual void primary_changed(); virtual void notnull_changed(); virtual void selection_changed(); virtual void indexselection_changed(); virtual void size_changed(); virtual void type_changed(); virtual void new_index(); virtual void alter_index(); virtual void delete_index(); virtual void set_indexlist(void); protected: virtual void showEvent(QShowEvent* e); virtual void list_changes(filetype type); QGridLayout* hk_kdetabledesignLayout; QHBoxLayout* Layoutindexwindow; QVBoxLayout* buttonlayout; QHBoxLayout* Layout8; QHBoxLayout* Layout7; QVBoxLayout* Layout22; QHBoxLayout* Layout25; QVBoxLayout* Layout24; QHBoxLayout* Layout23; QVBoxLayout* editlayout; QVBoxLayout* fieldbuttonlayout; QHBoxLayout* fieldtoplayout; QListView* fieldlist; QPushButton* newbutton; QPushButton* deletebutton; QPushButton* alterbutton; QPushButton* indexdeletebutton; QPushButton* indexnewbutton; QPushButton* indexalterbutton; QLabel* fieldnamelabel; QLabel* columntypelabel; QLabel* sizelabel; QLabel* notnulllabel; QLabel* primaryindexlabel; QLineEdit* namefield; QComboBox* typefield; QSpinBox* sizefield; QCheckBox* primaryfield; QCheckBox* notnullfield; QListView* indexwindow; void create_columntypelist(void); private : void structure_changes(bool c); void clear_fieldlist(void); hk_column::enum_columntype ftype(const QString&); enum enum_state {unchanged,delfield,newfield,altered}; int fieldname_count(const hk_string&); /** * returns true if name is a SQL key word */ bool is_keyword(const QString&); typedef class fieldstruct { public: hk_string oldname; bool oldprimary; bool oldnotnull; hk_column::enum_columntype oldtype; long oldsize; hk_string newname; bool newprimary; bool newnotnull; hk_column::enum_columntype newtype; long newsize; enum_state state; }; typedef class dictclass { public: QString name; hk_column::enum_columntype type; }; void show_fieldinfos(fieldstruct*); list<dictclass> columntype_dictionary; list<fieldstruct> fields; list<fieldstruct>::iterator actualfieldit; QListViewItem* lastmarkedItem; bool p_fieldlist_created; bool p_has_changed; bool fieldnamecheck; QStringList p_keywordlist; }; #endif // HK_KDETABLEdesign_H </pre> <HR> <table> <tr><td><small>Generated by: horst on horstnotebook on Wed Sep 24 10:38:50 2003, using kdoc 2.0a54.</small></td></tr> </table> </BODY> </HTML>