type.h
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef NL_TYPE_H
00025 #define NL_TYPE_H
00026
00027 #include "nel/misc/types_nl.h"
00028 #include "nel/georges/u_type.h"
00029 #include "nel/georges/u_form_elm.h"
00030 #include "header.h"
00031
00032 namespace NLGEORGES
00033 {
00034
00035 class UFormElm;
00036
00040 class CType : public UType
00041 {
00042 friend class CFormLoader;
00043 public:
00044
00045 CType ();
00046 virtual ~CType ();
00047
00048
00049 enum TUI
00050 {
00051 Edit,
00052 EditSpin,
00053 NonEditableCombo,
00054 FileBrowser,
00055 BigEdit,
00056 ColorEdit,
00057 IconWidget,
00058 UITypeCount
00059 };
00060
00061
00062 static bool uiCompatible (TType type, TUI ui);
00063
00064
00065 void write (xmlDocPtr doc, bool georges4CVS) const;
00066
00067
00068 CFileHeader Header;
00069
00070
00071 UType::TType Type;
00072
00073
00074 TUI UIType;
00075
00076
00077 std::string Default;
00078
00079
00080 std::string Min;
00081
00082
00083 std::string Max;
00084
00085
00086 std::string Increment;
00087
00088
00089 bool getValue (std::string &result, const class CForm *form, const class CFormElmAtom *node, const class CFormDfn &parentDfn,
00090 uint parentIndex, UFormElm::TEval evaluate, uint32 *where, uint32 round, const char *formName) const;
00091
00092
00093 class CDefinition
00094 {
00095 public:
00096
00097 std::string Label;
00098
00099
00100 std::string Value;
00101 };
00102
00103
00104 std::vector<CDefinition> Definitions;
00105
00106
00107 static const char *getTypeName (UType::TType type);
00108 static const char *getUIName (TUI type);
00109
00110
00111 virtual TType getType () const;
00112 virtual const std::string &getDefault () const;
00113 virtual const std::string &getMin () const;
00114 virtual const std::string &getMax () const;
00115 virtual const std::string &getIncrement () const;
00116 virtual uint getNumDefinition () const;
00117 virtual bool getDefinition (uint index, std::string &label, std::string &value) const;
00118 virtual const std::string &getComment () const;
00119 virtual void getDependencies (std::set<std::string> &dependencies) const;
00120
00121 private:
00122
00123
00124 virtual void warning (bool exception, const char *formName, const char *formFilename, const char *function, const char *format, ... ) const;
00125 virtual void warning2 (bool exception, const char *function, const char *format, ... ) const;
00126
00127
00128 static const char *TypeNames[];
00129 static const char *UITypeNames[];
00130
00131
00132 void read (xmlNodePtr root);
00133
00134 };
00135
00136 }
00137
00138 #endif // NL_TYPE_H