Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

hk_kdeclasses/hk_kdeclasses/hk_kdesimplegrid.h

Go to the documentation of this file.
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 
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         hk_kdegrid* kdegrid() const;
00059 
00060         signals:
00061         void signal_infocus(hk_kdegridpart*);
00062         void signal_outfocus(hk_kdegridpart*,QFocusEvent*);
00063         //void signal_verticalheader_mouserelease();
00064     public slots:
00068         void print_grid(void);
00069         void show_gridcolumndialog(void);
00070 
00071     protected:
00072      virtual void focusInEvent ( QFocusEvent * );
00073      virtual void focusOutEvent ( QFocusEvent * ); 
00074      virtual void    widget_specific_tooltip_changed(void);
00075         virtual void adjustRow(int){}
00076         bool eventFilter(QObject* object,QEvent* event);
00077         void widget_specific_enable_disable(void);
00078         void widget_specific_row_added(void);
00079         void widget_specific_row_deleted(void);
00080         bool widget_specific_row_change(void);
00081         void widget_specific_insert_mode(void);
00082         void columns_created(void);
00083         bool  datasource_enable(void);
00084         bool  datasource_disable(void);
00085         void activateNextCell(void);
00086         void resizeData(int len);
00087         void paintCell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00088         void paint_textcell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00089         void paint_boolcell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00090         void paint_combocell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
00091         void setCellContentFromEditor( int row, int col);
00092         QDragObject* dragObject ();
00093         void contentsDragEnterEvent(QDragEnterEvent*);
00094         void contentsDropEvent(QDropEvent*);
00095         QWidget* createEditor(int row, int col,bool initFromCell) const;
00096 //void before_row_change(void);
00097         void    keyPressEvent(QKeyEvent * );
00098         bool    key_pressevent_navigation(QKeyEvent *);
00099 
00100    public slots:
00101    void copy(void);
00102    void paste(void);
00103    void cut(void);
00104     
00105     
00106     
00107     protected slots:
00108         void row_changed(int row,int column);
00109         void set_columnwidth(int col,int,int newwidth);
00110         void column_moved(int section,int from,int to);
00111         void show_contextmenu(int row, int col,const QPoint& pos);
00112         void selection_changed(void);
00113         void slot_mouse_clicked(void);
00114         void slot_mouse_doubleclicked(void);
00115         void slot_verticalheader_resized(int,int,int);
00116         void slot_verticalheader_mouserelease(void);
00117         void widget_specific_rowheight_changes(void);
00118         void slot_content_moving(int,int);
00119     private:
00120         typedef class
00121         {
00122             public:
00123                 int start;                        //starting row or column
00124                 int end;                          //final row or column
00125                 int offset;                       // needed offset
00126         } sectionclass;
00127         void print_singlepage(QPainter&,QPaintDeviceMetrics&metrics,sectionclass& vertical,sectionclass& horizontal,int topborder,int bottomborder,int leftborder,int rightborder);
00128         void paste_tsv(const QString&);
00129         QString marked_text();
00130         void    set_statustext(void);
00131         void    nextcell();
00132         void    previouscell();
00133         bool    delete_selected_rows(void);
00134         void    clear_vertical_header(void);
00135         void    paint_vertical_header(void);
00136         QWidget* create_lineeditor(int row, int col)const;
00137         void print_frame(QPainter& painter,QPaintDeviceMetrics&metrics,int topborder,int bottomborder,int leftborder,int rightborder);
00138         int  print_header(QPainter& painter,QPaintDeviceMetrics&metrics,sectionclass& horizontal,int topborder,int bottomborder,int leftborder,int rightborder);
00139         hk_kdegrid* p_grid;
00140         QLabel*     p_statusbar;
00141 
00142         hk_kdesimplegridprivate* p_hk_kdesimplegridprivate;
00143         QPixmap arrow_image;
00144         QIconSet no_image;
00145         unsigned int p_currentrow,p_currentcolumn;
00146         mutable bool p_combobox_created;
00147         int pagenumber;
00148 };
00149 
00153 class internalcheckbox :public QFrame, public hk_dsboolean
00154 {
00155     Q_OBJECT
00156         public:
00157         internalcheckbox(QWidget* w);
00158         ~internalcheckbox();
00159     protected:
00160         void paintEvent(QPaintEvent*);
00161         void focusInEvent(QFocusEvent * f);
00162         bool datasource_enable(void);
00163         void keyPressEvent(QKeyEvent* e);
00164         void mousePressEvent(QMouseEvent* m);
00165 
00166     private slots:
00167         void    blinkcursorslot(void);
00168 
00169     private:
00170         void blinkon();
00171         QTimer      p_blinktimer;
00172         bool p_cursoron;
00173         int p_blinkspeed;
00174 };
00175 #endif

Generated on Thu Mar 9 18:40:41 2006 for hk_classes by  doxygen 1.4.1