smf/inc/common/smfpictures/smfpicture.h
changeset 5 edb9dc8273d9
parent 3 0446eb7b28aa
equal deleted inserted replaced
4:969092730d34 5:edb9dc8273d9
    26 #include <QUrl>
    26 #include <QUrl>
    27 #include <qdatastream.h>
    27 #include <qdatastream.h>
    28 #include <QSharedData>
    28 #include <QSharedData>
    29 #include <smfclientglobal.h>
    29 #include <smfclientglobal.h>
    30 #include <QMetaType>
    30 #include <QMetaType>
       
    31 #include <smfcomment.h>
    31 
    32 
    32 class SmfPicturePrivate;
    33 class SmfPicturePrivate;
    33 
    34 
    34 /**
    35 /**
    35  * SmfPictureVisibility enumeration
    36  * SmfPictureVisibility enumeration
    45 
    46 
    46 /**
    47 /**
    47  * @ingroup smf_common_group
    48  * @ingroup smf_common_group
    48  * The picture class represents an instance of a picture
    49  * The picture class represents an instance of a picture
    49  */
    50  */
    50 class SMFCLIENT_EXPORT SmfPicture : public QObject
    51 class SMFCLIENT_EXPORT SmfPicture
    51 	{
    52 	{
    52 	Q_OBJECT
       
    53 public:
    53 public:
    54 	/**
    54 	/**
    55 	 * Constructor with default argument
    55 	 * Constructor with default argument
    56 	 * @param aParent The parent object
    56 	 */
    57 	 */
    57 	SmfPicture( );
    58 	SmfPicture( QObject *aParent = 0 );
       
    59 	
    58 	
    60 	/**
    59 	/**
    61 	 * Copy Constructor
    60 	 * Copy Constructor
    62 	 * @param aOther The reference object
    61 	 * @param aOther The reference object
    63 	 */
    62 	 */
    64 	SmfPicture( const SmfPicture &aOther );
    63 	SmfPicture( const SmfPicture &aOther );
    65 	
    64 	
    66 	/**
    65 	/**
    67 	 * CConstructs SmfPicture from QImage
    66 	 * CConstructs SmfPicture from QImage
    68 	 * @param aOther The QImage
    67 	 * @param aImage The QImage
    69 	 */
    68 	 */
    70 	SmfPicture( const QImage &image );
    69 	SmfPicture( const QImage &aImage );
       
    70 	
       
    71 	/**
       
    72 	 * Overloaded = operator
       
    73 	 * @param aOther The reference object
       
    74 	 * @return The current object reference
       
    75 	 */
       
    76 	SmfPicture& operator=(const SmfPicture &aOther);
    71 	
    77 	
    72 	/**
    78 	/**
    73 	 * Destructor
    79 	 * Destructor
    74 	 */
    80 	 */
    75 	~SmfPicture( );
    81 	~SmfPicture( );
    76 	
    82 	
       
    83 	/**
       
    84 	 * Method to get a picture owner
       
    85 	 * @return The owner of the picture
       
    86 	 */
       
    87 	QString owner( ) const;
       
    88 	
       
    89 	/**
       
    90 	 * Method to get a picture title
       
    91 	 * @return The title of the picture
       
    92 	 */
       
    93 	QString title( ) const;
       
    94 	
       
    95 	/**
       
    96 	 * Method to get a picture description
       
    97 	 * @return The description of the picture
       
    98 	 */
       
    99 	QString description( ) const;
       
   100 	
       
   101 	/**
       
   102 	 * Method to get a visibility of a picture for public
       
   103 	 * @return The visibility mode of this picture for others
       
   104 	 */
       
   105 	SmfPictureVisibility visibility( ) const;
       
   106 	
       
   107 	/**
       
   108 	 * Method to get the date of posting the picture
       
   109 	 * @return The posted date of the picture
       
   110 	 */
       
   111 	QDateTime postedDate( ) const;
       
   112 	
       
   113 	/**
       
   114 	 * Method to get the comments for the picture
       
   115 	 * @return The comments for the picture
       
   116 	 */
       
   117 	QList<SmfComment> comments( ) const;
       
   118 	
       
   119 	/**
       
   120 	 * Method to get the tags for the picture
       
   121 	 * @return The tags for the picture
       
   122 	 */
       
   123 	QStringList tags( ) const;
       
   124 	
       
   125 	/**
       
   126 	 * Method to get the url of the picture
       
   127 	 * @return The url of the picture
       
   128 	 */
       
   129 	QUrl url( ) const;
       
   130 	
       
   131 	/**
       
   132 	 * Method to get the picture data as QImage
       
   133 	 * @return The picture as QImage
       
   134 	 */
       
   135 	QImage picture( ) const;
       
   136 		
    77 	/**
   137 	/**
    78 	 * Method to get the id of the picture
   138 	 * Method to get the id of the picture
    79 	 * @return The ID value 
   139 	 * @return The ID value 
    80 	 */
   140 	 */
    81 	QString id( ) const;
   141 	QString id( ) const;
    82 	
       
    83 	/**
       
    84 	 * Method to get a picture owner
       
    85 	 * @return The owner of the picture
       
    86 	 */
       
    87 	QString owner( ) const;
       
    88 	
       
    89 	/**
       
    90 	 * Method to get a picture title
       
    91 	 * @return The title of the picture
       
    92 	 */
       
    93 	QString title( ) const;
       
    94 	
       
    95 	/**
       
    96 	 * Method to get a picture description
       
    97 	 * @return The description of the picture
       
    98 	 */
       
    99 	QString description( ) const;
       
   100 	
       
   101 	/**
       
   102 	 * Method to get a visibility of a picture for public
       
   103 	 * @return The visibility mode of this picture for others
       
   104 	 */
       
   105 	SmfPictureVisibility visibility( ) const;
       
   106 	
       
   107 	/**
       
   108 	 * Method to get the date of posting the picture
       
   109 	 * @return The posted date of the picture
       
   110 	 */
       
   111 	QDateTime postedDate( ) const;
       
   112 	
       
   113 	/**
       
   114 	 * Method to get the comments for the picture
       
   115 	 * @return The comments for the picture
       
   116 	 */
       
   117 	QStringList comments( ) const;
       
   118 	
       
   119 	/**
       
   120 	 * Method to get the tags for the picture
       
   121 	 * @return The tags for the picture
       
   122 	 */
       
   123 	QStringList tags( ) const;
       
   124 	
       
   125 	/**
       
   126 	 * Method to get the url of the picture
       
   127 	 * @return The url of the picture
       
   128 	 */
       
   129 	QUrl url( ) const;
       
   130 	
       
   131 	/**
       
   132 	 * Method to get the picture data as QImage
       
   133 	 * @return The picture as QImage
       
   134 	 */
       
   135 	QImage picture( ) const;
       
   136 		
   142 		
   137 	/**
   143 	/**
   138 	 * Method to set a picture owner
   144 	 * Method to set a picture owner
   139 	 * @param aOwner The owner of the picture
   145 	 * @param aOwner The owner of the picture
   140 	 */
   146 	 */
   158 	 * this picture for others
   164 	 * this picture for others
   159 	 */
   165 	 */
   160 	void setVisibility( const SmfPictureVisibility &aVisibility );
   166 	void setVisibility( const SmfPictureVisibility &aVisibility );
   161 	
   167 	
   162 	/**
   168 	/**
       
   169 	 * Method to set the date of posting the picture
       
   170 	 * @param aDate The post date of the picture
       
   171 	 */
       
   172 	void setPostedDate( const QDateTime &aDate );
       
   173 	
       
   174 	/**
   163 	 * Method to add comment on the picture
   175 	 * Method to add comment on the picture
   164 	 * @param aComment The comment for the picture
   176 	 * @param aComment The comment for the picture
   165 	 */
   177 	 */
   166 	void addComment( const QString &aComment );
   178 	void addComment( const SmfComment &aComment );
   167 	
   179 	
   168 	/**
   180 	/**
   169 	 * Method to add tags for the picture
   181 	 * Method to add tags for the picture
   170 	 * @param aTag The tag for the picture
   182 	 * @param aTag The tag for the picture
   171 	 */
   183 	 */
   172 	void addTags( const QStringList &aTags );
   184 	void addTags( const QStringList &aTags );
   173 	
   185 	
   174 	/**
   186 	/**
       
   187 	 * Method to set the url of the picture
       
   188 	 * @param aUrl The url of the picture
       
   189 	 */
       
   190 	void setUrl( const QUrl &aUrl );
       
   191 	
       
   192 	/**
   175 	 * Method to set the picture data as QImage
   193 	 * Method to set the picture data as QImage
   176 	 * @param aData The picture as QImage
   194 	 * @param aData The picture as QImage
   177 	 */
   195 	 */
   178 	void setPicture( const QImage &aData );
   196 	void setPicture( const QImage &aData );
       
   197 	
       
   198 	/**
       
   199 	 * Method to set the id of the picture
       
   200 	 * @param aId The ID value 
       
   201 	 */
       
   202 	void setId( const QString &aId );
   179 	
   203 	
   180 private:
   204 private:
   181 	QSharedDataPointer<SmfPicturePrivate> d;
   205 	QSharedDataPointer<SmfPicturePrivate> d;
   182 	
   206 	
   183 	friend QDataStream &operator<<( QDataStream &aDataStream, 
   207 	friend QDataStream &operator<<( QDataStream &aDataStream, 
   207  * @return reference to the stream
   231  * @return reference to the stream
   208  */
   232  */
   209 QDataStream &operator>>( QDataStream &aDataStream, 
   233 QDataStream &operator>>( QDataStream &aDataStream, 
   210 		SmfPicture &aPic);
   234 		SmfPicture &aPic);
   211 
   235 
       
   236 
   212 // Make the class SmfPicture known to QMetaType, so that as to register it.
   237 // Make the class SmfPicture known to QMetaType, so that as to register it.
   213 Q_DECLARE_METATYPE(SmfPicture)
   238 Q_DECLARE_METATYPE(SmfPicture)
   214 
   239 
       
   240 
   215 #endif /* SMFPICTURE_H_ */
   241 #endif /* SMFPICTURE_H_ */