00001 // Class QTextEdit 00002 // Filename QTextEdit.h 00003 // FaPra 2003-2004, A5, Alexander Kramer 00004 00005 #ifndef QTextEdit_h 00006 #define QTextEdit_h 00007 00008 #include "QWidget.h" 00009 00010 //! Pre-declaration of QTextEdit 00011 class QTextEdit; 00012 00013 00014 00015 #include "QFont.h" 00016 00017 //! Text edit widget 00018 class QTextEdit : public QWidget 00019 { 00020 protected: 00021 //! cursor Position 00022 int CursorPos; 00023 00024 //! text property 00025 string Text; 00026 00027 //! widget for drawing text 00028 QFont* Font; 00029 00030 public: 00031 //! draws itself with OpenGL. Here is the OpenGL drawing code 00032 virtual void draw( QEvent* e ); 00033 00034 //! layout the children widgets. This method is called every time the size is changed. Have to be overwritten for respond on size changes 00035 virtual void layout(); 00036 00037 //! have to return true if widget should be dragged with mouse. This method is overwritten in sub classes. If returns true, widget will be dragged 00038 virtual bool canDrag( QEvent* e ); 00039 00040 //! processing mouse/keyboard events which are in widgets region. Mouse coordinates are relative to Owner 00041 virtual bool processEvent( QEvent* e ); 00042 00043 //! processing mouse events which are in Owner widget region. Mouse coordinates are relative to Owner 00044 virtual bool processMouseOwner( QEvent* e ); 00045 00046 //! called if a child is added/removed 00047 virtual void childrenChanged(); 00048 00049 //! defines whether control can have keyboard focus. Should return true if Widget wants to get keyboard focus 00050 virtual bool canFocus( QEvent* e ); 00051 00052 //! initialization code 00053 virtual void Init(); 00054 00055 //! clean up code 00056 virtual void CleanUp(); 00057 00058 //! getter method for CursorPos 00059 virtual int getCursorPos(); 00060 00061 //! setter method for CursorPos 00062 virtual void setCursorPos( int newValue ); 00063 00064 //! getter method for Text 00065 virtual string getText(); 00066 00067 //! setter method for Text 00068 virtual void setText( string newValue ); 00069 00070 //! getter method for Font 00071 QFont* getFont(); 00072 00073 //! prints itself to the cout 00074 void print(); 00075 00076 //! Constructor 00077 QTextEdit( QWidget* aOwner ); 00078 00079 //! Destructor 00080 virtual ~QTextEdit(); 00081 00082 00083 }; 00084 #endif 00085
1.2.18