00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef HK_KDESIMPLEREPORT_H
00013 #define HK_KDESIMPLEREPORT_H
00014 #include <hk_report.h>
00015 #include <qwidget.h>
00016 #include <list>
00017
00018 class hk_kdereportproperty;
00019 class QVBoxLayout;
00020 class KAction;
00021 class KActionMenu;
00022 class hk_kdeformfocus;
00023 class hk_kdereportsection;
00024 class hk_kdereport;
00025 class hk_kdereportpartwidget;
00026 class QProgressDialog;
00027 class QPopupMenu;
00028 class hk_kdesimplereportprivate;
00042 class hk_kdesimplereport:public QWidget, public hk_report
00043 {
00044 friend class hk_kdereport;
00045 friend class hk_kdereportpartwidget;
00046 Q_OBJECT
00047
00048 public:
00049 hk_kdesimplereport( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
00050 virtual ~hk_kdesimplereport();
00051
00052 void set_autoclose(bool c);
00053 void set_field2create(bool);
00054 bool field2create(void);
00055 void set_focus(QWidget*,hk_kdereportsection*,bool multiple);
00056 void clearfocus(void);
00057 hk_kdeformfocus* focus(void);
00058 hk_kdeformfocus* formfocus(void);
00059 virtual bool load_report(const hk_string& name="");
00060 virtual bool set_mode(enum_mode);
00061 hk_kdereport* kdereport(void);
00062 virtual void script_error(hk_visible*, hk_interpreter::enum_action);
00063
00064 bool focus_multipleselected(void) const;
00065 virtual void reset_has_changed(void);
00066 hk_kdereportpartwidget* reportpartwidget() const;
00067
00068 signals:
00069 void signalfield_created(void);
00070 void signal_has_changed(void);
00071 void signal_focuswidget_changed(void);
00072
00073 public slots:
00074 void field_created(void);
00075 void set_focus2property(void);
00076 void set_sections(void);
00077 void show_property(void);
00078 void set_for_all(enum_bulkoperation);
00079
00080 protected:
00081 virtual void set_has_changed(enum_has_changed forcesetting=standard);
00082
00083 virtual hk_reportsection* widget_specific_new_section(void);
00084 virtual void keyPressEvent ( QKeyEvent * event );
00085 virtual void keyReleaseEvent ( QKeyEvent * event);
00086 virtual void widget_specific_after_loadreport(void);
00087 virtual bool widget_specific_before_modechanges(enum_mode);
00088 bool eventFilter(QObject* object,QEvent* event);
00089
00090 bool reporteventFilter(QObject* object,QEvent* event);
00091
00092 virtual void before_source_vanishes(void);
00093 virtual void database_has_vanished(void);
00094 virtual void widget_specific_modechanges(enum_mode s);
00095 virtual void widget_specific_before_execute(void);
00096 virtual void widget_specific_after_execute(void);
00097 virtual bool widget_specific_after_new_page(void);
00098 virtual void widget_specific_presentationresize(void);
00099 virtual void widget_specific_backgroundcolour_changed(const hk_colour&);
00100 virtual void widget_specific_foregroundcolour_changed(const hk_colour&);
00101 virtual void widget_specific_fieldresize(hk_visible* v);
00102
00103 void mousemenu(QMouseEvent* m);
00104 enum enum_adjust {al,ar,at,ab,sminw,smaxw,sminh,smaxh,smaxs,smins};
00105 void adjust_widgets(enum_adjust);
00106 void resize_widget(QWidget*,enum_adjust,int minw,int maxw,int minh,int maxh,int minx,int maxx,int miny,int maxy);
00107 void repaint_focus(void);
00108
00109 protected slots:
00110 void printing_cancelled(void);
00111 void delete_widgets(void);
00112 void copy_widgets(void);
00113 void paste_widgets(void);
00114 void cut_widgets(void);
00115 void enable_actions(void);
00116
00117 private slots:
00118 void align_left(void);
00119 void align_right(void);
00120 void align_top(void);
00121 void align_bottom(void);
00122 void adjust_minw(void);
00123 void adjust_maxw(void);
00124 void adjust_minh(void);
00125 void adjust_maxh(void);
00126 void adjust_mins(void);
00127 void adjust_maxs(void);
00128
00129
00130
00131 protected:
00132 void set_kdereport(hk_kdereport*);
00133 void set_reportpartwidget(hk_kdereportpartwidget*);
00134
00135
00136 private:
00137 bool is_reportobject(QWidget*);
00138 void clearmultiplefocus(void);
00139
00140 void set_actualsection(hk_kdereportsection*);
00141 void set_propertyobject(QWidget*);
00142 void create_copydata(ostream&,QWidget*);
00143 void set_sectionsize(hk_reportsection*);
00144 hk_kdesimplereportprivate* p_private;
00145 };
00146 #endif