|
1 /** |
|
2 * @file smfpicture.h |
|
3 * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution |
|
4 * @version 1.0 |
|
5 * |
|
6 * @section LICENSE |
|
7 * |
|
8 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
9 * All rights reserved. |
|
10 * This component and the accompanying materials are made available |
|
11 * under the terms of the "{License}" |
|
12 * which accompanies this distribution, and is available |
|
13 * at the URL "{LicenseUrl}". |
|
14 * |
|
15 * @section DESCRIPTION |
|
16 * |
|
17 * The picture class represents an instance of a picture |
|
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 "SmfClientGlobal.h" |
|
28 /** |
|
29 * SmfPictureVisibility enumeration |
|
30 */ |
|
31 enum SmfPictureVisibility |
|
32 { |
|
33 SMFVisibilityFriend, |
|
34 SMFVisibilityPersonal, |
|
35 SMFVisibilityFamily, |
|
36 SMFVisibilityGroup, |
|
37 SMFVisibilityPublic |
|
38 }; |
|
39 /** |
|
40 * The picture class represents an instance of a picture |
|
41 */ |
|
42 class SMFCLIENT_EXPORT SmfPicture : public QObject |
|
43 { |
|
44 Q_OBJECT |
|
45 public: |
|
46 /** |
|
47 * Constructor with default argument |
|
48 * @param aParent The parent object |
|
49 */ |
|
50 SmfPicture( QObject *aParent = 0 ); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 */ |
|
55 ~SmfPicture( ); |
|
56 |
|
57 |
|
58 /** |
|
59 * Method to get the id of the picture |
|
60 * @param aId The ID value |
|
61 */ |
|
62 void getId( QString &aId ); |
|
63 |
|
64 /** |
|
65 * Method to get a picture owner |
|
66 * @param aOwner The owner of the picture |
|
67 */ |
|
68 void getOwner( QString &aOwner ); |
|
69 |
|
70 /** |
|
71 * Method to get a picture title |
|
72 * @param aTitle The title of the picture |
|
73 */ |
|
74 void getTitle( QString &aTitle ); |
|
75 |
|
76 /** |
|
77 * Method to get a picture description |
|
78 * @param aDescription The description of the picture |
|
79 */ |
|
80 void getDescription( QString &aDescription ); |
|
81 |
|
82 /** |
|
83 * Method to get a visibility of a picture for public |
|
84 * @param aVisibility The visibility mode of |
|
85 * this picture for others |
|
86 */ |
|
87 void getVisibility( SmfPictureVisibility &aVisibility ); |
|
88 |
|
89 /** |
|
90 * Method to get the date of posting the picture |
|
91 * @param aPostedOn The posted date of the picture |
|
92 */ |
|
93 void getPostedDate( QDateTime &aPostedOn ); |
|
94 |
|
95 /** |
|
96 * Method to get the comments for the picture |
|
97 * @param aComments The comments for the picture |
|
98 */ |
|
99 void getComments( QStringList &aComments ); |
|
100 |
|
101 /** |
|
102 * Method to get the tags for the picture |
|
103 * @param aTags The tags for the picture |
|
104 */ |
|
105 void getTags( QStringList &aTags ); |
|
106 |
|
107 /** |
|
108 * Method to get the url of the picture |
|
109 * @param aUrl The url of the picture |
|
110 */ |
|
111 void getUrl( QUrl &aUrl ); |
|
112 |
|
113 /** |
|
114 * Method to get the picture data as a byte array |
|
115 * @param aData The picture as a byte array |
|
116 */ |
|
117 void getPicture( QByteArray &aData ); |
|
118 |
|
119 /** |
|
120 * Method to set a picture owner |
|
121 * @param aOwner The owner of the picture |
|
122 */ |
|
123 void setOwner( const QString &aOwner ); |
|
124 |
|
125 /** |
|
126 * Method to set a picture title |
|
127 * @param aTitle The title of the picture |
|
128 */ |
|
129 void setTitle( const QString &aTitle ); |
|
130 |
|
131 /** |
|
132 * Method to set a picture description |
|
133 * @param aDescription The description of the picture |
|
134 */ |
|
135 void setDescription( const QString &aDescription ); |
|
136 |
|
137 /** |
|
138 * Method to set a visibility of a picture for public |
|
139 * @param aVisibility aVisibility The visibility mode of |
|
140 * this picture for others |
|
141 */ |
|
142 void setVisibility( const SmfPictureVisibility &aVisibility ); |
|
143 |
|
144 /** |
|
145 * Method to set the date of posting the picture |
|
146 * @param aPostedOn The posted date of the picture |
|
147 */ |
|
148 void setPostedDate( const QDateTime &aPostedOn ); |
|
149 |
|
150 /** |
|
151 * Method to set the comments for the picture |
|
152 * @param aComment The comment for the picture |
|
153 */ |
|
154 void setComment( const QString &aComment ); |
|
155 |
|
156 /** |
|
157 * Method to set the tags for the picture |
|
158 * @param aTag The tag for the picture |
|
159 */ |
|
160 void setTag( const QString &aTag ); |
|
161 |
|
162 /** |
|
163 * Method to set the picture data as a byte array |
|
164 * @param aData The picture as a byte array |
|
165 */ |
|
166 void setPicture( const QByteArray &aData ); |
|
167 |
|
168 private: |
|
169 QString m_photoid; // unique ID of the picture, service provider specific |
|
170 QString m_owner; // owner of the picture |
|
171 QString m_title; // picture title |
|
172 QString m_descrition;// description |
|
173 bool m_ispublic;// visibility for public, Set to 0 for no, 1 for yes. |
|
174 bool m_isfriend;// visilibility for friends Set to 0 for no, 1 for yes. |
|
175 bool m_isfamily;// visilibility for family Set to 0 for no, 1 for yes. |
|
176 QDateTime m_postedon;// date posted |
|
177 QStringList m_comments;// comments |
|
178 QStringList m_tags; // tags |
|
179 QUrl m_url; // url |
|
180 QByteArray* m_picture; // picture data as bytearray |
|
181 QString m_caption; // caption |
|
182 |
|
183 }; |
|
184 /** |
|
185 * Externalization |
|
186 */ |
|
187 QDataStream &operator<<(QDataStream &, const SmfPicture&); |
|
188 /** |
|
189 * Internalization |
|
190 */ |
|
191 QDataStream &operator>>(QDataStream &, SmfPicture&); |
|
192 #endif /* SMFPICTURE_H_ */ |