Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Examples  

qdbttextcell.h

00001 #ifndef _QDBTTEXTCELL_H
00002 #define _QDBTTEXTCELL_H
00003 
00004 #include <qstring.h>
00005 #include <qrect.h>
00006 
00007 #include <qdbt/qdbtglobal.h>
00008 #include "qdbtbasecell.h"
00009 
00010 class QPainter;
00011 class QdbtBaseTabular;
00012 
00013 class QDBT_EXPORT QdbtTextCell : public QdbtBaseCell
00014 {
00015 public:
00016   QdbtTextCell();
00017   QdbtTextCell( const QdbtTextCell & );
00018   QdbtTextCell( const QString &text, int align = Qt::AlignLeft, 
00019                 bool edit = FALSE );
00020   virtual ~QdbtTextCell();
00021   
00022   void setText( const QString &value ) { _value = value; }
00023   virtual QString text() const { return _value; }
00024   
00025   void setAlignment( int alignment ) { align = alignment; }
00026   int alignment() const { return align; }
00027   
00028   virtual int widthHint( const QFontMetrics &fm ) const;
00029   virtual int heightHint( const QFontMetrics &fm ) const;
00030   
00031 protected:
00032   virtual QWidget *editor( QdbtBaseTabular * ) const;
00033   virtual void paint( QPainter *p, QdbtBaseTabular *t, const QRect & r,
00034                       bool selected, bool editing = FALSE );
00035   virtual QRect getTextArea() const;
00036   virtual QRect getEditArea( int width ) const;
00037   virtual QdbtBaseCell *clone( QdbtBaseTabular * ) const;
00038 
00039   virtual bool beginEdit( QdbtBaseTabular *, int row, int col,
00040                           const QRect cellGeometry ) const;
00041   virtual bool acceptEdit( QdbtBaseTabular *, int row, int col );
00042   virtual bool cancelEdit( QdbtBaseTabular *, int row, int col );
00043   
00044 private:
00045   QString _value;
00046 
00047   QRect   tr;
00048   int     align;
00049 };
00050 
00051 #endif

Generated on Mon Apr 22 12:21:54 2002 for QdbtTabular by doxygen1.2.15-20020421