Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

hk_kdesimplegrid.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2004 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 
00012 #ifndef HK_KDESIMPLEGRID
00013 #define HK_KDESIMPLEGRID
00014 #include <hk_dsvisible.h>
00015 #include <qheader.h>
00016 #include <qtimer.h>
00017 #include <qtable.h>
00018 #include <qgridview.h>
00019 #include <hk_dsboolean.h>
00020 
00021 #include <hk_kderowselector.h>
00022 class hk_kdesimpleform;
00023 class hk_kdesimplegrid;
00024 class hk_kdegridpart;
00025 class hk_kdegrid;
00026 class QLabel;
00027 class hk_column;
00028 class hk_kdelineedit;
00029 class hk_kdesimplegridprivate;
00047 class hk_kdesimplegrid :public QTable, public hk_dsvisible
00048 {
00049     Q_OBJECT
00050         friend class hk_kdegrid;
00051     public:
00052         hk_kdesimplegrid(hk_kdegrid* grid, QLabel* statusbar, hk_kdesimpleform* form=NULL);
00053         virtual  ~hk_kdesimplegrid(void);
00054         virtual  QTableItem* item(int row,int col) const;
00055         virtual void sortColumn ( int col, bool ascending = true, bool wholeRows = false );
00056         hk_column* actual_column(void);
00057         QString text(int row, int col) const;
00058 
00059         signals:
00060         void signal_infocus(hk_kdegridpart*);
00061         void signal_outfocus(hk_kdegridpart*);
00062         //void signal_verticalheader_mouserelease();
00063     public slots:
00067         void print_grid(void);
00068         void show_gridcolumndialog(void);
00069 
00070     protected:
00071         virtual void adjustRow(int){}
00072         bool eventFilter(QObject* object,QEvent* event);
00073         void widget_specific_enable_disable(void);
00074         void widget_specific_row_added(void);
00075         void widget_specific_row_deleted(void);
00076         bool widget_specific_row_change(void);
00077         void widget_specific_insert_mode(void);
00078         void columns_created(void);
00079         bool  datasource_enable(void);
00080         bool  datasource_disable(void);
00081         void activateNextCell(void);
00082         void resizeData(int len);
00083         void paintCell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00084         void paint_textcell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00085         void paint_boolcell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00086         void paint_combocell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00087         void setCellContentFromEditor( int row, int col);
00088         QDragObject* dragObject ();
00089         void contentsDragEnterEvent(QDragEnterEvent*);
00090         void contentsDropEvent(QDropEvent*);
00091         QWidget* createEditor(int row, int col,bool initFromCell) const;
00092 //void before_row_change(void);
00093 void focusOutEvent ( QFocusEvent * );
00094 void focusInEvent ( QFocusEvent * );
00095         void    keyPressEvent(QKeyEvent * );
00096         bool    key_pressevent_navigation(QKeyEvent *);
00097 
00098 
00099    public slots:
00100    void copy(void);
00101    void paste(void);
00102    void cut(void);
00103 
00104     protected slots:
00105         void row_changed(int row,int column);
00106         void set_columnwidth(int col,int,int newwidth);
00107         void column_moved(int section,int from,int to);
00108         void show_contextmenu(int row, int col,const QPoint& pos);
00109         void selection_changed(void);
00110         void slot_mouse_clicked(void);
00111         void slot_mouse_doubleclicked(void);
00112         void slot_verticalheader_resized(int,int,int);
00113         void slot_verticalheader_mouserelease(void);
00114         void widget_specific_rowheight_changes(void);
00115     private:
00116         typedef class
00117         {
00118             public:
00119                 int start;                        //starting row or column
00120                 int end;                          //final row or column
00121                 int offset;                       // needed offset
00122         } sectionclass;
00123         void print_singlepage(QPainter&,QPaintDeviceMetrics&metrics,sectionclass& vertical,sectionclass& horizontal,int topborder,int bottomborder,int leftborder,int rightborder);
00124         void paste_tsv(const QString&);
00125         QString marked_text();
00126         void    set_statustext(void);
00127         void    nextcell();
00128         void    previouscell();
00129         bool    delete_selected_rows(void);
00130         QWidget* create_lineeditor(int row, int col)const;
00131         void print_frame(QPainter& painter,QPaintDeviceMetrics&metrics,int topborder,int bottomborder,int leftborder,int rightborder);
00132         int  print_header(QPainter& painter,QPaintDeviceMetrics&metrics,sectionclass& horizontal,int topborder,int bottomborder,int leftborder,int rightborder);
00133         hk_kdegrid* p_grid;
00134         QLabel*     p_statusbar;
00135 
00136         hk_kdesimplegridprivate* p_hk_kdesimplegridprivate;
00137         QPixmap arrow_image;
00138         QIconSet no_image;
00139         unsigned int p_currentrow;
00140         mutable bool p_combobox_created;
00141         int pagenumber;
00142 };
00143 
00147 class internalcheckbox :public QFrame, public hk_dsboolean
00148 {
00149     Q_OBJECT
00150         public:
00151         internalcheckbox(QWidget* w);
00152         ~internalcheckbox();
00153     protected:
00154         void paintEvent(QPaintEvent*);
00155         void focusInEvent(QFocusEvent * f);
00156         bool datasource_enable(void);
00157         void keyPressEvent(QKeyEvent* e);
00158         void mousePressEvent(QMouseEvent* m);
00159 
00160     private slots:
00161         void    blinkcursorslot(void);
00162 
00163     private:
00164         void blinkon();
00165         QTimer      p_blinktimer;
00166         bool p_cursoron;
00167         int p_blinkspeed;
00168 };
00169 #endif

Generated on Tue Mar 22 23:28:15 2005 for Databasehandlingdialogclasses by  doxygen 1.4.1