00001 #ifndef _ots_ViewColumnInfo_h_
00002 #define _ots_ViewColumnInfo_h_
00003
00004 #include <string>
00005 #include <vector>
00006 #include <map>
00007 #include <memory>
00008
00009 namespace ots
00010 {
00011
00012 class ViewColumnInfo
00013 {
00014
00015 public:
00016
00017 ViewColumnInfo(const std::string &type, const std::string &name, const std::string &storageName, const std::string &dataType, const std::string &dataChoicesCSV, std::string *capturedExceptionString);
00018 ViewColumnInfo(const ViewColumnInfo& c);
00019 ViewColumnInfo& operator=(const ViewColumnInfo& c);
00020
00021
00022
00023 virtual ~ViewColumnInfo(void);
00024
00025 const std::string& getType (void) const;
00026 const std::string& getName (void) const;
00027 const std::string& getStorageName (void) const;
00028 const std::string& getDataType (void) const;
00029 const std::string& getDefaultValue (void) const;
00030 const std::vector<std::string>& getDataChoices (void) const;
00031
00032 struct BitMapInfo
00033 {
00034 BitMapInfo()
00035 :minColor_("")
00036 ,midColor_("")
00037 ,maxColor_("")
00038 {}
00039 unsigned int numOfRows_, numOfColumns_, cellBitSize_;
00040 uint64_t minValue_, maxValue_, stepValue_;
00041 std::string aspectRatio_;
00042 std::string minColor_, midColor_, maxColor_;
00043 std::string absMinColor_, absMaxColor_;
00044 bool rowsAscending_, colsAscending_, snakeRows_, snakeCols_;
00045 };
00046 const BitMapInfo& getBitMapInfo (void) const;
00047
00048 static std::vector<std::string> getAllTypesForGUI (void);
00049 static std::map<std::pair<std::string,std::string>,std::string> getAllDefaultsForGUI(void);
00050 static std::vector<std::string> getAllDataTypesForGUI(void);
00051
00052 const bool isChildLink (void) const;
00053 const bool isChildLinkUID (void) const;
00054 const bool isChildLinkGroupID (void) const;
00055 const bool isGroupID (void) const;
00056
00057 std::string getChildLinkIndex (void) const;
00058
00059 static const std::string TYPE_UID;
00060 static const std::string TYPE_DATA, TYPE_UNIQUE_DATA, TYPE_MULTILINE_DATA, TYPE_FIXED_CHOICE_DATA, TYPE_BITMAP_DATA;
00061 static const std::string TYPE_ON_OFF, TYPE_TRUE_FALSE, TYPE_YES_NO;
00062 static const std::string TYPE_COMMENT, TYPE_AUTHOR, TYPE_TIMESTAMP;
00063 static const std::string TYPE_START_CHILD_LINK, TYPE_START_CHILD_LINK_UID, TYPE_START_CHILD_LINK_GROUP_ID, TYPE_START_GROUP_ID;
00064 static const std::string DATATYPE_NUMBER, DATATYPE_STRING, DATATYPE_TIME;
00065
00066 static const std::string TYPE_VALUE_YES ;
00067 static const std::string TYPE_VALUE_NO ;
00068 static const std::string TYPE_VALUE_TRUE ;
00069 static const std::string TYPE_VALUE_FALSE ;
00070 static const std::string TYPE_VALUE_ON ;
00071 static const std::string TYPE_VALUE_OFF ;
00072
00073 static const std::string DATATYPE_STRING_DEFAULT ;
00074 static const std::string DATATYPE_COMMENT_DEFAULT ;
00075 static const std::string DATATYPE_BOOL_DEFAULT ;
00076 static const std::string DATATYPE_NUMBER_DEFAULT ;
00077 static const std::string DATATYPE_TIME_DEFAULT ;
00078 static const std::string DATATYPE_LINK_DEFAULT ;
00079
00080 static const std::string COL_NAME_STATUS;
00081
00082 private:
00083 ViewColumnInfo();
00084 void extractBitMapInfo();
00085
00086 protected:
00087 std::string type_;
00088 std::string name_;
00089 std::string storageName_;
00090 std::string dataType_;
00091 std::vector<std::string> dataChoices_;
00092 BitMapInfo* bitMapInfoP_;
00093 };
00094
00095
00096 }
00097
00098 #endif