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.hh

Go to the documentation of this file.
00001 /* $Id: input.hh,v 1.11 2003/07/24 05:18:26 tetron Exp $ */
00002 
00003 /** @file input.hh Defines MetaObject class for "gui:widget.input" object type (revision 0). */
00004 
00005 /*  Copyright (C) 2002 Reed Hedges <reed@interreality.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 
00021 */
00022 
00023 #ifndef _GUI_INPUT_HH_
00024 #define _GUI_INPUT_HH_
00025 
00026 #if defined(_WIN32) && defined(_MSC_VER)
00027 # ifdef VOSGUI_EXPORTS
00028 #  define VOSGUI_API __declspec(dllexport)
00029 # else
00030 #  define VOSGUI_API __declspec(dllimport)
00031 # endif
00032 #else
00033 # define VOSGUI_API
00034 #endif
00035 
00036 #include <vos/corelibs/vos/vos.hh>
00037 #include <vos/metaobjects/property/property.hh>
00038 
00039 #include <vos/gui/gui/widget.hh>
00040 
00041 namespace VOSGUI {
00042 
00043 /** MetaObject implementing Input Object Type.
00044     A text input widget. May be single or multiline.
00045 */
00046 
00047 class VOSGUI_API Input : public virtual Widget {
00048 
00049 public:
00050 
00051     /** Constructor */
00052     Input(MetaObject* superobject);
00053 
00054     /** Destructor */
00055     virtual ~Input();
00056 
00057     /** Return type string ("gui:widget.input") */
00058     virtual const string getType();
00059 
00060     /** Register Extenders */
00061     static void registerExtenders();
00062 
00063 
00064     /** @name Access Subobjects */
00065     //@{
00066 
00067     /** Get the value of gui:target property (The contents/target of the control). */
00068     virtual string getTarget();
00069 
00070     /** Get the datatype of gui:target property. */
00071     virtual string getTargetDatatype();
00072 
00073     /** Set gui:target property. 
00074         @param value The new value
00075         @param datatype The new datatype: if omitted, then the existing datatype will be preserved.
00076         @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 
00077     */
00078     virtual void setTarget(const string& value, const string& datatype = "?", PropertyAccessControl* ac = 0);
00079 
00080     /* TODO: perhaps customize this accessor for type property:property. */
00081 
00082     /** Get the gui:target object. */
00083     virtual Property* getTargetObj();
00084 
00085     /** Set the gui:target object.
00086         @param newobj   The new subobject. */
00087     virtual void setTargetObj(Property* newobj);
00088 
00089     /** Get the value of gui:multiline property (If the value of this property is "yes", then the
00090         input widget may be more than one line tall, and the user
00091         may input more than one line (seperated by a newline
00092         charater, ASCII value 10). If absent, a default value of
00093         "no" should be used.
00094     ). */
00095     virtual bool getMultiline();
00096 
00097     /** Set gui:multiline property. 
00098         @param value The new value
00099         @param ac Property access control policy. If omitted, then &NoAccessControl::static_ will be used. 
00100     */
00101     virtual void setMultiline(bool value = true, PropertyAccessControl* ac = 0);
00102 
00103     /** Get the gui:multiline object. */
00104     virtual Property* getMultilineObj();
00105 
00106     /** Set the gui:multiline object.
00107         @param newobj   The new subobject. */
00108     virtual void setMultilineObj(Property* newobj);
00109 
00110 };
00111 
00112 /** Local version of Input. */
00113 
00114 class VOSGUI_API LocalInput : public virtual Input, public virtual LocalWidget {
00115 
00116 public:
00117 
00118     /** Constructor */
00119     LocalInput(MetaObject* superobject);
00120 
00121     /** Destructor */
00122     ~LocalInput();
00123 
00124     /** Initialize subobjects and access control. */
00125     virtual void initialize(PropertyAccessControl* ac);
00126 
00127     /** Static generator, for site factory. */
00128     static MetaObject* new_LocalInput(MetaObject* superobject, const string& type);
00129 
00130 };
00131 
00132 /** Remote proxy for Input */
00133 
00134 class VOSGUI_API RemoteInput : public virtual Input, public virtual RemoteWidget {
00135 
00136 public:
00137 
00138     /** Constructor */
00139     RemoteInput(MetaObject* superobject);
00140 
00141     /** Destructor */
00142     virtual ~RemoteInput();
00143 
00144     /** Static generator, for factory. */
00145     static MetaObject* new_RemoteInput(MetaObject* superobject, const string& type);
00146 
00147 };
00148 
00149 
00150 } // end of namespace VOSGUI
00151 #endif // #ifndef _GUI_INPUT_HH_
00152 

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