Added a new provider type to support the retrieval of movie schedules
authorbaturix <gervarela@picandocodigo.com>
Sun, 15 Nov 2009 01:23:43 +0000 (01:23 +0000)
committerbaturix <gervarela@picandocodigo.com>
Sun, 15 Nov 2009 01:23:43 +0000 (01:23 +0000)
git-svn-id: file:///svnroot/maevies/trunk@13 a96798e0-47ce-444a-94a4-1d14e63744fc

src/maevies_movie.h
src/maevies_movieschedule.c [new file with mode: 0644]
src/maevies_movieschedule.h [new file with mode: 0644]
src/maevies_theater.c [new file with mode: 0644]
src/maevies_theater.h [new file with mode: 0644]
src/schedule_provider.h [new file with mode: 0644]

index aeeb6d8..ba25c7f 100644 (file)
@@ -20,6 +20,7 @@
 #define MOVIE_H_
 
 #include <hildon/hildon.h>
+#include "maevies_movieschedule.h"
 
 G_BEGIN_DECLS
 
@@ -33,6 +34,7 @@ struct _MaeviesMovie {
        GSList *cast;
        gint ranking;
        gint year;
+       GSList* movieScheduleList;
 
 };
 
diff --git a/src/maevies_movieschedule.c b/src/maevies_movieschedule.c
new file mode 100644 (file)
index 0000000..baf2c9a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * maevies_movieschedule.c
+ *
+ * This file is part of maevies
+ * Copyright (C) 2009 Gervasio Varela <gervarela@picandocodigo.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include "maevies_movieschedule.h"
+
+
+MaeviesMovieSchedule *maevies_movieschedule_new(MaeviesMovieSchedule* theater) {
+
+       MaeviesMovieSchedule *ms = g_new0(MaeviesTheater,1);
+
+       ms->theater = theater;
+
+       return ms;
+}
+
+
+MaeviesMovieSchedule *maevies_movieschedule_new(MaeviesMovieSchedule* theater, GSList* timeList) {
+
+       MaeviesMovieSchedule *ms = maevies_movieschedule_new(theater);
+
+       ms->timeList = timeList;
+
+       return ms;
+}
+
diff --git a/src/maevies_movieschedule.h b/src/maevies_movieschedule.h
new file mode 100644 (file)
index 0000000..dfb0eb8
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * maevies_movieschedule.h
+ *
+ * This file is part of maevies
+ * Copyright (C) 2009 Gervasio Varela <gervarela@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef MOVIESCHEDULE_H_
+#define MOVIESCHEDULE_H_
+
+#include <hildon/hildon.h>
+#include <glib.h>
+#include "maevies_theater.h"
+
+G_BEGIN_DECLS
+
+struct _MaeviesMovieSchedule
+{
+       MaeviesTheater* theater;
+       GSList* timeList;
+};
+typedef struct _MaeviesMovieSchedule MaeviesMovieSchedule;
+
+
+MaeviesMovieSchedule* maevies_movieschedule_new(MaeviesTheater* theater);
+
+MaeviesMovieSchedule* maevies_movieschedule_new(MaeviesTheater* theater, GSList* tiemList);
+
+G_END_DECLS
+
+#endif /* MOVIESCHEDULE_H_ */
diff --git a/src/maevies_theater.c b/src/maevies_theater.c
new file mode 100644 (file)
index 0000000..cf12d92
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * maevies_theater.c
+ *
+ * This file is part of maevies
+ * Copyright (C) 2009 Gervasio Varela <gervarela@picandocodigo.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include "maevies_theater.h"
+
+MaeviesTheater* maevies_theater_new(gchar* name, gchar* address) {
+
+       MaeviesTheater* theater = g_new0(MaeviesTheater,1);
+
+       theater->name = name;
+       theater->address = address;
+
+       return theater;
+}
+
diff --git a/src/maevies_theater.h b/src/maevies_theater.h
new file mode 100644 (file)
index 0000000..9cf5d86
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * maevies_theater.h
+ *
+ * This file is part of maevies
+ * Copyright (C) 2009 Gervasio Varela <gervarela@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THEATER_H_
+#define THEATER_H_
+
+#include <hildon/hildon.h>
+
+G_BEGIN_DECLS
+
+typedef struct _MaeviesTheater MaeviesTheater;
+
+struct _MaeviesTheater 
+{
+       
+       gchar *name;
+       gchar *address;
+
+};
+
+MaeviesTheater* maevies_theater_new(gchar* name, gchar* address);
+
+G_END_DECLS
+
+#endif /* THEATER_H_ */
diff --git a/src/schedule_provider.h b/src/schedule_provider.h
new file mode 100644 (file)
index 0000000..609d66c
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * schedule_provider.h
+ *
+ * This file is part of maevies
+ * Copyright (C) 2009 Gervasio Varela <gervarela@picandocodigo.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SCHEDULE_PROVIDER_H_
+#define SCHEDULE_PROVIDER_H_
+
+#include <glib.h>
+#include "maevies_theater.h"
+#include "maevies_movieschedule.h"
+
+
+/** Retrieves the schedule of a given movie near a given geographical
+ * area (city, state, GPS coordiantes, etc.).
+ * @param movie The movie whose schedule is required
+ * @param where A string reprensenting a city, a state, GPS coordiantes 
+ *                             to search for theaters near it
+ * @return A list of MaeviesMovieSchedule objects
+ **/
+GSList* get_movie_schedule_near_city(MaeviesMovie* movie, gchar* where);
+
+
+/** Retrieves the movies available to watch near a given a geographical
+ * area (city, state, GPS coordinates, etc.).
+ * @param where A string reprensenting a city, a state, GPS coordiantes 
+ *                             to search for theaters near it
+ * @return A list of MaeviesMovie objects
+ **/
+GSList* get_shedule_near_city(gchar* where);
+
+
+
+#endif /* SCHEDULE_PROVIDER_H_ */