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