Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

vos/gui/gui/input_numeric.hh

Go to the documentation of this file.
00001 /* $Id: input_numeric.hh,v 1.6 2003/07/24 05:18:26 tetron Exp $ */
00002 
00003 /*  Copyright (C) 2003 Reed Hedges <reed@interreality.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00018 
00019 */
00020 
00021 #ifndef _GUI_INPUT_NUM_HH_
00022 #define _GUI_INPUT_NUM_HH_
00023 
00024 #if defined(_WIN32) && defined(_MSC_VER)
00025 # ifdef VOSGUI_EXPORTS
00026 #  define VOSGUI_API __declspec(dllexport)
00027 # else
00028 #  define VOSGUI_API __declspec(dllimport)
00029 # endif
00030 #else
00031 # define VOSGUI_API
00032 #endif
00033 
00034 #include <vos/corelibs/vos/vos.hh>
00035 #include <vos/metaobjects/property/property.hh>
00036 #include <vos/gui/gui/input.hh>
00037 
00038 namespace VOSGUI {
00039 
00040 /** MetaObject for a numeric input object.
00041     Suggested representation is a text input with small increment/decrement
00042     controls.
00043     @bug Only floating point numbers are implemented yet.
00044     @todo General interface using template methods, for floating point, integer,
00045         and vector (of float or int) types.
00046 */
00047 
00048 class VOSGUI_API NumericInput : public virtual Input {
00049 
00050 public:
00051 
00052     /** Constructor */
00053     NumericInput(MetaObject* superobject);
00054 
00055     /** Destructor */
00056     virtual ~NumericInput();
00057 
00058     /** Return type string ("gui:widget.input") */
00059     virtual const string getType();
00060 
00061     /** Register Extenders */
00062     static void registerExtenders();
00063 
00064     /** @name Access Subobjects */
00065     //@{
00066 
00067     virtual void setValue(double v);
00068     virtual double getValue();
00069 
00070     /** Set the maximum and minimum values */
00071     virtual void setRange(double min, double max, PropertyAccessControl* ac =
00072         0);
00073 
00074     /** Get the maximum value */
00075     virtual double getMaximum();
00076 
00077     /** Get the datatype of gui:maximum property. */
00078     virtual string getMaximumDatatype();
00079 
00080     /** Set gui:maximum property. 
00081         @param value The new value
00082         @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 
00083     */
00084     virtual void setMaximum(const double value, PropertyAccessControl* ac = 
00085         0);
00086 
00087     /** Get the gui:maximum object. */
00088     virtual Property* getMaximumObject();
00089 
00090     /** Set the gui:maximum object.
00091         @param newobj   The new subobject. */
00092     virtual void setMaximumObject(Property* newobj);
00093 
00094 
00095     /** Get the minimum value */
00096     virtual double getMinimum();
00097 
00098     /** Get the datatype of gui:minimum property. */
00099     virtual string getMinimumDatatype();
00100 
00101     /** Set gui:minimum property. 
00102         @param value The new value
00103         @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 
00104     */
00105     virtual void setMinimum(const double value, PropertyAccessControl* ac = 
00106         0);
00107 
00108     /** Get the gui:minimum object. */
00109     virtual Property* getMinimumObject();
00110 
00111     /** Set the gui:minimum object.
00112         @param newobj   The new subobject. */
00113     virtual void setMinimumObject(Property* newobj);
00114 
00115 
00116 
00117 
00118     /** Get the increment value */
00119     virtual double getIncrement();
00120 
00121     /** Get the datatype of gui:increment property. */
00122     virtual string getIncrementDatatype();
00123 
00124     /** Set gui:increment property. 
00125         @param value The new value
00126         @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 
00127     */
00128     virtual void setIncrement(const double value, PropertyAccessControl* ac = 
00129         0);
00130 
00131     /** Get the gui:increment object. */
00132     virtual Property* getIncrementObject();
00133 
00134     /** Set the gui:increment object.
00135         @param newobj   The new subobject. */
00136     virtual void setIncrementObject(Property* newobj);
00137     //@}
00138 };
00139 
00140 /** Local version of NumericInput. */
00141 
00142 class VOSGUI_API LocalNumericInput : public virtual NumericInput, public virtual LocalInput {
00143 
00144 public:
00145 
00146     /** Constructor */
00147     LocalNumericInput(MetaObject* superobject);
00148 
00149     /** Destructor */
00150     ~LocalNumericInput();
00151 
00152 
00153     /** Static generator, for site factory. */
00154     static MetaObject* new_LocalNumericInput(MetaObject* superobject, const string& type);
00155 
00156 };
00157 
00158 /** Remote proxy for NumericInput */
00159 
00160 class VOSGUI_API RemoteNumericInput : public virtual NumericInput, public virtual RemoteInput {
00161 
00162 public:
00163 
00164     /** Constructor */
00165     RemoteNumericInput(MetaObject* superobject);
00166 
00167     /** Destructor */
00168     virtual ~RemoteNumericInput();
00169 
00170     /** Static generator, for factory. */
00171     static MetaObject* new_RemoteNumericInput(MetaObject* superobject, const string& type);
00172 
00173 };
00174 
00175 
00176 } // end of namespace VOSGUI
00177 #endif // #ifndef _GUI_INPUT_NUM_HH_
00178 

Generated on Tue Aug 12 03:55:43 2003 for Interreality Project - VOS by doxygen 1.3.2