hk_kdedblistview.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
00003 // This file is part of the hk_kdeclasses library.
00004 // This file may be distributed and/or modified under the terms of the
00005 // GNU Library Public License version 2 as published by the Free Software
00006 // Foundation and appearing in the file LGPL included in the
00007 // packaging of this file.
00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00010 // ****************************************************************************
00011  //$Revision: 1.12 $
00012 
00013 #ifndef HK_KDEDBLISTVIEW_H
00014 #define HK_KDEDBLISTVIEW_H
00015 #include <klistview.h>
00016 #include <qdialog.h>
00017 #include <qdragobject.h>
00018 
00019 #include <hk_dbvisible.h>
00020 
00021 class hk_kdedblistviewprivate;
00022 class QProgressDialog;
00023 class hk_kdeschemadialog;
00024 class QVBoxLayout;
00025 class QHBoxLayout;
00026 class QGridLayout;
00027 class QButtonGroup;
00028 class QLabel;
00029 class QPushButton;
00030 class QRadioButton;
00031 class KAction;
00032 class KActionMenu;
00033 class QPopupMenu;
00034 
00035 
00036 
00037 
00038 class hk_dbviewerdrag : public QStoredDrag
00039 {
00040 public:
00041 
00042 hk_dbviewerdrag(objecttype type,const QString& object,hk_database* db,QWidget* dragsource=0);
00043 static  bool canDecode(const QMimeSource* s);
00044 const char* format(int i) const;
00045 
00046 private:
00047 void create_draginfo(objecttype type,const QString& object,hk_database* db);
00048 };
00049 
00050 
00051 class hk_kdedblistview: public KListView, public hk_dbvisible
00052 {
00053 Q_OBJECT
00054 public:
00055 hk_kdedblistview (QWidget* parent=0L, const char* name=0L);
00056 virtual ~hk_kdedblistview();
00057 void set_database(hk_database*);
00058 bool is_tableitem(QListViewItem*,bool includingheader=false);
00059 bool is_queryitem(QListViewItem*,bool includingheader=false);
00060 bool is_viewitem(QListViewItem*,bool includingheader=false);
00061 bool is_formitem(QListViewItem*,bool includingheader=false);
00062 bool is_reportitem(QListViewItem*,bool includingheader=false);
00063 bool is_moduleitem(QListViewItem*,bool includingheader=false);
00064 bool is_databaseitem(QListViewItem*);
00065 bool is_headeritem(QListViewItem*);
00066 bool is_tableitem(bool includingheader=false);
00067 bool is_queryitem(bool includingheader=false);
00068 bool is_viewitem(bool includingheader=false);
00069 bool is_formitem(bool includingheader=false);
00070 bool is_reportitem(bool includingheader=false);
00071 bool is_moduleitem(bool includingheader=false);
00072 bool is_databaseitem(void);
00073 bool is_headeritem(void);
00074 bool is_tableheader(void);
00075 bool is_queryheader(void);
00076 bool is_viewheader(void);
00077 bool is_formheader(void);
00078 bool is_reportheader(void);
00079 bool is_tableheader(QListViewItem*);
00080 bool is_queryheader(QListViewItem*);
00081 bool is_viewheader(QListViewItem*);
00082 bool is_formheader(QListViewItem*);
00083 bool is_reportheader(QListViewItem*);
00084 bool is_moduleheader(QListViewItem*);
00085 bool cancel(void){return p_cancelcopying;}
00086 void reload_lists(void);
00087 enum enum_showmode {sm_all,sm_central,sm_local};
00088 
00089 void set_showmode(enum_showmode);
00090 enum_showmode showmode(void) const;
00091 
00092 static void set_use_singleclick(bool);
00093 static bool use_singleclick(void) ;
00094 
00095 
00096 
00097 signals:
00098 
00099  void signal_new_database(void);
00100  void signal_delete_database(const QString&);
00101  void signal_reload_databases(void);
00102 
00103  void signal_new_table(void);
00104  void signal_delete_table(const QString&);
00105  void signal_designmode_table(const QString&);
00106  void signal_viewmode_table(const QString&);
00107 
00108  void signal_new_view(void);
00109  void signal_delete_view(const QString&);
00110  void signal_designmode_view(const QString&);
00111  void signal_viewmode_view(const QString&);
00112 
00113  void signal_new_query(void);
00114  void signal_delete_query(const QString&);
00115  void signal_designmode_query(const QString&);
00116  void signal_viewmode_query(const QString&);
00117 
00118  void signal_new_form(void);
00119  void signal_delete_form(const QString&);
00120  void signal_designmode_form(const QString&);
00121  void signal_viewmode_form(const QString&);
00122 
00123  void signal_new_report(void);
00124  void signal_delete_report(const QString&);
00125  void signal_designmode_report(const QString&);
00126  void signal_viewmode_report(const QString&);
00127 
00128 
00129  void signal_new_module(void);
00130  void signal_delete_module(const QString&);
00131  void signal_designmode_module(const QString&);
00132 
00133 public slots:
00134 virtual void new_clicked();
00135 virtual void start_clicked();
00136 virtual void alter_clicked();
00137 virtual void delete_clicked();
00138         void copy(void);
00139         void paste(void);
00140         void copying_cancelled();
00141 
00142 
00143 protected slots:
00144 
00145 void item_clicked(QListViewItem*);
00146 void item_doubleclicked(QListViewItem*);
00147 void slot_drop(QDropEvent*);
00148 
00149 
00150 protected:
00151 static  bool set_progress(long int,long int,const hk_string&);
00152         QDragObject* dragObject ();
00153 
00154         void item_selected(QListViewItem* );
00155 virtual void list_changes(listtype type);
00156 
00157 // virtual void contentsmouseReleaseEvent(QMouseEvent*);
00158 // virtual void contentsmouseMoveEvent(QMouseEvent*);
00159  virtual bool acceptDrag(QDropEvent*) const;
00160  //void dragEnterEvent(QDragEnterEvent*);
00161 
00162  bool decode_action(QMimeSource* event);
00163  bool copy_presentationfile(void);
00164  bool copy_table(void);
00165  bool copy_view(void);
00166  bool copy_database(void);
00167  hk_connection* find_connection(void);
00168 
00169 private:
00170 objecttype current_objecttype();
00171 void init_listview(void);
00172 void set_databasename(void);
00173 void set_tables(void);
00174 void set_views(void);
00175 void set_queries(void);
00176 void set_forms(void);
00177 void set_reports(void);
00178 void set_modules(void);
00179 bool execute_action(void);
00180 hk_kdedblistviewprivate* p_private;
00181 static QProgressDialog* p_progressdialog;
00182 static bool p_cancelcopying;
00183 static bool p_use_singleclick;
00184 };
00185 
00186 class hk_kdeschemadialog : public QDialog
00187 {
00188     Q_OBJECT
00189 
00190         public:
00191         hk_kdeschemadialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
00192         ~hk_kdeschemadialog();
00193 
00194         QButtonGroup* ButtonGroup1;
00195         QRadioButton* schemaonlyfield;
00196         QRadioButton* datafield;
00197         QPushButton* buttonOk;
00198         QPushButton* buttonCancel;
00199 
00200     protected:
00201         QHBoxLayout* hk_kdeschemadialogLayout;
00202         QVBoxLayout* ButtonGroup1Layout;
00203         QVBoxLayout* Layout2;
00204 };
00205 
00206 
00207 #endif //HK_KDEDBLISTVIEW_H

Generated on Tue Sep 25 22:39:06 2007 for Databasehandlingdialogclasses by  doxygen 1.5.3