00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _OSGQFIELDLABELFACTORY_H_
00040 #define _OSGQFIELDLABELFACTORY_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044
00045 #include "OSGWindowQTDef.h"
00046
00047 #include <OSGBaseTypes.h>
00048
00049 #include <string>
00050 #include <map>
00051
00052 #include <qnamespace.h>
00053
00054 OSG_BEGIN_NAMESPACE
00055
00056 class QFieldViewBase;
00057 class QFieldValueLabelBase;
00058
00059 class OSG_WINDOWQTLIB_DLLMAPPING QFieldLabelFactory : public Qt
00060 {
00061 public:
00062 typedef QFieldValueLabelBase *(*LabelCreateF)(QFieldViewBase *, UInt32);
00063
00064 ~QFieldLabelFactory(void);
00065
00066 static QFieldLabelFactory &the();
00067
00068 bool registerLabel (const std::string &strFieldContentsName,
00069 LabelCreateF labelCreateFunc );
00070 bool registerDefaultLabel(const std::string &strFieldContentsName,
00071 LabelCreateF labelCreateFunc );
00072
00073 QFieldValueLabelBase *createLabel(QFieldViewBase *pView, UInt32 uiIndex);
00074
00075 private:
00076 typedef std::map<std::string, LabelCreateF> LabelMap;
00077 typedef std::map<std::string, LabelCreateF>::iterator LabelMapIt;
00078
00079 QFieldLabelFactory(void);
00080
00081 static QFieldLabelFactory *_the;
00082
00083 LabelMap _labelMap;
00084 LabelCreateF _defaultLabelCreateFunc;
00085 };
00086
00087 template <class FieldLabelType>
00088 struct QLabelRegisterWrapper
00089 {
00090 explicit QLabelRegisterWrapper(const std::string &strFieldContentsName);
00091 };
00092
00093 OSG_END_NAMESPACE
00094
00095 #define OSGQFIELDLABELFACTORY_HEADER_CVSID "@(#)$Id: OSGQFieldLabelFactory.h,v 1.2 2003/05/16 13:54:29 neumannc Exp $"
00096
00097 #include "OSGQFieldLabelFactory.inl"
00098
00099 #endif