/home/tetron/hack/vos/libs/vos/metaobjects/misc/metadata.hh
Go to the documentation of this file.00001 /* $Id: metadata.hh,v 1.11 2005/12/18 09:59:40 tetron Exp $ */ 00002 00003 #ifndef _VOS_METADATA_HH_ 00004 #define _VOS_METADATA_HH_ 00005 00006 #include <vos/vos/vos.hh> 00007 00008 #include <time.h> // defines time_t 00009 00010 #include "miscdefs.hh" 00011 #ifndef MISC_EXPORTS 00012 IMPORT_METAOBJECT_FACTORIES(Metadata) 00013 #endif 00014 00015 namespace VOS { 00016 00017 /** @class Metadata metadata.hh vos/metaobjects/misc/metadata.hh 00018 * @ingroup libmetaobject_misc 00019 00020 A MetaObject which holds metadata for the rest of the object, such as author, creation and modification time, copyright, etc. 00021 00022 */ 00023 00024 class MISC_API Metadata : public MetaObject 00025 { 00026 public: 00027 00028 /** @internal */ 00029 Metadata(VobjectBase* superobject); 00030 00031 /** @internal */ 00032 static MetaObject* new_Metadata(VobjectBase* s, const std::string& type); 00033 00034 /** Return type string ("misc:metadata") */ 00035 const std::string getVOSType(); 00036 00037 /** Get the value of title property ( A title, shorter than the description. ). */ 00038 //@{ 00039 std::string getTitle(); 00040 void getTitle(std::string& s, std::string& datatype); 00041 //@} 00042 00043 /** Get the datatype of title property. */ 00044 std::string getTitleDatatype(); 00045 00046 /** Get the title object */ 00047 VUtil::vRef<Property> getTitleObj(); 00048 00049 /** Set title property. 00050 @param value The new value 00051 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. 00052 */ 00053 void setTitle(const std::string& value, const std::string& datatype = "?"); 00054 00055 /** Get the value of description property ( A description or abstract, longer than title. ). */ 00056 //@{ 00057 std::string getDescription(); 00058 void getDescription(std::string& d, std::string& datatype); 00059 //@} 00060 00061 /** Get the datatype of description property. */ 00062 std::string getDescriptionDatatype(); 00063 00064 00065 /** Get description object */ 00066 VUtil::vRef<Property> getDescriptionObj(); 00067 00068 00069 /** Set description property. 00070 @param value The new value 00071 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. 00072 */ 00073 void setDescription(const std::string& value, const std::string& datatype = "?"); 00074 00075 00076 /** Get the author ( Name of the author or original creator. ). */ 00077 //@{ 00078 std::string getAuthor(); 00079 std::string getAuthorDatatype(); 00080 void getAuthor(std::string& s, std::string& t); 00081 //@} 00082 00083 00084 00085 /** Get the author property object */ 00086 VUtil::vRef<Property> getAuthorObj(); 00087 00088 /** Set author property. 00089 @param value The new value 00090 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. 00091 */ 00092 void setAuthor(const std::string& value, const std::string& datatype = "?"); 00093 00094 00095 /** Get the value of author_url property ( URL to more information about the author. ). */ 00096 std::string getAuthorUrl(); 00097 00098 /** Get the author url property object */ 00099 VUtil::vRef<Property> getAuthorUrlObj(); 00100 00101 /** Set author_url property. 00102 @param value The new value 00103 */ 00104 void setAuthorUrl(const std::string& value); 00105 00106 00107 /** Get the value of creation_time (Time of creation) property in POSIX ofrm (seconds since 00:00:00 UTC, 1970-01-01). */ 00108 time_t getCreationTime(); 00109 00110 /** Get the creation time property object. */ 00111 VUtil::vRef<Property> getCreationTimeObj(); 00112 00113 /** Set creation_time property. 00114 @param value The new value 00115 */ 00116 void setCreationTime(time_t value); 00117 00118 00119 /** Get the value of modification_time (Time of last modification) property in POSIX form. (seconds since 00:00:00 UTC, 1970-01-01).*/ 00120 time_t getModificationTime(); 00121 00122 00123 /** Get the modification time property object */ 00124 VUtil::vRef<Property> getModificationTimeObj(); 00125 00126 /** Set modification_time property. 00127 @param value The new value 00128 */ 00129 void setModificationTime(time_t value); 00130 00131 00132 /** Get the value of copyright property ( Copyright information. ). */ 00133 //@{ 00134 std::string getCopyright(); 00135 void getCopyright(std::string& s, std::string& t) ; 00136 //@} 00137 00138 00139 /** Get the datatype of copyright property. */ 00140 std::string getCopyrightDatatype(); 00141 00142 /** Get copyright property object */ 00143 VUtil::vRef<Property> getCopyrightObj(); 00144 00145 00146 /** Set copyright property. 00147 @param value The new value 00148 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. 00149 */ 00150 void setCopyright(const std::string& value, const std::string& datatype = "?"); 00151 00152 /** Get the CreativeCommons license. This is an RDF document or a URL to an 00153 * RDF or an HTML document with embedded RDF. See 00154 * http://web.resource.org/cc/ and 00155 * http://www.creativecommons.org for more information. 00156 * Here is an example license RDF: 00157 * <pre> 00158 <rdf:RDF xmlns="http://web.resource.org/cc/" 00159 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 00160 <License rdf:about="http://creativecommons.org/licenses/by-nc-sa/1.0/"> 00161 <permits rdf:resource="http://web.resource.org/cc/Reproduction" /> 00162 <permits rdf:resource="http://web.resource.org/cc/Distribution" /> 00163 <requires rdf:resource="http://web.resource.org/cc/Notice" /> 00164 <requires rdf:resource="http://web.resource.org/cc/Attribution" /> 00165 <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" /> 00166 <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> 00167 <requires rdf:resource="http://web.resource.org/cc/ShareAlike" /> 00168 </License> 00169 </rdf:RDF> 00170 </pre> 00171 */ 00172 //@{ 00173 std::string getCreativeCommonsLicense(); 00174 void getCreativeCommonsLicense(std::string& s); 00175 //@} 00176 00177 /** Set the CreativeCommons license */ 00178 void setCreativeCommonsLicense(const std::string& s); 00179 00180 00181 /** Get the value of version property ( Version number or identifer. ). */ 00182 std::string getVersion(); 00183 00184 00185 /** Get the datatype of version property. */ 00186 std::string getVersionDatatype(); 00187 00188 00189 /** Set version property. 00190 @param value The new value 00191 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. 00192 */ 00193 void setVersion(const std::string& value, const std::string& datatype = "?"); 00194 00195 00196 /** 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 datatype.). */ 00197 std::string getLanguage(); 00198 00199 00200 /** Set language property. 00201 @param value The new value 00202 00203 */ 00204 void setLanguage(const std::string& value); 00205 00206 /** Get language property object */ 00207 VUtil::vRef<Property> getLanguageObj(); 00208 00209 00210 /** Get the value of comment property ( Any comment. ). */ 00211 //@{ 00212 std::string getComment(); 00213 void getComment(std::string& s, std::string& t); 00214 00215 00216 /** Get the datatype of comment property. */ 00217 std::string getCommentDatatype(); 00218 00219 /** Get the comment property object */ 00220 VUtil::vRef<Property> getCommentObj(); 00221 00222 /** Set comment property. 00223 @param value The new value 00224 @param datatype The new datatype: if omitted, then the existing datatype will be preserved. 00225 */ 00226 void setComment(const std::string& value, const std::string& datatype = "?"); 00227 00228 00229 }; // class Metadata 00230 00231 00232 } // namespace VOS 00233 00234 00235 #endif // #ifdef _VOS_METADATA_HH_ 00236