smf/smfservermodule/smfclient/common/smfcomment.h
changeset 7 be09cf1f39dd
equal deleted inserted replaced
6:c39a6cfd1fb9 7:be09cf1f39dd
       
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "Eclipse Public License v1.0" 
       
     6  * which accompanies  this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  * 
       
    15  * Description:
       
    16  * The comment class represents a comment (on a picture or a music track etc)
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFCOMMENT_H_
       
    21 #define SMFCOMMENT_H_
       
    22 
       
    23 #include <QDateTime>
       
    24 #include <qdatastream.h>
       
    25 #include <QSharedData>
       
    26 #include <smfclientglobal.h>
       
    27 #include <QMetaType>
       
    28 
       
    29 class SmfCommentPrivate;
       
    30 
       
    31 /**
       
    32  * @ingroup smf_common_group
       
    33  * The comment class represents a comment (on a picture or a music track etc)
       
    34  */
       
    35 class SMFCLIENT_EXPORT SmfComment
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 	 * Constructor with default argument
       
    40 	 */
       
    41 	SmfComment( );
       
    42 	
       
    43 	/**
       
    44 	 * Copy Constructor
       
    45 	 * @param aOther The reference object
       
    46 	 */
       
    47 	SmfComment( const SmfComment &aOther );
       
    48 	
       
    49 	/**
       
    50 	 * Overloaded = operator
       
    51 	 * @param aOther The reference object
       
    52 	 * @return The current object reference
       
    53 	 */
       
    54 	SmfComment& operator=(const SmfComment &aOther);
       
    55 	
       
    56 	/**
       
    57 	 * Destructor
       
    58 	 */
       
    59 	~SmfComment( );
       
    60 	
       
    61 	/**
       
    62 	 * Method to get the comment text
       
    63 	 * @return The comment text
       
    64 	 */
       
    65 	QString text( ) const;
       
    66 	
       
    67 	/**
       
    68 	 * Method to get the comment time stamp
       
    69 	 * @return The comment time stamp value
       
    70 	 */
       
    71 	QDateTime timeStamp( ) const;
       
    72 	
       
    73 	/**
       
    74 	 * Method to get the id of the comment
       
    75 	 * @return The ID value 
       
    76 	 */
       
    77 	QString id( ) const;
       
    78 	
       
    79 	/**
       
    80 	 * Method to set the comment text
       
    81 	 * @param aText The comment text to be set
       
    82 	 */
       
    83 	void setText( const QString &aText );
       
    84 	
       
    85 	/**
       
    86 	 * Method to set the time stamp
       
    87 	 * @param aDateTime The comment time stamp value to be set
       
    88 	 */
       
    89 	void setTimeStamp( const QDateTime &aDateTime );
       
    90 	
       
    91 	/**
       
    92 	 * Method to set the id of the comment
       
    93 	 * @param aId The ID value to be set
       
    94 	 */
       
    95 	void setId( const QString &aId );
       
    96 	
       
    97 private:
       
    98 	QSharedDataPointer<SmfCommentPrivate> d;
       
    99 	
       
   100 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   101 			const SmfComment &aComment );
       
   102 
       
   103 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   104 			SmfComment &aComment );
       
   105 	
       
   106 	};
       
   107 
       
   108 
       
   109 /**
       
   110  * Method for Externalization. Writes the SmfComment object to 
       
   111  * the stream and returns a reference to the stream.
       
   112  * @param aDataStream Stream to be written
       
   113  * @param aComment The SmfComment object to be externalized
       
   114  * @return reference to the written stream
       
   115  */
       
   116 SMFCLIENT_EXPORT QDataStream &operator<<( QDataStream &aDataStream, 
       
   117 		const SmfComment &aComment );
       
   118 
       
   119 /**
       
   120  * Method for Internalization. Reads a SmfComment object from 
       
   121  * the stream and returns a reference to the stream.
       
   122  * @param aDataStream Stream to be read
       
   123  * @param aComment The SmfComment object to be internalized
       
   124  * @return reference to the stream
       
   125  */
       
   126 SMFCLIENT_EXPORT QDataStream &operator>>( QDataStream &aDataStream, 
       
   127 		SmfComment &aComment);
       
   128 
       
   129 
       
   130 // Make the class SmfComment known to QMetaType, so that as to register it.
       
   131 Q_DECLARE_METATYPE(SmfComment)
       
   132 
       
   133 
       
   134 #endif /* SMFCOMMENT_H_ */