00001
00002
00003 #ifndef UINODEPARAMETERS_H
00004 #define UINODEPARAMETERS_H
00005
00006
00007 #include <string>
00008 #include <vector>
00009 #include <libxml/tree.h>
00010
00011 namespace FD {
00012
00013 class UINode;
00014 class ParameterSet;
00015 class ItemInfo;
00016
00017
00018 class ParameterText
00019 {
00020 public:
00021 std::string name;
00022 std::string value;
00023 std::string type;
00024 std::string description;
00025 };
00026
00027 class UINodeParameters
00028 {
00029 protected:
00030 std::vector<ParameterText *> textParams;
00031 std::string comments;
00032 UINode *node;
00033
00034 public:
00035 UINodeParameters(UINode *_node, std::string type);
00036 virtual ~UINodeParameters();
00037 void saveXML(xmlNode *root);
00038 void export2net(std::ostream &out);
00039 void load(xmlNodePtr node);
00040 ParameterText *getParamNamed(std::string n);
00041 void insertNetParams(std::vector<ItemInfo *> &par);
00042
00043 void updateNetParams(std::vector<ItemInfo *> &par);
00044
00045 virtual void insertLoadedParam(ParameterText *param, std::string type, std::string value);
00046 ParameterText *addParameterText(std::string name, std::string type, std::string value,
00047 std::string description);
00048 void removeParameterText(std::string nameToRemove);
00049
00050 ParameterSet *build(const ParameterSet &par);
00051
00052 void copyParameterText(UINodeParameters *cpy);
00053
00054 void genCode(std::ostream &out);
00055
00056 const std::string &getComments() {return comments;}
00057 void setComments(const std::string &_comments) {comments = _comments;}
00058
00059 std::vector<ParameterText *> &get_textParams() {return textParams;}
00060 UINode *getUINode() {return node;}
00061
00062 };
00063
00064 }
00065 #endif