Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGQFieldEditor_qt.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGQFIELDEDITOR_H_
00040 #define _OSGQFIELDEDITOR_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include "OSGWindowQTDef.h"
00046 
00047 #include <OSGField.h>
00048 
00049 #include <qwidget.h>
00050 
00051 class QLineEdit;
00052 class QResizeEvent;
00053 
00054 OSG_BEGIN_NAMESPACE
00055 
00056 class QFieldViewBase;
00057 
00061 class OSG_WINDOWQTLIB_DLLMAPPING QFieldEditorBase : public QWidget
00062 {
00063     Q_OBJECT
00064 
00065 public:
00066     QFieldEditorBase(QFieldViewBase *pView,   const char   *name=NULL);
00067 
00068     QFieldEditorBase(UInt32          uiIndex,
00069                      QFieldViewBase *pView,   const char   *name=NULL);
00070 
00071     virtual ~QFieldEditorBase(void) = 0;
00072 
00073     virtual       void            updateField (void          ) = 0;
00074     virtual       void            updateEditor(void          ) = 0;
00075 
00076     virtual       void            activate    (void          );
00077     virtual       void            deactivate  (void          );
00078 
00079                   void            setIndex    (UInt32 uiIndex);
00080 
00081                   bool            getActive   (void          ) const;
00082                   UInt32          getIndex    (void          ) const;
00083 
00084 signals:
00085                   void            editorDone  (void          );
00086                   void            fieldUpdated(UInt32 uiIndex);
00087 
00088 protected:
00089                   QFieldViewBase *getFieldView(void          );
00090             const QFieldViewBase *getFieldView(void          ) const;
00091 
00092                   Field          *getFieldPtr (void          );
00093             const Field          *getFieldPtr (void          ) const;
00094 
00095 private:
00096     typedef QWidget Inherited;
00097 
00098     QFieldViewBase *_pView;
00099     UInt32          _uiIndex;
00100     bool            _bActive;
00101 };
00102 
00106 class QGenericFieldEditor : public QFieldEditorBase
00107 {
00108     Q_OBJECT
00109 
00110 public:
00111     QGenericFieldEditor(QFieldViewBase *pView,   const char   *name=NULL);
00112 
00113     QGenericFieldEditor(UInt32          uiIndex,
00114                         QFieldViewBase *pView,   const char   *name=NULL);
00115     
00116     virtual ~QGenericFieldEditor(void);
00117 
00118     virtual void updateField    (void);
00119     virtual void updateEditor   (void);
00120 
00121     virtual void activate       (void);
00122     virtual void deactivate     (void);
00123 
00124 protected slots:
00125     virtual void resizeEvent    (QResizeEvent *pEvent);
00126 
00127 private slots:
00128             void onReturnPressed(void);
00129 
00130 private:
00131     typedef QFieldEditorBase Inherited;
00132 
00133     QLineEdit *_pLineEdit;
00134 };
00135 
00136 OSG_END_NAMESPACE
00137 
00138 #define OSGQFIELDEDITOR_HEADER_CVSID "@(#)$Id: OSGQFieldEditor_qt.h,v 1.2 2003/05/16 13:54:29 neumannc Exp $"
00139 
00140 #include "OSGQFieldEditor_qt.inl"
00141 
00142 #endif /* _OSGQFIELDEDITOR_H_ */

Generated on Thu Aug 25 04:08:59 2005 for OpenSG by  doxygen 1.4.3