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 picture class represents an instance of a picture |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFPICTURE_H_ |
|
21 #define SMFPICTURE_H_ |
|
22 |
|
23 #include <QDateTime> |
|
24 #include <QStringList> |
|
25 #include <QUrl> |
|
26 #include <qdatastream.h> |
|
27 #include <QSharedData> |
|
28 #include <smfclientglobal.h> |
|
29 |
|
30 class SmfPicturePrivate; |
|
31 |
|
32 /** |
|
33 * SmfPictureVisibility enumeration |
|
34 */ |
|
35 enum SmfPictureVisibility |
|
36 { |
|
37 SMFVisibilityFriend, |
|
38 SMFVisibilityPersonal, |
|
39 SMFVisibilityFamily, |
|
40 SMFVisibilityGroup, |
|
41 SMFVisibilityPublic |
|
42 }; |
|
43 |
|
44 /** |
|
45 * @ingroup smf_common_group |
|
46 * The picture class represents an instance of a picture |
|
47 */ |
|
48 class SMFCLIENT_EXPORT SmfPicture : public QObject |
|
49 { |
|
50 Q_OBJECT |
|
51 public: |
|
52 /** |
|
53 * Constructor with default argument |
|
54 * @param aParent The parent object |
|
55 */ |
|
56 SmfPicture( QObject *aParent = 0 ); |
|
57 |
|
58 /** |
|
59 * Copy Constructor |
|
60 * @param aOther The reference object |
|
61 */ |
|
62 SmfPicture( const SmfPicture &aOther ); |
|
63 |
|
64 /** |
|
65 * CConstructs SmfPicture from QImage |
|
66 * @param aOther The QImage |
|
67 */ |
|
68 SmfPicture( const QImage &image ); |
|
69 |
|
70 /** |
|
71 * Destructor |
|
72 */ |
|
73 ~SmfPicture( ); |
|
74 |
|
75 /** |
|
76 * Method to get the id of the picture |
|
77 * @return The ID value |
|
78 */ |
|
79 QString id( ) const; |
|
80 |
|
81 /** |
|
82 * Method to get a picture owner |
|
83 * @return The owner of the picture |
|
84 */ |
|
85 QString owner( ) const; |
|
86 |
|
87 /** |
|
88 * Method to get a picture title |
|
89 * @return The title of the picture |
|
90 */ |
|
91 QString title( ) const; |
|
92 |
|
93 /** |
|
94 * Method to get a picture description |
|
95 * @return The description of the picture |
|
96 */ |
|
97 QString description( ) const; |
|
98 |
|
99 /** |
|
100 * Method to get a visibility of a picture for public |
|
101 * @return The visibility mode of this picture for others |
|
102 */ |
|
103 SmfPictureVisibility visibility( ) const; |
|
104 |
|
105 /** |
|
106 * Method to get the date of posting the picture |
|
107 * @return The posted date of the picture |
|
108 */ |
|
109 QDateTime postedDate( ) const; |
|
110 |
|
111 /** |
|
112 * Method to get the comments for the picture |
|
113 * @return The comments for the picture |
|
114 */ |
|
115 QStringList comments( ) const; |
|
116 |
|
117 /** |
|
118 * Method to get the tags for the picture |
|
119 * @return The tags for the picture |
|
120 */ |
|
121 QStringList tags( ) const; |
|
122 |
|
123 /** |
|
124 * Method to get the url of the picture |
|
125 * @return The url of the picture |
|
126 */ |
|
127 QUrl url( ) const; |
|
128 |
|
129 /** |
|
130 * Method to get the picture data as QImage |
|
131 * @return The picture as QImage |
|
132 */ |
|
133 QImage picture( ) const; |
|
134 |
|
135 /** |
|
136 * Method to set a picture owner |
|
137 * @param aOwner The owner of the picture |
|
138 */ |
|
139 void setOwner( const QString &aOwner ); |
|
140 |
|
141 /** |
|
142 * Method to set a picture title |
|
143 * @param aTitle The title of the picture |
|
144 */ |
|
145 void setTitle( const QString &aTitle ); |
|
146 |
|
147 /** |
|
148 * Method to set a picture description |
|
149 * @param aDescription The description of the picture |
|
150 */ |
|
151 void setDescription( const QString &aDescription ); |
|
152 |
|
153 /** |
|
154 * Method to set a visibility of a picture for public |
|
155 * @param aVisibility aVisibility The visibility mode of |
|
156 * this picture for others |
|
157 */ |
|
158 void setVisibility( const SmfPictureVisibility &aVisibility ); |
|
159 |
|
160 /** |
|
161 * Method to add comment on the picture |
|
162 * @param aComment The comment for the picture |
|
163 */ |
|
164 void addComment( const QString &aComment ); |
|
165 |
|
166 /** |
|
167 * Method to add tags for the picture |
|
168 * @param aTag The tag for the picture |
|
169 */ |
|
170 void addTags( const QStringList &aTags ); |
|
171 |
|
172 /** |
|
173 * Method to set the picture data as QImage |
|
174 * @param aData The picture as QImage |
|
175 */ |
|
176 void setPicture( const QImage &aData ); |
|
177 |
|
178 private: |
|
179 QSharedDataPointer<SmfPicturePrivate> d; |
|
180 |
|
181 friend QDataStream &operator<<( QDataStream &aDataStream, |
|
182 const SmfPicture &aPic ); |
|
183 |
|
184 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
185 SmfPicture &aPic ); |
|
186 |
|
187 }; |
|
188 |
|
189 |
|
190 /** |
|
191 * Method for Externalization. Writes the SmfPicture object to |
|
192 * the stream and returns a reference to the stream. |
|
193 * @param aDataStream Stream to be written |
|
194 * @param aPic The SmfPicture object to be externalized |
|
195 * @return reference to the written stream |
|
196 */ |
|
197 QDataStream &operator<<( QDataStream &aDataStream, |
|
198 const SmfPicture &aPic ); |
|
199 |
|
200 /** |
|
201 * Method for Internalization. Reads a SmfPicture object from |
|
202 * the stream and returns a reference to the stream. |
|
203 * @param aDataStream Stream to be read |
|
204 * @param aPic The SmfPicture object to be internalized |
|
205 * @return reference to the stream |
|
206 */ |
|
207 QDataStream &operator>>( QDataStream &aDataStream, |
|
208 SmfPicture &aPic); |
|
209 |
|
210 #endif /* SMFPICTURE_H_ */ |
|