example/clientapi/smf/inc/common/smfevent/smfevent.h
changeset 3 0446eb7b28aa
parent 2 86af6c333601
child 4 969092730d34
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
     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 : public QObject
       
    37 	{
       
    38 	Q_OBJECT
       
    39 public:
       
    40 	/**
       
    41 	 * Constructor with default argument
       
    42 	 * @param aParent The parent object
       
    43 	 */
       
    44 	SmfEvent( QObject *aParent = 0 );
       
    45 	
       
    46 	/**
       
    47 	 * Copy Constructor
       
    48 	 * @param aOther The reference object
       
    49 	 */
       
    50 	SmfEvent( const SmfEvent &aOther );
       
    51 	
       
    52 	/**
       
    53 	 * Destructor
       
    54 	 */
       
    55 	~SmfEvent( );
       
    56 	
       
    57 	/**
       
    58 	 * Method to get the event name
       
    59 	 * @return The event name
       
    60 	 */
       
    61 	QString title( ) const;
       
    62 	
       
    63 	/**
       
    64 	 * Method to get the event date and time
       
    65 	 * @return The date and time of the event
       
    66 	 */
       
    67 	QDateTime eventDateTime( ) const;
       
    68 	
       
    69 	/**
       
    70 	 * Method to get the event duration
       
    71 	 * @return The duration of the event
       
    72 	 */
       
    73 	QTime duration( ) const;
       
    74 	
       
    75 	/**
       
    76 	 * Method to get the artist names
       
    77 	 * @return The list of artists in the event
       
    78 	 */
       
    79 	SmfArtists artists( ) const;
       
    80 	
       
    81 	/**
       
    82 	 * Method to get the venue of the event
       
    83 	 * @return The venue of the event
       
    84 	 */
       
    85 	SmfPlace venue( ) const;
       
    86 	
       
    87 	/**
       
    88 	 * Method to get the URL for getting tickets for the event
       
    89 	 * @return The Url for getting ticket for the event
       
    90 	 */
       
    91 	QUrl ticketUrl( ) const;
       
    92 	
       
    93 	/**
       
    94 	 * Method to get the id of the event
       
    95 	 * @return The ID value 
       
    96 	 */
       
    97 	QString id( ) const;
       
    98 	
       
    99 	/**
       
   100 	 * Method to set the event name
       
   101 	 * @param aName The new event name
       
   102 	 */
       
   103 	void setTitle( const QString &aName );
       
   104 	
       
   105 	/**
       
   106 	 * Method to set the event date and time
       
   107 	 * @param aDateTime The new date and time of the event
       
   108 	 * 
       
   109 	 */
       
   110 	void setEventDateTime( const QDateTime &aDateTime );
       
   111 	
       
   112 	/**
       
   113 	 * Method to set the event duration
       
   114 	 * @param aDuration The new duration of the event
       
   115 	 * 
       
   116 	 */
       
   117 	void setDuration( const QTime &aDuration );
       
   118 	
       
   119 	/**
       
   120 	 * Method to set the artist
       
   121 	 * @param aArtists The new artists in the event
       
   122 	 */
       
   123 	void setArtists( const SmfArtists &aArtists );
       
   124 	
       
   125 	/**
       
   126 	 * Method to set the venue name
       
   127 	 * @param aVenue The new venue of the event
       
   128 	 */
       
   129 	void setVenue( const SmfPlace &aVenue );
       
   130 	
       
   131 	/**
       
   132 	 * Method to set the URL for getting tickets for the event
       
   133 	 * @param aUrl The new Url for getting ticket for the event
       
   134 	 */
       
   135 	void setTicketUrl( const QUrl &aUrl );
       
   136 	
       
   137 private:
       
   138 	QSharedDataPointer<SmfEventPrivate> d;
       
   139 	
       
   140 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   141 			const SmfEvent &aEvent );
       
   142 
       
   143 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   144 			SmfEvent &aEvent );
       
   145 	
       
   146 	};
       
   147 
       
   148 
       
   149 /**
       
   150  * Method for Externalization. Writes the SmfEvent object to 
       
   151  * the stream and returns a reference to the stream.
       
   152  * @param aDataStream Stream to be written
       
   153  * @param aEvent The SmfEvent object to be externalized
       
   154  * @return reference to the written stream
       
   155  */
       
   156 QDataStream &operator<<( QDataStream &aDataStream, 
       
   157 		const SmfEvent &aEvent );
       
   158 
       
   159 /**
       
   160  * Method for Internalization. Reads a SmfEvent object from 
       
   161  * the stream and returns a reference to the stream.
       
   162  * @param aDataStream Stream to be read
       
   163  * @param aEvent The SmfEvent object to be internalized
       
   164  * @return reference to the stream
       
   165  */
       
   166 QDataStream &operator>>( QDataStream &aDataStream, 
       
   167 		SmfEvent &aEvent);
       
   168 
       
   169 #endif /* SMFEVENT_H_ */