00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Elendt 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: VOP_OperatorInfo.h ( VOP Library, C++) 00015 * 00016 * COMMENTS: This is additional information available via every VOP 00017 * operator. 00018 */ 00019 00020 #ifndef __VOP_OperatorInfo__ 00021 #define __VOP_OperatorInfo__ 00022 00023 #include "VOP_API.h" 00024 #include <UT/UT_String.h> 00025 #include <UT/UT_StringArray.h> 00026 #include <UT/UT_RefArray.h> 00027 #include <OP/OP_Operator.h> 00028 #include "VOP_Language.h" 00029 00030 class VOP_Language; 00031 typedef UT_RefArray<VOP_Type> VOP_VopTypeArray; 00032 00033 class VOP_API VOP_InOutInfo 00034 { 00035 public: 00036 VOP_InOutInfo(const UT_String &name, const UT_String &label, 00037 VOP_Type vextype) 00038 : myName(name, 1), myLabel(label, 1) 00039 { myTypes.append(vextype); } 00040 ~VOP_InOutInfo() { } 00041 00042 const UT_String &getName() const 00043 { return myName; } 00044 void setName(const char *name) 00045 { myName.harden(name); } 00046 const UT_String &getLabel() const 00047 { return myLabel; } 00048 void setLabel(const char *label) 00049 { myLabel.harden(label); } 00050 00051 void addType(VOP_Type vextype) 00052 { myTypes.append(vextype); } 00053 void removeType(int i) 00054 { myTypes.remove((unsigned int)i); } 00055 00056 VOP_Type getType(int i) const 00057 { return myTypes(i); } 00058 void setType(int i, VOP_Type newtype) 00059 { myTypes(i) = newtype; } 00060 int getNumTypes() const 00061 { return myTypes.entries(); } 00062 00063 private: 00064 UT_String myName; 00065 UT_String myLabel; 00066 VOP_VopTypeArray myTypes; 00067 }; 00068 00069 class VOP_API VOP_OperatorInfo : public OP_SpecificData 00070 { 00071 public: 00072 VOP_OperatorInfo(); 00073 virtual ~VOP_OperatorInfo(); 00074 00075 00076 UT_String &getCode() 00077 { return myCode; } 00078 const UT_String &getCode() const 00079 { return myCode; } 00080 UT_String &getOuterCode() 00081 { return myOuterCode; } 00082 const UT_String &getOuterCode() const 00083 { return myOuterCode; } 00084 void setVopnetMask(const char *mask); 00085 const UT_String &getVopnetMask() const 00086 { return myVopnetMask; } 00087 UT_PtrArray<VOP_InOutInfo *> &getOutputInfos() 00088 { return myOutputInfos; } 00089 const UT_PtrArray<VOP_InOutInfo *> &getOutputInfos() const 00090 { return myOutputInfos; } 00091 UT_PtrArray<VOP_InOutInfo *> &getInputInfos() 00092 { return myInputInfos; } 00093 const UT_PtrArray<VOP_InOutInfo *> &getInputInfos() const 00094 { return myInputInfos; } 00095 UT_StringArray &getInputSetNames() 00096 { return myInputSetNames; } 00097 const UT_StringArray &getInputSetNames() const 00098 { return myInputSetNames; } 00099 UT_StringArray &getInputSetLabels() 00100 { return myInputSetLabels; } 00101 const UT_StringArray &getInputSetLabels() const 00102 { return myInputSetLabels; } 00103 bool &getForceCodeGeneration() 00104 { return myForceCodeGeneration; } 00105 const bool &getForceCodeGeneration() const 00106 { return myForceCodeGeneration; } 00107 00108 void clearInOutInfo(); 00109 virtual void saveToDialogScript(ostream &os) const; 00110 static void saveInOutInfoToDialogScript(ostream &os, 00111 const UT_PtrArray<VOP_InOutInfo *> &infoarray, 00112 const char *infotype, 00113 const VOP_Language *language); 00114 00115 private: 00116 UT_PtrArray<VOP_InOutInfo *> myOutputInfos; 00117 UT_PtrArray<VOP_InOutInfo *> myInputInfos; 00118 UT_StringArray myInputSetNames; 00119 UT_StringArray myInputSetLabels; 00120 UT_String myVopnetMask; 00121 UT_String myOuterCode; 00122 UT_String myCode; 00123 bool myForceCodeGeneration; 00124 }; 00125 00126 #endif 00127
1.5.9