00001 /* $Id: metadata.hh,v 1.14 2003/07/24 05:18:20 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 metadata.hh Defines MetaObject class for Metadata type (revision 0). 00014 00015 */ 00016 00017 #ifndef _METADATA_HH_ 00018 #define _METADATA_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 Metadata Object Type. 00034 00035 A MetaObject which holds metadata for the rest of the object, such as author, creation and modification time, copyright, etc. 00036 00037 */ 00038 00039 class MISC_API Metadata : public virtual MetaObject 00040 { 00041 private: 00042 PropertyAccessControl* defaultPropertyAC; // (passed to Property::setProperty, which ignores it if this object is remote) 00043 00044 public: 00045 00046 /** Constructor */ 00047 Metadata(MetaObject* superobject); 00048 00049 /** Initialize subproperties, and set &NoPropertyAccessControl::static_ to 00050 * be the default property access control policy. */ 00051 virtual void initialize() { 00052 initialize(&NoPropertyAccessControl::static_); 00053 } 00054 00055 /** Initialize subproperties and set the default property access control 00056 * policy. */ 00057 virtual void initialize(PropertyAccessControl* ac); 00058 00059 00060 /** Return type string ("misc:metadata") */ 00061 const string getType(); 00062 00063 /** Register Extenders */ 00064 static void registerExtenders(); 00065 00066 00067 /** @name Access Subobjects */ 00068 //@{ 00069 00070 /** Get the value of title property ( A title, shorter than the description. ). */ 00071 string get_title(); 00072 00073 /** Get the datatype of title property. */ 00074 string get_title_datatype(); 00075 00076 /** Set title property. 00077 @param value The new value 00078 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00079 void set_title(const string& value, const string& datatype = "?"); 00080 00081 /** Get the value of description property ( A description or abstract, longer than title. ). */ 00082 string get_description(); 00083 00084 /** Get the datatype of description property. */ 00085 string get_description_datatype(); 00086 00087 /** Set description property. 00088 @param value The new value 00089 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00090 void set_description(const string& value, const string& datatype = "?"); 00091 00092 /** Get the value of author property ( Name of the author. ). */ 00093 string get_author(); 00094 00095 /** Get the datatype of author property. */ 00096 string get_author_datatype(); 00097 00098 /** Set author property. 00099 @param value The new value 00100 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00101 void set_author(const string& value, const string& datatype = "?"); 00102 00103 /** Get the value of author_url property ( URL to more information about the author. ). */ 00104 string get_author_url(); 00105 00106 /** Get the datatype of author_url property. */ 00107 string get_author_url_datatype(); 00108 00109 /** Set author_url property. 00110 @param value The new value 00111 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00112 void set_author_url(const string& value, const string& datatype = "?"); 00113 00114 /** Get the value of creation_time property ( Time of creation (seconds since 00:00:00 UTC, 1970-01-01). ). */ 00115 string get_creation_time(); 00116 00117 /** Get the datatype of creation_time property. */ 00118 string get_creation_time_datatype(); 00119 00120 /** Set creation_time property. 00121 @param value The new value 00122 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00123 void set_creation_time(const string& value, const string& datatype = "?"); 00124 00125 /** Get the value of modification_time property ( Time of last modification (seconds since 00:00:00 UTC, 1970-01-01). ). */ 00126 string get_modification_time(); 00127 00128 /** Get the datatype of modification_time property. */ 00129 string get_modification_time_datatype(); 00130 00131 /** Set modification_time property. 00132 @param value The new value 00133 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00134 void set_modification_time(const string& value, const string& datatype = "?"); 00135 00136 /** Get the value of copyright property ( Copyright information. ). */ 00137 string get_copyright(); 00138 00139 /** Get the datatype of copyright property. */ 00140 string get_copyright_datatype(); 00141 00142 /** Set copyright property. 00143 @param value The new value 00144 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00145 void set_copyright(const string& value, const string& datatype = "?"); 00146 00147 /** Get the value of version property ( Version number or identifer. ). */ 00148 string get_version(); 00149 00150 /** Get the datatype of version property. */ 00151 string get_version_datatype(); 00152 00153 /** Set version property. 00154 @param value The new value 00155 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00156 void set_version(const string& value, const string& datatype = "?"); 00157 00158 /** Get the value of language property ( Language of text, if applicable, in the format described by RFC 1766 (http://www.rfc-editor.org/rfc/rfc1766.txt), which is essentially ISO standard 639 with some extensions. Language may also be given as a parameter to a text type identifier in a property typestring.). */ 00159 string get_language(); 00160 00161 /** Get the datatype of language property. */ 00162 string get_language_datatype(); 00163 00164 /** Set language property. 00165 @param value The new value 00166 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00167 void set_language(const string& value, const string& datatype = "?"); 00168 00169 /** Get the value of comment property ( Any comment. ). */ 00170 string get_comment(); 00171 00172 /** Get the datatype of comment property. */ 00173 string get_comment_datatype(); 00174 00175 /** Set comment property. 00176 @param value The new value 00177 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. */ 00178 void set_comment(const string& value, const string& datatype = "?"); 00179 00180 //@} 00181 00182 00183 }; 00184 00185 00186 00187 /** Local version of Metadata. */ 00188 00189 class MISC_API LocalMetadata : public virtual Metadata 00190 { 00191 00192 public: 00193 00194 /** Constructor */ 00195 LocalMetadata(MetaObject* superobject); 00196 00197 00198 /** Static generator, for factory. */ 00199 static MetaObject* new_LocalMetadata(MetaObject* superobject, const string& type); 00200 00201 /** Called when this object gets a message */ 00202 virtual void sendMessage(Message* m); 00203 00204 }; 00205 00206 00207 /** Remote version of Metadata. */ 00208 00209 class MISC_API RemoteMetadata : public virtual Metadata 00210 { 00211 00212 public: 00213 00214 /** Constructor */ 00215 RemoteMetadata(MetaObject* superobject); 00216 00217 /** Static generator, for factory. */ 00218 static MetaObject* new_RemoteMetadata(MetaObject* superobject, const string& type); 00219 00220 /** Called when this object gets an update message from its Local master across the network. */ 00221 void sendUpdateMessage(Message *m); 00222 00223 }; 00224 00225 00226 #endif // #ifdef _METADATA_HH_ 00227