00001 // IntValue.h: interface for the CIntValue class. 00002 /* 00003 * Copyright (c) 1996-2000 Erwin Coumans <[email protected]> 00004 * 00005 * Permission to use, copy, modify, distribute and sell this software 00006 * and its documentation for any purpose is hereby granted without fee, 00007 * provided that the above copyright notice appear in all copies and 00008 * that both that copyright notice and this permission notice appear 00009 * in supporting documentation. Erwin Coumans makes no 00010 * representations about the suitability of this software for any 00011 * purpose. It is provided "as is" without express or implied warranty. 00012 * 00013 */ 00014 #if !defined _INTVALUE_H 00015 #define _INTVALUE_H 00016 00017 00018 #include "Value.h" 00019 00020 00021 class CIntValue : public CPropValue 00022 { 00023 //PLUGIN_DECLARE_SERIAL (CIntValue,CValue) 00024 public: 00025 virtual const CCString & GetText(); 00026 virtual float GetNumber(); 00027 00028 int GetInt(); 00029 CIntValue(); 00030 CIntValue(int innie); 00031 CIntValue(int innie,CCString name,AllocationTYPE alloctype=CValue::HEAPVALUE); 00032 00033 virtual CValue* Calc(VALUE_OPERATOR op, CValue *val); 00034 virtual CValue* CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); 00035 virtual void SetValue(CValue* newval) { 00036 m_int = (int)newval->GetNumber(); 00037 SetModified(true); 00038 00039 00040 }; 00041 void Configure(CValue* menuvalue); 00042 void AddConfigurationData(CValue* menuvalue); 00043 virtual CValue* GetReplica(); 00044 virtual PyObject* ConvertValueToPython() { 00045 return PyInt_FromLong(m_int); 00046 } 00047 protected: 00048 virtual ~CIntValue(); 00049 private: 00050 int m_int; 00051 CCString* m_pstrRep; 00052 00053 }; 00054 00055 #endif // !defined _INTVALUE_H