|
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 album class represents an online picture album (collection/gallery) |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFPICTUREALBUM_H_ |
|
21 #define SMFPICTUREALBUM_H_ |
|
22 |
|
23 #include <QImage> |
|
24 #include <QDateTime> |
|
25 #include <QStringList> |
|
26 #include <QUrl> |
|
27 #include <qdatastream.h> |
|
28 #include <QSharedData> |
|
29 #include <smfclientglobal.h> |
|
30 #include <QMetaType> |
|
31 #include <smfcomment.h> |
|
32 #include <smfpicture.h> |
|
33 |
|
34 class SmfPictureAlbumPrivate; |
|
35 /**Implementation const */ |
|
36 const int MaxSmfPictureAlbumSize = 20000;//20KB |
|
37 /** |
|
38 * @ingroup smf_common_group |
|
39 * album class represents an online picture album (collection) |
|
40 */ |
|
41 class SMFCLIENT_EXPORT SmfPictureAlbum |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * Constructor with default argument |
|
46 */ |
|
47 SmfPictureAlbum( ); |
|
48 |
|
49 /** |
|
50 * Copy Constructor |
|
51 * @param aOther The reference object |
|
52 */ |
|
53 SmfPictureAlbum( const SmfPictureAlbum &aOther ); |
|
54 |
|
55 /** |
|
56 * Overloaded = operator |
|
57 * @param aOther The reference object |
|
58 * @return The current object reference |
|
59 */ |
|
60 SmfPictureAlbum& operator=(const SmfPictureAlbum &aOther); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 ~SmfPictureAlbum( ); |
|
66 |
|
67 /** |
|
68 * Method to get a album title |
|
69 * @return The title of the album |
|
70 */ |
|
71 QString title( ) const; |
|
72 |
|
73 /** |
|
74 * Method to get a album description |
|
75 * @return The description of the album |
|
76 */ |
|
77 QString description( ) const; |
|
78 |
|
79 /** |
|
80 * Method to get a visibility of a album for public |
|
81 * @return The visibility mode of this album for others |
|
82 */ |
|
83 SmfPictureVisibility visibility( ) const; |
|
84 |
|
85 /** |
|
86 * Method to get the date of posting the album |
|
87 * @return The posted date of the album |
|
88 */ |
|
89 QDateTime postedDate( ) const; |
|
90 |
|
91 /** |
|
92 * Method to get the comments for the album |
|
93 * @return The comments for the album |
|
94 */ |
|
95 QList<SmfComment> comments( ) const; |
|
96 |
|
97 /** |
|
98 * Method to get the keywords for the album |
|
99 * @return The keywords for the album |
|
100 */ |
|
101 QStringList keywords( ) const; |
|
102 |
|
103 /** |
|
104 * Method to get the url of the album |
|
105 * @return The url of the album |
|
106 */ |
|
107 QUrl url( ) const; |
|
108 |
|
109 /** |
|
110 * Method to get the thumbnail for this album as QImage |
|
111 * @return The picture as QImage |
|
112 */ |
|
113 QImage thumbnail( ) const; |
|
114 |
|
115 /** |
|
116 * Method to get the number of pictures in this album |
|
117 * @return number of pictures in this album |
|
118 */ |
|
119 qint32 pictureCount( ) const; |
|
120 |
|
121 /** |
|
122 * Method to get the id of the album |
|
123 * @return The ID value |
|
124 */ |
|
125 QString id( ) const; |
|
126 |
|
127 /** |
|
128 * Method to set a album title |
|
129 * @param aTitle The title of the album |
|
130 */ |
|
131 void setTitle( const QString &aTitle ); |
|
132 |
|
133 /** |
|
134 * Method to set a album description |
|
135 * @param aDescription The description of the album |
|
136 */ |
|
137 void setDescription( const QString &aDescription ); |
|
138 |
|
139 /** |
|
140 * Method to set a visibility of a album for public |
|
141 * @param aVisibility aVisibility The visibility mode of |
|
142 * this album for others |
|
143 */ |
|
144 void setVisibility( const SmfPictureVisibility &aVisibility ); |
|
145 |
|
146 /** |
|
147 * Method to set the date of posting the album |
|
148 * @param aDate The post date of the album |
|
149 */ |
|
150 void setPostedDate( const QDateTime &aDate ); |
|
151 |
|
152 /** |
|
153 * Method to add comment on the album |
|
154 * @param aComment The comment for the album |
|
155 */ |
|
156 void addComment( const SmfComment &aComment ); |
|
157 |
|
158 /** |
|
159 * Method to add keywords for the album |
|
160 * @param aTag The tag for the album |
|
161 */ |
|
162 void addKeywords( const QStringList &aWords ); |
|
163 |
|
164 /** |
|
165 * Method to set the url of the album |
|
166 * @param aUrl The url of the album |
|
167 */ |
|
168 void setUrl( const QUrl &aUrl ); |
|
169 |
|
170 /** |
|
171 * Method to set the thumbnail for this album as QImage |
|
172 * @return The picture as QImage |
|
173 */ |
|
174 void setThumbnail(const QImage &aImage ); |
|
175 |
|
176 /** |
|
177 * Method to get the number of pictures in this album |
|
178 * @return number of pictures in this album |
|
179 */ |
|
180 void setPictureCount( const qint32 aCount); |
|
181 |
|
182 /** |
|
183 * Method to set the id of the album |
|
184 * @param aId The ID value |
|
185 */ |
|
186 void setId( const QString &aId ); |
|
187 |
|
188 private: |
|
189 QSharedDataPointer<SmfPictureAlbumPrivate> d; |
|
190 |
|
191 friend QDataStream& operator<<( QDataStream &aDataStream, |
|
192 const SmfPictureAlbum &aAlbm ); |
|
193 |
|
194 friend QDataStream& operator>>( QDataStream &aDataStream, |
|
195 SmfPictureAlbum &aAlbm ); |
|
196 |
|
197 }; |
|
198 |
|
199 |
|
200 /** |
|
201 * Method for Externalization. Writes the SmfPictureAlbum object to |
|
202 * the stream and returns a reference to the stream. |
|
203 * @param aDataStream Stream to be written |
|
204 * @param aAlbm The SmfPictureAlbum object to be externalized |
|
205 * @return reference to the written stream |
|
206 */ |
|
207 SMFCLIENT_EXPORT QDataStream& operator<<( QDataStream &aDataStream, |
|
208 const SmfPictureAlbum &aAlbm ); |
|
209 |
|
210 /** |
|
211 * Method for Internalization. Reads a SmfPictureAlbum object from |
|
212 * the stream and returns a reference to the stream. |
|
213 * @param aDataStream Stream to be read |
|
214 * @param aAlbm The SmfPictureAlbum object to be internalized |
|
215 * @return reference to the stream |
|
216 */ |
|
217 SMFCLIENT_EXPORT QDataStream& operator>>( QDataStream &aDataStream, |
|
218 SmfPictureAlbum &aAlbm); |
|
219 |
|
220 typedef QList<SmfPictureAlbum> SmfPictureAlbumList; |
|
221 |
|
222 // Make the class SmfPictureAlbum known to QMetaType, so that as to register it. |
|
223 Q_DECLARE_METATYPE(SmfPictureAlbum) |
|
224 Q_DECLARE_METATYPE(QList<SmfPictureAlbum>) |
|
225 |
|
226 #endif /* SMFPICTUREALBUM_H_ */ |