diff -r b5d63d5fc252 -r a469c0e6e7fb smf/smfservermodule/smfclient/common/smfactions.h --- a/smf/smfservermodule/smfclient/common/smfactions.h Mon Jun 07 11:43:45 2010 +0100 +++ b/smf/smfservermodule/smfclient/common/smfactions.h Wed Jun 23 19:51:49 2010 +0530 @@ -9,6 +9,9 @@ * Initial Contributors: * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution * + * Contributors: + * Manasij Roy, Nalina Hariharan + * * Description: * Represents activities in terms similar to standard activity stream http://activitystrea.ms/ */ @@ -26,7 +29,13 @@ #include #include "smfclientglobal.h" +#include "smfpost.h" +#include "smfcontact.h" +/** + * Implementation const + */ +const int MaxSmfActivityEntrySize = 5000; /** * The actions in the activity based on Atom Activity Base Schema @@ -44,7 +53,7 @@ SmfActivitySave, SmfActivityShare, SmfActivityTag, - SmfActivityUpdate, + SmfActivityUpdate }; /** @@ -93,7 +102,7 @@ { public: /** - * Constructor with default argument + * Constructor */ SmfActivityObject(); @@ -103,102 +112,122 @@ SmfActivityObject(const SmfActivityObject& aOther); /** + * Overloaded = operator + * @param aOther The reference object + * @return The target reference value + */ + SmfActivityObject& operator=( const SmfActivityObject &aOther ); + + /** * Destructor */ ~SmfActivityObject(); /** - * retruns service specific Id of this object in the entry + * @return returns service specific Id of this object in the entry */ QString id() const; /** - * returns thumbnail if availabel for this object in the entry + * @return returns thumbnail if availabel for this object in the entry */ QImage thumbnail() const; /** - * Captions for this object + * @return Captions for this object */ QString caption() const; /** - * retruns the type of this object + * @return retruns the type of this object */ - SmfActivityObjectType type() const; + SmfActivityObjectType type( ) const; /** - * returns data of the object - see type() for casting + * @return returns data of the object - see type() for casting */ QVariant objData() const; /** - * url of this object, e.g. url of the image on which somebody commented + * @return url of this object, e.g. url of the image on which somebody commented */ QString link() const; /** - * Time of creation of this object + * @return Time of creation of this object */ QDateTime time() const; /** - * Description of the content of this object + * @return Description of the content of this object */ QString content() const; /** - * sets service specific id for this object + * Sets service specific id for this object + * @param aId The id to be set */ void setId(const QString& aId); /** - * sets thumbnail for this object , not mandatory + * Sets thumbnail for this object , not mandatory + * @param aIcon The thumbnail image */ void setThumbnail(const QImage& aIcon); /** - * sets caption for this object + * Sets caption for this object + * @param aCaption The caption to be set */ void setCaption(const QString& aCap); /** - * sets type of this object - ObjData should be set next accordingly + * Sets type of this object - ObjData should be set next accordingly + * @param aObjType The activity type to be set */ void setType(const SmfActivityObjectType& aObjType); /** - * sets object data e,g, SmfImage, SmfComment, SmfMusic, SmfEvent etc + * Sets object data e,g, SmfImage, SmfComment, SmfMusic, SmfEvent etc * setType() with suitable type should have been called before + * @param aData The object data to be set */ void setObjData( const QVariant& aData); + /** - * sets the url for the object + * Sets the url for the object + * @param aLink The Link to be set */ void setLink( const QString& aLink); + /** - * sets the time of creation/last modification of the object + * Sets the time of creation/last modification of the object + * @param aTime The time to be set */ void setTime( const QDateTime& aTime); /** - * sets the description of the content of this object + * Sets the description of the content of this object + * @param aText The content to be set */ void setContent( const QString& aText) ; private: QSharedDataPointer d; - friend QDataStream& operator >> ( QDataStream &aOut, const SmfActivityObject& aData); + friend QDataStream& operator >> ( QDataStream &aOut, SmfActivityObject& aData); friend QDataStream& operator << ( QDataStream &aIn, const SmfActivityObject& aData); }; + +SMFCLIENT_EXPORT QDataStream& operator >> ( QDataStream &aOut, SmfActivityObject& aData); +SMFCLIENT_EXPORT QDataStream& operator << ( QDataStream &aIn, const SmfActivityObject& aData); + // Make the class SmfActivityObject known to QMetaType, so that as to register it. Q_DECLARE_METATYPE(SmfActivityObject) - class SmfActivityEntryPrivate; /** * @ingroup smf_common_group @@ -214,27 +243,27 @@ ~SmfActivityEntry(); /** - * Returns service specific id of the of entry + * @return Returns service specific id of the of entry */ QString id() const; /** - * returns the title of the entry - mostly be a string + * @return Returns the title of the entry - mostly be a string */ SmfPost title() const; /** - * returns detail descriptiopn of this entry in the activity list. might be absent if title is sufficient + * @return Returns detail descriptiopn of this entry in the activity list. might be absent if title is sufficient */ SmfPost details() const; /** - * returns the author of the activity - the name and the uri field are most commonly used + * @return Returns the author of the activity - the name and the uri field are most commonly used * Other information fields might be empty */ SmfContact author() const; /** - * returns the verb of the activity ,e.g. Robin "marked" Joseph as a friend + * @return Returns the verb of the activity ,e.g. Robin "marked" Joseph as a friend */ SmfActivityVerb actionName() const; @@ -245,55 +274,65 @@ QList activities() const; /** - * returns information about the target of the activity, for verbs that support a target. + * @return Returns information about the target of the activity, for verbs that support a target. * For example, a target is a photo album to which photos were added */ SmfActivityObject targetObj() const; /** - * sets service specific id of the of entry + * Sets service specific id of the of entry + * @param aId The id to be set */ bool setId( const QString& aId); /** - * sets the title of the entry - mostly be a string + * Sets the title of the entry - mostly be a string + * @param aTitle The title to be set */ bool setTitle(const SmfPost& aTitle); /** - * sets detail descriptiopn of this entry in the activity list. might be absent if title is sufficient + * Sets detail description of this entry in the activity list. might be absent if title is sufficient + * @param aDetails The details to be set */ bool setDetails(const SmfPost& aDetails); /** - * sets the author of the activity - the name and the uri field are most commonly used - * Other information fields might be empty + * Sets the author of the activity - the name and the uri field are most commonly used + * Oher information fields might be empty + * @param aContact The author to be set */ bool setAuthor(const SmfContact& aContact); /** - * sets the verb of the activity ,e.g. Robin "marked" Joseph as a friend + * Sets the verb of the activity ,e.g. Robin "marked" Joseph as a friend + * @param aVerb The action name to be set */ void setActionName(SmfActivityVerb aVerb); /** - * sets single or multiple objects in a single activity entry, though multiple may be rare - only for few verbs. + * Sets single or multiple objects in a single activity entry, though multiple may be rare - only for few verbs. * @param list of activity objects (mostly one object) */ bool setActivities(QList& aList); /** - * returns information about the target of the activity, for verbs that support a target. + * Returns information about the target of the activity, for verbs that support a target. * For example, a target is a photo album to which photos were added + * @param aTarget The activity object to be set */ bool setTargetObj(const SmfActivityObject& aTarget); private: QSharedDataPointer d; - friend QDataStream& operator >> ( QDataStream &aOut, const SmfActivityEntry& aData); + friend QDataStream& operator >> ( QDataStream &aOut, SmfActivityEntry& aData); friend QDataStream& operator << ( QDataStream &aIn, const SmfActivityEntry& aData); }; + +SMFCLIENT_EXPORT QDataStream& operator >> ( QDataStream &aOut, const SmfActivityEntry& aData); +SMFCLIENT_EXPORT QDataStream& operator << ( QDataStream &aIn, const SmfActivityEntry& aData); + // Make the class SmfActivityEntry known to QMetaType, so that as to register it. Q_DECLARE_METATYPE(SmfActivityEntry)