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 |
|
28 class SmfCommentPrivate; |
|
29 |
|
30 /** |
|
31 * @ingroup smf_common_group |
|
32 * The comment class represents a comment (on a picture or a music track etc) |
|
33 */ |
|
34 class SMFCLIENT_EXPORT SmfComment |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Constructor with default argument |
|
39 */ |
|
40 SmfComment(); |
|
41 |
|
42 /** |
|
43 * Copy Constructor |
|
44 * @param aOther The reference object |
|
45 */ |
|
46 SmfComment( const SmfComment &aOther ); |
|
47 |
|
48 /** |
|
49 * Overloaded = operator |
|
50 * @param aOther The reference object |
|
51 * @return The current object reference |
|
52 */ |
|
53 SmfComment& operator=(const SmfComment &aOther); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 ~SmfComment( ); |
|
59 |
|
60 /** |
|
61 * Method to get the comment text |
|
62 * @return The comment text |
|
63 */ |
|
64 QString text( ) const; |
|
65 |
|
66 /** |
|
67 * Method to get the comment time stamp |
|
68 * @return The comment time stamp value |
|
69 */ |
|
70 QDateTime timeStamp( ) const; |
|
71 |
|
72 /** |
|
73 * Method to get the id of the comment |
|
74 * @return The ID value |
|
75 */ |
|
76 QString id( ) const; |
|
77 |
|
78 /** |
|
79 * Method to get the canonical link for the comment |
|
80 * @return The base url |
|
81 */ |
|
82 QString link( ) const; |
|
83 |
|
84 /** |
|
85 * Method to set the comment text |
|
86 * @param aText The comment text to be set |
|
87 */ |
|
88 void setText( const QString &aText ); |
|
89 |
|
90 /** |
|
91 * Method to set the time stamp |
|
92 * @param aDateTime The comment time stamp value to be set |
|
93 */ |
|
94 void setTimeStamp( const QDateTime &aDateTime ); |
|
95 |
|
96 /** |
|
97 * Method to set the id of the comment |
|
98 * @param aId The ID value to be set |
|
99 */ |
|
100 void setId( const QString &aId ); |
|
101 |
|
102 /** |
|
103 * Method to set the link of the comment |
|
104 * @param aLink The url to be set |
|
105 */ |
|
106 void setLink( const QString &aLink ); |
|
107 |
|
108 private: |
|
109 QSharedDataPointer<SmfCommentPrivate> d; |
|
110 |
|
111 friend QDataStream &operator<<( QDataStream &aDataStream, |
|
112 const SmfComment &aComment ); |
|
113 |
|
114 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
115 SmfComment &aComment ); |
|
116 |
|
117 }; |
|
118 |
|
119 |
|
120 /** |
|
121 * Method for Externalization. Writes the SmfComment object to |
|
122 * the stream and returns a reference to the stream. |
|
123 * @param aDataStream Stream to be written |
|
124 * @param aComment The SmfComment object to be externalized |
|
125 * @return reference to the written stream |
|
126 */ |
|
127 QDataStream &operator<<( QDataStream &aDataStream, |
|
128 const SmfComment &aComment ); |
|
129 |
|
130 /** |
|
131 * Method for Internalization. Reads a SmfComment object from |
|
132 * the stream and returns a reference to the stream. |
|
133 * @param aDataStream Stream to be read |
|
134 * @param aComment The SmfComment object to be internalized |
|
135 * @return reference to the stream |
|
136 */ |
|
137 QDataStream &operator>>( QDataStream &aDataStream, |
|
138 SmfComment &aComment); |
|
139 |
|
140 |
|
141 // Make the class SmfComment known to QMetaType, so that as to register it. |
|
142 Q_DECLARE_METATYPE(SmfComment) |
|
143 |
|
144 |
|
145 #endif /* SMFCOMMENT_H_ */ |
|