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