00001 #ifndef _QDBTTABULAR_H
00002 #define _QDBTTABULAR_H
00003
00004 #include <qobject.h>
00005 #include <qstringlist.h>
00006 #include <qvaluelist.h>
00007
00008 #include <qdbt/qdbtglobal.h>
00009 #include "qdbtbasetabular.h"
00010
00011 class QdbtTableCell;
00012
00013 class QDBT_EXPORT QdbtTabular : public QdbtBaseTabular
00014 {
00015 Q_OBJECT
00016
00017 QStringList _regExpPattern;
00018 QValueList<int> _columnNames;
00019
00020 public:
00021 enum TraverseMode { TRAV_ANY = 0, TRAV_LOCK_ROW = 1, TRAV_LOCK_COL = 2,
00022 TRAV_CELL_LOCK = TRAV_LOCK_ROW | TRAV_LOCK_COL };
00023
00024 QdbtTabular( QWidget *parent = 0, const char *name = 0, WFlags w = 0 );
00025 ~QdbtTabular();
00026
00027 const QdbtTableCell *cell( int row, int col );
00028
00029 void changeCell( const QdbtTableCell *tc, int row, int col );
00030 void changeCell( QString text, const QPixmap *p, int row, int col,
00031 const QColor &color = QColor(),
00032 int align = Qt::AlignLeft, bool editable = FALSE );
00033 void changeCell( QString text, int row, int col,
00034 const QColor &color = QColor(),
00035 int align = Qt::AlignLeft, bool editable = FALSE );
00036 void changeCell( const QPixmap *pixmap, int row, int col,
00037 int align = Qt::AlignLeft );
00038
00039 void setHeaderAppearance( int header_mode );
00040
00041 void selectByRow( bool enable );
00042
00043 void setMultiSelect( bool enable );
00044 bool multiSelect();
00045
00046 void setAllowDeselect( bool deselect );
00047 bool allowDeselect() const;
00048
00049 void setFollowKeyboardFocus( bool follow );
00050 bool followKeyboardFocus() const;
00051
00052 bool headerVisible() const;
00053 bool cascadeVisible() const;
00054
00055 void setColumnPattern( int col, QString pattern );
00056 QString columnPattern( int col );
00057
00058 int columnIdentifier( int col );
00059 void setColumnIdentifier( int col, int identifier );
00060 int columnForIdentfier( int id );
00061
00062 virtual void setDimensions( int rows, int cols );
00063 virtual void insertCol( int col = -1 );
00064 virtual void removeCol( int col );
00065 virtual void exchangeCols( int col1, int col2 );
00066
00067 void setTraverseMode( int mode );
00068 TraverseMode traverseMode() const;
00069
00070 void setScrollbarVisible( bool vertical, bool visible );
00071
00072 bool rowSelectable( int row ) const;
00073 void setRowSelectable( int row, bool enable );
00074
00075 signals:
00076 void cellEdited( int, int );
00077
00078 public slots:
00079 void clear();
00080
00081 void setYOffset( int offset );
00082 void setXOffset( int offset );
00083 void setHeaderVisible( bool visible );
00084 void setCascadeVisible( bool visible );
00085 void enableTooltips();
00086 void disableTooltips();
00087 void setColumnWidth( int col, int width );
00088
00089 private slots:
00090 void cellEditDone( int row, int col, int action );
00091 };
00092
00093
00094 #endif