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