LeechCraft  0.6.70-13605-g8cd066ad6a
Modular cross-platform feature rich live environment.
ieventsprovider.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Boost Software License - Version 1.0 - August 17th, 2003
6  *
7  * Permission is hereby granted, free of charge, to any person or organization
8  * obtaining a copy of the software and accompanying documentation covered by
9  * this license (the "Software") to use, reproduce, display, distribute,
10  * execute, and transmit the Software, and to prepare derivative works of the
11  * Software, and to permit third-parties to whom the Software is furnished to
12  * do so, all subject to the following:
13  *
14  * The copyright notices in the Software and this entire statement, including
15  * the above license grant, this restriction and the following disclaimer,
16  * must be included in all copies of the Software, in whole or in part, and
17  * all derivative works of the Software, unless such copies or derivative
18  * works are solely in the form of machine-executable object code generated by
19  * a source language processor.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  **********************************************************************/
29 
30 #pragma once
31 
32 #include <QDateTime>
33 #include <QUrl>
34 #include <QStringList>
35 #include <QtPlugin>
36 #include <util/sll/eitherfwd.h>
37 
38 template<typename>
39 class QFuture;
40 
41 namespace Media
42 {
47  enum class EventAttendType
48  {
51  None,
52 
55  Maybe,
56 
59  Surely
60  };
61 
66  struct EventInfo
67  {
70  qint64 ID_;
71 
74  QString Name_;
75 
78  QString Description_;
79 
82  QDateTime Date_;
83 
86  QUrl URL_;
87 
90  QUrl SmallImage_;
91 
94  QUrl BigImage_;
95 
100  QStringList Artists_;
101 
106  QString Headliner_;
107 
110  QStringList Tags_;
111 
114  int Attendees_;
115 
119  QString PlaceName_;
120 
126  double Latitude_;
127 
133  double Longitude_;
134 
137  QString City_;
138 
141  QString Address_;
142 
145  bool CanBeAttended_;
146 
150  };
151 
155 
161  class Q_DECL_EXPORT IEventsProvider
162  {
163  public:
164  virtual ~IEventsProvider () {}
165 
171  using EventsQueryResult_t = LC::Util::Either<QString, EventInfos_t>;
172 
180  virtual QString GetServiceName () const = 0;
181 
186  virtual QFuture<EventsQueryResult_t> UpdateRecommendedEvents () = 0;
187 
196  virtual void AttendEvent (qint64 id, EventAttendType status) = 0;
197  };
198 }
199 
200 Q_DECLARE_INTERFACE (Media::IEventsProvider, "org.LeechCraft.Media.IEventsProvider/1.0")
Media::None
The user won't attend this event.
Media::EventInfos_t
QList< EventInfo > EventInfos_t
A list of events.
Definition: ieventsprovider.h:153
Media::EventInfo::Address_
QString Address_
The address of the place this event will happen in.
Definition: ieventsprovider.h:140
Media::EventInfo::Longitude_
double Longitude_
Longitude of the place.
Definition: ieventsprovider.h:132
QList
Definition: ianrulesstorage.h:34
Media::EventAttendType::Maybe
The user is interested and maybe will attend the event.
Media::EventInfo::URL_
QUrl URL_
The URL of a page describing the event in more detail.
Definition: ieventsprovider.h:85
LC::Util::Either
Definition: either.h:97
Media::EventInfo::BigImage_
QUrl BigImage_
A big, preferably poster-size image of this event.
Definition: ieventsprovider.h:93
Media::EventAttendType::Surely
The user surely will attend the event.
Media::EventInfo::ID_
qint64 ID_
The internal ID of the event.
Definition: ieventsprovider.h:69
Media::IEventsProvider
Interface for plugins that can provide events.
Definition: ieventsprovider.h:160
Media::EventInfo::AttendType_
EventAttendType AttendType_
Current attendance status by the user.
Definition: ieventsprovider.h:148
Media
Definition: audiostructs.h:36
Media::EventInfo::Tags_
QStringList Tags_
The associated tags like musical genre of bands.
Definition: ieventsprovider.h:109
Media::EventInfo::SmallImage_
QUrl SmallImage_
A thumb image associated with this event.
Definition: ieventsprovider.h:89
Media::EventInfo::PlaceName_
QString PlaceName_
The name of the club or other place this event will be in.
Definition: ieventsprovider.h:118
Media::EventAttendType
EventAttendType
Enum describing if and how an event is attended by user.
Definition: ieventsprovider.h:46
Media::EventInfo::Artists_
QStringList Artists_
The list of all artists present on this event.
Definition: ieventsprovider.h:99
Media::EventInfo::Name_
QString Name_
The name of the event.
Definition: ieventsprovider.h:73
Media::EventInfo::Headliner_
QString Headliner_
The name of the headliner of this event.
Definition: ieventsprovider.h:105
Media::EventInfo::City_
QString City_
The city this event will happen in.
Definition: ieventsprovider.h:136
Media::EventInfo::Latitude_
double Latitude_
Latitude of the place.
Definition: ieventsprovider.h:125
Media::EventInfo::CanBeAttended_
bool CanBeAttended_
Whether this event can be attended.
Definition: ieventsprovider.h:144
QFuture
Definition: idownload.h:39
Media::EventInfo::Description_
QString Description_
The description of the event.
Definition: ieventsprovider.h:77
Media::EventInfo::Attendees_
int Attendees_
The current number of attendees or -1 if not known.
Definition: ieventsprovider.h:113
eitherfwd.h
Media::EventInfo::Date_
QDateTime Date_
The date the event will happen.
Definition: ieventsprovider.h:81