00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef HK_KDESIMPLEFORM_H
00013 #define HK_KDESIMPLEFORM_H
00014 #include "hk_form.h"
00015 #include <qwidget.h>
00016 #include <kparts/partmanager.h>
00017 class hk_kdeformfocus;
00018 class hk_kdeproperty;
00019 class hk_kdeform;
00020 class hk_kdeformpartwidget;
00021 class QPopupMenu;
00022 class KAction;
00023 class KActionMenu;
00024 class hk_kdegridpart;
00025 class hk_kdesimpleformprivate;
00026 class KActionCollection;
00027
00041 class hk_kdesimpleform :public QWidget,public hk_form
00042 {
00043 Q_OBJECT
00044 friend class hk_kdeform;
00045 friend class hk_kdeformpartwidget;
00046 public:
00047 hk_kdesimpleform(QWidget* wid,const char* n=0,WFlags f=0);
00048 virtual ~hk_kdesimpleform(void);
00052 void set_autoclose(bool c){p_autoclose=c;}
00053 virtual bool set_mode(enum_mode s);
00054 hk_kdeproperty* propertyeditor(void);
00055 hk_kdeform* kdeform()const ;
00056 hk_kdeformpartwidget* formpartwidget() const;
00057 void set_focus(QWidget*, bool control);
00058 virtual void script_error(hk_visible*, hk_interpreter::enum_action);
00059
00060 KParts::PartManager* partsmanager()const{return p_partsmanager;}
00061 bool focus_multipleselected(void) const;
00062 enum enum_adjust {al,ar,at,ab,sminw,smaxw,sminh,smaxh,smaxs,smins};
00063 virtual void reset_has_changed(void);
00064 virtual void goto_taborder_next();
00065 virtual void goto_taborder_previous();
00066 virtual void goto_taborder_first();
00067 virtual void goto_taborder_last();
00068 virtual void set_focus(hk_visible*);
00069 void hide();
00070 virtual void show_widget(void);
00071 virtual void hide_widget(void);
00072 virtual bool close_widget(void);
00073 void set_create_with_label(bool);
00074 bool create_with_label(void) const;
00075
00076 signals:
00077 void mouseclick(const QPoint&);
00078 void field_created(void);
00079 void signal_closed(QWidget*);
00080 void signal_focuswidget_changed(void);
00081 void signal_has_changed(void);
00082
00083 public slots:
00084 void set_field2create(enum_visibletype);
00085 hk_kdeformfocus* formfocus(void)const {return p_focus;}
00086 virtual void show_property(void);
00087 void set_for_all(enum_bulkoperation);
00088 void copy(void);
00089 void paste(void);
00090 void cut(void);
00091 void adjust_widgets(enum_adjust);
00092 void align_left(void);
00093 void align_right(void);
00094 void align_top(void);
00095 void align_bottom(void);
00096 void adjust_minw(void);
00097 void adjust_maxw(void);
00098 void adjust_minh(void);
00099 void adjust_maxh(void);
00100 void adjust_mins(void);
00101 void adjust_maxs(void);
00102 void delete_widgets(void);
00103 void copy_widgets(void);
00104 void paste_widgets(void);
00105 void cut_widgets(void);
00106 void enable_actions(void);
00107 void grid_partinfocus(hk_kdegridpart*);
00108 void grid_partoutfocus(hk_kdegridpart*,QFocusEvent*);
00109 void dbdesignaction(void);
00110 void designer_deleted(void);
00111 void load_form(const hk_string& name="");
00112 virtual bool show_asdialog(hk_form* parentform=NULL);
00113 virtual int screen_width();
00114 virtual int screen_height();
00115
00116 protected:
00117 virtual void closeEvent ( QCloseEvent* e);
00118 virtual void focusInEvent ( QFocusEvent * );
00119 virtual void focusOutEvent ( QFocusEvent * );
00120 virtual void widget_specific_tooltip_changed(void);
00121 virtual bool focusNextPrevChild(bool forward);
00122 virtual void set_has_changed(enum_has_changed forcesetting=standard);
00123 void set_kdeform(hk_kdeform*);
00124 void set_formpartwidget(hk_kdeformpartwidget*);
00125 void set_actions(KActionCollection*);
00126 bool has_already_focus(QWidget*);
00127 virtual bool widget_specific_coordinates(uint px,uint py,uint pwidth,uint pheight);
00128
00129 virtual hk_dsgrid* widget_specific_new_grid(void);
00130 virtual hk_dsrowselector* widget_specific_new_rowselector(void);
00131 virtual hk_dslineedit* widget_specific_new_lineedit(void);
00132 virtual hk_dsboolean* widget_specific_new_bool(void);
00133 virtual hk_dsmemo* widget_specific_new_memo(void);
00134 virtual hk_button* widget_specific_new_button(void);
00135 virtual hk_dscombobox* widget_specific_new_combobox(void);
00136 virtual hk_label* widget_specific_new_label(void);
00137 virtual hk_subform* widget_specific_new_subform(void);
00138 virtual void widget_specific_fieldresize(hk_visible* v);
00139 virtual void widget_specific_presentationresize(void);
00140 virtual void before_source_vanishes(void);
00141 virtual void widget_specific_modechanges(enum_mode);
00142 virtual void widget_specific_presentationdatasource(long);
00143 virtual void widget_specific_after_loadform(void);
00144 virtual void widget_specific_backgroundcolour_changed(const hk_colour&);
00145 virtual void widget_specific_foregroundcolour_changed(const hk_colour&);
00146 virtual hk_dsdate* widget_specific_new_date(void);
00147 virtual hk_dsimage* widget_specific_new_image(void);
00148 virtual hk_tabvisible* widget_specific_new_tabvisible(void);
00149 virtual void widget_specific_enabled_changed(void);
00150 virtual void database_has_vanished(void);
00151
00152 virtual void paintEvent(QPaintEvent*);
00153 virtual void mousePressEvent(QMouseEvent*);
00154 virtual void mouseReleaseEvent(QMouseEvent*);
00155 virtual void mouseDoubleClickEvent(QMouseEvent*);
00156
00157 virtual void keyPressEvent ( QKeyEvent * );
00158 virtual void keyReleaseEvent ( QKeyEvent * );
00159 bool eventFilter(QObject* object,QEvent* event);
00160 bool formeventFilter(QObject* object,QEvent* event);
00161 void move_widgets(int xdiff,int ydiff);
00162 protected slots:
00163 virtual void done(void);
00164
00165 private:
00166
00167
00168 private slots:
00169
00170 private:
00171 bool is_formobject(QWidget*);
00172 hk_visible* create_field(const QPoint&);
00173 void clearmultiplefocus(void);
00174 void clearfocus(void);
00175 void mousemenu(QMouseEvent*);
00176 void resize_widget(QWidget*,enum_adjust,int minw,int maxw,int minh,int maxh,int minx,int maxx,int miny,int maxy);
00177 void repaint_focus(void);
00178 void create_copydata(ostream&,QWidget*);
00179 bool p_autoclose;
00180 bool p_sourcevanishflag;
00181 enum_visibletype p_field2create;
00182 hk_kdeformfocus* p_focus;
00183 list<hk_kdeformfocus*> p_multiplefocus;
00184 bool p_createflag;
00185 QPoint p_originalposition;
00186
00187 hk_kdeproperty* p_property;
00188 hk_kdeform* p_kdeform;
00189 hk_kdeformpartwidget* p_formpartwidget;
00190 QPopupMenu* p_popup;
00191 KParts::PartManager* p_partsmanager;
00192 KAction* p_deleteaction;
00193 KAction* p_copyaction;
00194 KAction* p_pasteaction;
00195 KAction* p_cutaction;
00196 KAction* p_formpropertyaction;
00197 KActionMenu* p_resizeaction;
00198 KAction* p_minwidthaction;
00199 KAction* p_maxwidthaction;
00200 KAction* p_minheightaction;
00201 KAction* p_maxheightaction;
00202 KAction* p_minsizeaction;
00203 KAction* p_maxsizeaction;
00204 KActionMenu* p_alignaction;
00205 KAction* p_alignleftaction;
00206 KAction* p_alignrightaction;
00207 KAction* p_aligntopaction;
00208 KAction* p_alignbottomaction;
00209 hk_kdesimpleformprivate* p_private;
00210 void set_currentobject(hk_visible* );
00211
00212
00213 };
00214 #endif