00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_KDEFORMFOCUS
00012 #define HK_KDEFORMFOCUS
00013 #include <hk_class.h>
00014 #include <qwidget.h>
00015 #include <qobject.h>
00016 #include <list>
00017 class hk_kdeformfocus;
00018 class hk_kdesimpleform;
00019 class hk_kdesimplereport;
00020 class hk_kdereportsection;
00021 class hk_report;
00022
00023 class hk_marker :public QWidget,hk_class
00024 {
00025 Q_OBJECT
00026 friend class hk_kdeformfocus;
00027 public:
00028 enum enum_markertype {lo,mo,ro,lm,rm,lu,mu,ru};
00029 hk_marker(hk_kdesimpleform*,hk_kdeformfocus*,hk_marker::enum_markertype);
00030
00031 hk_marker(hk_kdereportsection*,hk_kdeformfocus*,hk_marker::enum_markertype);
00032 ~hk_marker(void);
00033 void set_widget(QWidget*);
00034 enum_markertype type(void);
00035 void set_cursors(void);
00036
00037 protected:
00038 virtual void paintEvent( QPaintEvent* );
00039 virtual void mousePressEvent( QMouseEvent* );
00040 virtual void mouseMoveEvent( QMouseEvent* );
00041 private:
00042 enum_markertype p_type;
00043 QWidget* p_widget;
00044 QPoint p_originalposition;
00045 hk_kdeformfocus* p_focus;
00046 hk_kdesimpleform* p_form;
00047 hk_kdesimplereport* p_report;
00048 hk_kdereportsection* p_section;
00049 };
00050
00051 class hk_kdeformfocus :public QObject,public hk_class
00052 {
00053 Q_OBJECT
00054 friend class hk_marker;
00055 signals:
00056 void size_changed();
00057
00058 public:
00059 hk_kdeformfocus(hk_kdesimpleform*);
00060
00061 hk_kdeformfocus(hk_kdereportsection*);
00062 ~hk_kdeformfocus(void);
00063 void set_widget(QWidget*);
00064 QWidget* widget(void);
00065 void show(void);
00066 void hide(void);
00067 void set_positions(void);
00068 void repaint(void);
00069 protected:
00070 bool eventFilter(QObject* object,QEvent* event);
00071
00072 private:
00073 QWidget* p_widget;
00074 bool p_markermove;
00075 list<hk_marker*> p_markers;
00076 void marker_moved(void);
00077
00078 hk_kdereportsection* p_section;
00079 };
00080 #endif