Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > a86327fd014dc28b8b792dc8f310a4d6 > files > 141

libhk_classes5-devel-0.6.2a-3mdk.i586.rpm

<HTML>
<HEAD>
<TITLE>Source: hk_kdeclasses/hk_kdeclasses/hk_kdesimplegrid.h</TITLE>

<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
	<TABLE BORDER="0">
		<TR><TD valign="top" align="left" cellspacing="10">
		<h1>Source: hk_kdeclasses/hk_kdeclasses/hk_kdesimplegrid.h</h1>
		</TD>
		<TD valign="top" align="right" colspan="1"></TD></TR>
	</TABLE>
	<HR>
	<TABLE BORDER="0">
		
	</TABLE>
	</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<pre>
// ****************************************************************************
// copyright (c) 2000-2002 Horst Knorr <hk_classes@knoda.org>
// This file is part of the hk_kdeclasses library.
// This file may be distributed and/or modified under the terms of the
// GNU Library Public License version 2 as published by the Free Software
// Foundation and appearing in the file LGPL included in the
// packaging of this file.
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// ****************************************************************************

#ifndef HK_KDESIMPLEGRID
#define HK_KDESIMPLEGRID
#include <hk_dsvisible.h>
#include <qheader.h>
#include <qtimer.h>
#include <qtable.h>
#include <qgridview.h>
#include <hk_dsboolean.h>

#include <hk_kderowselector.h>
class hk_kdesimpleform;
class hk_kdesimplegrid;
class hk_kdegridpart;
class hk_kdegrid;
class QLabel;
class hk_column;
class hk_kdelineedit;
/**
 *
 *@short KDE Widget to display data in a grid.
 *@version $Revision: 1.2 $
 *@author Horst Knorr (hk_classes@knoda.org)
 *
 *@internal
 *
 *This widget shows data of a datasource in a grid.
 *If the data is not readonly you can edit the data just by typing
 *in the cell.
 *Usually you don't have to use this widget, use @ref hk_kdegrid instead.
 *This widget has no rowselector.
 *You can navigate through the cells via mouse clicks or keyboard.

 */

class hk_kdesimplegrid :public QTable, public hk_dsvisible
{
    Q_OBJECT
        friend class hk_kdegrid;
    public:
        hk_kdesimplegrid(hk_kdegrid* grid, QLabel* statusbar, hk_kdesimpleform* form=NULL);
        virtual  ~hk_kdesimplegrid(void);
        virtual  QTableItem* item(int row,int col) const;
        virtual void sortColumn ( int col, bool ascending = true, bool wholeRows = false );
        hk_column* actual_column(void);
        QString text(int row, int col) const;
        void show_gridcolumndialog(void);

	signals:
	void signal_infocus(hk_kdegridpart*);
	void signal_outfocus(hk_kdegridpart*);
    public slots:
/**
 *prints the whole grid using KPrinter
 */
        void print_grid(void);

    protected:
        void widget_specific_enable_disable(void);
        void widget_specific_row_added(void);
        void widget_specific_row_deleted(void);
        bool widget_specific_row_change(void);
        void widget_specific_insert_mode(void);
	void columns_created(void);
        bool  datasource_enable(void);
        bool  datasource_disable(void);
        void activateNextCell(void);
        void resizeData(int len);
        void paintCell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
        void paint_textcell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
        void paint_boolcell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
        void paint_combocell(QPainter* p,int row, int col, const QRect& cr,bool selected,const QColorGroup &cg);
        void setCellContentFromEditor( int row, int col);
        QDragObject* dragObject ();
        void contentsDragEnterEvent(QDragEnterEvent*);
        void contentsDropEvent(QDropEvent*);
        QWidget* createEditor(int row, int col,bool initFromCell) const;
//void before_row_change(void);
void focusOutEvent ( QFocusEvent * );
void focusInEvent ( QFocusEvent * );
        void    keyPressEvent(QKeyEvent * );
        bool    key_pressevent_navigation(QKeyEvent *);

        bool eventFilter( QObject * o, QEvent * );

    protected slots:
        void row_changed(int row,int column);
        void set_columnwidth(int col,int,int newwidth);
        void column_moved(int section,int from,int to);
        void show_contextmenu(int row, int col,const QPoint& pos);
        void selection_changed(void);
	void slot_mouse_clicked(void);
	void slot_mouse_doubleclicked(void);
    private:
        typedef class
        {
            public:
                int start;                        //starting row or column
                int end;                          //final row or column
                int offset;                       // needed offset
        } sectionclass;
        void print_singlepage(QPainter&,QPaintDeviceMetrics&metrics,sectionclass& vertical,sectionclass& horizontal,int topborder,int bottomborder,int leftborder,int rightborder);
        void paste_tsv(const QString&);
	QString marked_text();
        void    set_statustext(void);
        void    nextcell();
        void    previouscell();
        bool    delete_selected_rows(void);
        QWidget* create_lineeditor(int row, int col)const;
        void print_frame(QPainter& painter,QPaintDeviceMetrics&metrics,int topborder,int bottomborder,int leftborder,int rightborder);
        int  print_header(QPainter& painter,QPaintDeviceMetrics&metrics,sectionclass& horizontal,int topborder,int bottomborder,int leftborder,int rightborder);
        hk_kdegrid* p_grid;
        QLabel*     p_statusbar;

        class hk_kdesimplegridprivate;
        hk_kdesimplegridprivate* p_hk_kdesimplegridprivate;
        QPixmap arrow_image;
        QIconSet no_image;
        unsigned int p_currentrow;
        mutable bool p_combobox_created;
        int pagenumber;
};

/**
 *@internal
 */
class internalcheckbox :public QFrame, public hk_dsboolean
{
    Q_OBJECT
        public:
        internalcheckbox(QWidget* w);
        ~internalcheckbox();
    protected:
        void paintEvent(QPaintEvent*);
        void focusInEvent(QFocusEvent * f);
        bool datasource_enable(void);
        void keyPressEvent(QKeyEvent* e);
        void mousePressEvent(QMouseEvent* m);

    private slots:
        void    blinkcursorslot(void);

    private:
        void blinkon();
        QTimer      p_blinktimer;
        bool p_cursoron;
        int p_blinkspeed;
};
#endif
</pre>
<HR>
	<table>
	<tr><td><small>Generated by: horst on horstnotebook on Wed Sep 24 10:38:50 2003, using kdoc 2.0a54.</small></td></tr>
	</table>
</BODY>
</HTML>