smf/inc/common/smfevent/smfevent.h
changeset 7 be09cf1f39dd
parent 6 c39a6cfd1fb9
child 8 4102c67b6e56
equal deleted inserted replaced
6:c39a6cfd1fb9 7:be09cf1f39dd
     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 SmfEvent class represents an event
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFEVENT_H_
       
    21 #define SMFEVENT_H_
       
    22 
       
    23 #include <smfplace.h>
       
    24 #include <smfartists.h>
       
    25 #include <QStringList>
       
    26 #include <qdatastream.h>
       
    27 #include <QSharedData>
       
    28 #include <smfclientglobal.h>
       
    29 
       
    30 class SmfEventPrivate;
       
    31 
       
    32 /**
       
    33  * @ingroup smf_common_group
       
    34  * The event class represents an event
       
    35  */
       
    36 class SMFCLIENT_EXPORT SmfEvent
       
    37 	{
       
    38 public:
       
    39 	/**
       
    40 	 * Constructor with default argument
       
    41 	 */
       
    42 	SmfEvent( );
       
    43 	
       
    44 	/**
       
    45 	 * Copy Constructor
       
    46 	 * @param aOther The reference object
       
    47 	 */
       
    48 	SmfEvent( const SmfEvent &aOther );
       
    49 	
       
    50 	/**
       
    51 	 * Overloaded = operator
       
    52 	 * @param aOther The reference object
       
    53 	 * @return The current object reference
       
    54 	 */
       
    55 	SmfEvent& operator=( const SmfEvent &aOther );
       
    56 	
       
    57 	/**
       
    58 	 * Destructor
       
    59 	 */
       
    60 	~SmfEvent( );
       
    61 	
       
    62 	/**
       
    63 	 * Method to get the event name
       
    64 	 * @return The event name
       
    65 	 */
       
    66 	QString title( ) const;
       
    67 	
       
    68 	/**
       
    69 	 * Method to get the event date and time
       
    70 	 * @return The date and time of the event
       
    71 	 */
       
    72 	QDateTime eventDateTime( ) const;
       
    73 	
       
    74 	/**
       
    75 	 * Method to get the event duration
       
    76 	 * @return The duration of the event
       
    77 	 */
       
    78 	QTime duration( ) const;
       
    79 	
       
    80 	/**
       
    81 	 * Method to get the artist names
       
    82 	 * @return The list of artists in the event
       
    83 	 */
       
    84 	SmfArtists artists( ) const;
       
    85 	
       
    86 	/**
       
    87 	 * Method to get the venue of the event
       
    88 	 * @return The venue of the event
       
    89 	 */
       
    90 	SmfPlace venue( ) const;
       
    91 	
       
    92 	/**
       
    93 	 * Method to get the URL for getting tickets for the event
       
    94 	 * @return The Url for getting ticket for the event
       
    95 	 */
       
    96 	QUrl ticketUrl( ) const;
       
    97 	
       
    98 	/**
       
    99 	 * Method to get the id of the event
       
   100 	 * @return The ID value 
       
   101 	 */
       
   102 	QString id( ) const;
       
   103 	
       
   104 	/**
       
   105 	 * Method to set the event name
       
   106 	 * @param aName The new event name
       
   107 	 */
       
   108 	void setTitle( const QString &aName );
       
   109 	
       
   110 	/**
       
   111 	 * Method to set the event date and time
       
   112 	 * @param aDateTime The new date and time of the event
       
   113 	 * 
       
   114 	 */
       
   115 	void setEventDateTime( const QDateTime &aDateTime );
       
   116 	
       
   117 	/**
       
   118 	 * Method to set the event duration
       
   119 	 * @param aDuration The new duration of the event
       
   120 	 * 
       
   121 	 */
       
   122 	void setDuration( const QTime &aDuration );
       
   123 	
       
   124 	/**
       
   125 	 * Method to set the artist
       
   126 	 * @param aArtists The new artists in the event
       
   127 	 */
       
   128 	void setArtists( const SmfArtists &aArtists );
       
   129 	
       
   130 	/**
       
   131 	 * Method to set the venue name
       
   132 	 * @param aVenue The new venue of the event
       
   133 	 */
       
   134 	void setVenue( const SmfPlace &aVenue );
       
   135 	
       
   136 	/**
       
   137 	 * Method to set the URL for getting tickets for the event
       
   138 	 * @param aUrl The new Url for getting ticket for the event
       
   139 	 */
       
   140 	void setTicketUrl( const QUrl &aUrl );
       
   141 	
       
   142 	/**
       
   143 	 * Method to set the id of the event
       
   144 	 * @param aId The ID value 
       
   145 	 */
       
   146 	void setId( const QString &aId );
       
   147 	
       
   148 private:
       
   149 	QSharedDataPointer<SmfEventPrivate> d;
       
   150 	
       
   151 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   152 			const SmfEvent &aEvent );
       
   153 
       
   154 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   155 			SmfEvent &aEvent );
       
   156 	
       
   157 	};
       
   158 
       
   159 
       
   160 /**
       
   161  * Method for Externalization. Writes the SmfEvent object to 
       
   162  * the stream and returns a reference to the stream.
       
   163  * @param aDataStream Stream to be written
       
   164  * @param aEvent The SmfEvent object to be externalized
       
   165  * @return reference to the written stream
       
   166  */
       
   167 QDataStream &operator<<( QDataStream &aDataStream, 
       
   168 		const SmfEvent &aEvent );
       
   169 
       
   170 /**
       
   171  * Method for Internalization. Reads a SmfEvent object from 
       
   172  * the stream and returns a reference to the stream.
       
   173  * @param aDataStream Stream to be read
       
   174  * @param aEvent The SmfEvent object to be internalized
       
   175  * @return reference to the stream
       
   176  */
       
   177 QDataStream &operator>>( QDataStream &aDataStream, 
       
   178 		SmfEvent &aEvent);
       
   179 
       
   180 
       
   181 // Make the class SmfEvent known to QMetaType, so that as to register it.
       
   182 Q_DECLARE_METATYPE(SmfEvent)
       
   183 
       
   184 
       
   185 #endif /* SMFEVENT_H_ */