00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __OP_OTLDefinition__
00020 #define __OP_OTLDefinition__
00021
00022 #include "OP_API.h"
00023 #include "OP_Node.h"
00024 #include <UT/UT_String.h>
00025 #include <UT/UT_PtrArray.h>
00026
00027 class UT_WorkBuffer;
00028
00029 class OP_API OP_OTLDefinition
00030 {
00031 public:
00032 OP_OTLDefinition();
00033 OP_OTLDefinition(const OP_OTLDefinition &definition);
00034 virtual ~OP_OTLDefinition();
00035
00036 const UT_String &getName() const
00037 { return myName; }
00038 void setName(const char *name)
00039 { myName.harden(name); }
00040 const UT_String &getLabel() const
00041 { return myLabel; }
00042 void setLabel(const char *label)
00043 { myLabel.harden(label); }
00044 const UT_String &getPath() const
00045 { return myPath; }
00046 void setPath(const char *path)
00047 { myPath.harden(path); }
00048 const UT_String &getIcon() const
00049 { return myIcon; }
00050 void setIcon(const char *icon)
00051 { myIcon.harden(icon); }
00052 const UT_String &getAuthor() const
00053 { return myAuthor; }
00054 void setAuthor(const char *author)
00055 { myAuthor.harden(author); }
00056 const UT_String &getCopyright() const
00057 { return myCopyright; }
00058 void setCopyright(const char *copyright)
00059 { myCopyright.harden(copyright); }
00060 const UT_String &getOpTableName() const
00061 { return myOpTableName; }
00062 void setOpTableName(const char *optablename)
00063 { myOpTableName.harden(optablename); }
00064 const UT_String &getIndexPath() const
00065 { return myIndexPath; }
00066 void setIndexPath(const char *indexpath)
00067 { myIndexPath.harden(indexpath); }
00068 const UT_String &getIndexFile() const
00069 { return myIndexFile; }
00070 void setIndexFile(const char *indexfile)
00071 { myIndexFile.harden(indexfile); }
00072 const UT_String &getLicenseInfo() const
00073 { return myLicenseInfo; }
00074 void setLicenseInfo(const char *licenseinfo)
00075 { myLicenseInfo.harden(licenseinfo); }
00076 const UT_String &getExtraInfo() const
00077 { return myExtraInfo; }
00078 void setExtraInfo(const char *extrainfo)
00079 { myExtraInfo.harden(extrainfo); }
00080 int getMinInputs() const
00081 { return myMinInputs; }
00082 void setMinInputs(int inputs)
00083 { myMinInputs = inputs; }
00084 int getMaxInputs() const
00085 { return myMaxInputs; }
00086 void setMaxInputs(int inputs)
00087 { myMaxInputs = inputs; }
00088 int getModTime() const
00089 { return myModTime; }
00090 void setModTime(int modtime)
00091 { myModTime = modtime; }
00092 char getIsSubnet() const
00093 { return myIsSubnet; }
00094 void setIsSubnet(char issubnet)
00095 { myIsSubnet = issubnet; }
00096 char getIsPython() const
00097 { return myIsPython; }
00098 void setIsPython(char ispython)
00099 { myIsPython = ispython; }
00100 char getIsDummyDefinition() const
00101 { return myIsDummyDefinition; }
00102 void setIsDummyDefinition(char isdummy)
00103 { myIsDummyDefinition = isdummy; }
00104
00105
00106 bool isInternal() const;
00107
00108
00109 int handleOption(int argc, char *argv[]);
00110
00111 void getTableAndName(UT_String &name) const;
00112
00113
00114 OP_OpTypeId getOpTypeId() const;
00115
00116 const OP_OTLDefinition &operator=(const OP_OTLDefinition &src);
00117 bool load(UT_IStream &is);
00118 bool save(ostream &os);
00119
00120 void writeTextDescription(UT_WorkBuffer &buffer,
00121 const char *indent = 0) const;
00122
00123
00124
00125 void writeFormattedText(UT_WorkBuffer &buffer,
00126 const char *format) const;
00127
00128
00129
00130
00131 bool readTextDescription(UT_IStream &is);
00132
00133
00134 static int getModTimeFromString(const char *str);
00135
00136 private:
00137 UT_String myName;
00138 UT_String myLabel;
00139 UT_String myPath;
00140 UT_String myIcon;
00141 UT_String myAuthor;
00142 UT_String myCopyright;
00143 UT_String myOpTableName;
00144 UT_String myIndexPath;
00145 UT_String myIndexFile;
00146 UT_String myLicenseInfo;
00147 UT_String myExtraInfo;
00148 int myMinInputs;
00149 int myMaxInputs;
00150 int myModTime;
00151 char myIsSubnet;
00152 char myIsPython;
00153 char myIsDummyDefinition;
00154 };
00155
00156 typedef UT_PtrArray<OP_OTLDefinition *> OP_OTLDefinitionArray;
00157
00158 #endif
00159