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

vos/metaobjects/text/text.hh

Go to the documentation of this file.
00001 /* $Id: text.hh,v 1.4 2003/07/24 05:18:13 tetron Exp $ */
00002 
00003 
00004 /* This file was generated by otd2cpp.pl, a script for VOS by Reed Hedges <reed@zerohour.net>. 
00005 
00006    Search for TODO for stuff that needs editing. You will want to especially fill in constructors,
00007    destructors, message handlers, non-property subobjects...
00008 
00009    I can make no garuntee that this code will work, or even that it even is safe to run.
00010    Use it at your own risk.
00011 */
00012 
00013 /** @file text.hh Defines MetaObject class for Text type (revision 0).
00014 
00015 */ 
00016 
00017 #ifndef _TEXT_HH_
00018 #define _TEXT_HH_
00019 
00020 #include <vos/corelibs/vos/vos.hh>
00021 #include <vos/metaobjects/property/property.hh>
00022 
00023 #if defined(_WIN32) && defined(_MSC_VER)
00024 # ifdef MISC_EXPORTS
00025 #  define MISC_API __declspec(dllexport)
00026 # else
00027 #  define MISC_API __declspec(dllimport)
00028 # endif
00029 #else
00030 # define MISC_API
00031 #endif
00032 
00033 /** MetaObject implementing Text Object Type. 
00034     
00035         The "text" object type contains written text of some kind to be displayed. It has one subproperty containing the text, as well as optional subproperties for translations to other languages.   
00036     
00037 */
00038 
00039 class MISC_API Text : public virtual MetaObject
00040 {
00041 
00042 
00043 public:
00044 
00045     /** Constructor */
00046     Text(MetaObject* superobject);
00047 
00048 
00049     /** Return type string ("text:text") */
00050     const string getType();
00051 
00052     /** Register Extenders */
00053     static void registerExtenders();
00054 
00055 
00056     /** Return ISO 639 code for primary language */
00057     string primaryLanguage();
00058 
00059     /** Return a list of languages available (ISO 639 codes)  */
00060     deque<string>* listLanguages();
00061 
00062     /** @name Access Subobjects */
00063     //@{
00064 
00065     /** Return first property that starts with the prefix "text:" */
00066     Property& getPrimaryProperty();
00067 
00068     /** Return property for a given language */
00069     Property& getProperty(const string& lang);
00070 
00071     /** Get the text (primary/default language) */
00072     string getText();
00073 
00074     /** Get the text in the given language. 
00075         @throws NoSuchObjectError if a property for that language is not found. 
00076         @param lang Search for a subproperty named "text:"+lang (e.g. "text:eng"). I.e., lang is the ISO-639 code.   
00077     */
00078 
00079     string getText(string lang);
00080 
00081     /** Get the datatype of primary subproperty. */
00082     string getTextDatatype();
00083 
00084     /** Get the datatype of a subproperty. */
00085     string getTextDatatype(string lang);
00086 
00087     /** Set primary  text sub-property. 
00088         @param value The new value
00089         @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */
00090     void setText(const string& value, const string& datatype);
00091 
00092     /** Set a text subproperty.
00093         @param lang ISO 639-2 language code.
00094         @param value The new value
00095         @param datatype The new datatype: if ommitted, then the existing datatype will be preserved. */
00096     void setText(string lang, const string& value, const string& datatype);
00097     
00098 
00099     //@}
00100 
00101 
00102 
00103 };
00104 
00105 
00106 
00107 /** Local version of Text. */
00108 
00109 class MISC_API LocalText : public virtual Text
00110 {
00111 public:
00112 
00113     /** Constructor */
00114     LocalText(MetaObject* superobject);
00115 
00116     /** Initialize subproperties etc. */
00117     virtual void initialize();
00118 
00119     /** Static generator, for factory. */
00120     static MetaObject* new_LocalText(MetaObject* superobject, const string& type);
00121 
00122     /** Called when this object gets a message */
00123     virtual void sendMessage(Message* m);
00124 
00125 
00126 };
00127 
00128 
00129 /** Remote version of Text. */
00130 
00131 class MISC_API RemoteText : public virtual Text
00132 {
00133 
00134 public:
00135 
00136     /** Constructor */
00137     RemoteText(MetaObject* superobject);
00138 
00139     /** Static generator, for factory. */
00140     static MetaObject* new_RemoteText(MetaObject* superobject, const string& type);
00141 
00142     /** Called when this object gets an update message from its Local master across the network. */
00143     void sendUpdateMessage(Message *m);
00144 
00145 };
00146 
00147 
00148 #endif // #ifdef _TEXT_HH_
00149 

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