Skip to content
Browse files

Refs #60 Created doxyfile and started doxygen docu

  • Loading branch information...
1 parent 1435bda commit 7487ef2409288ff992b98d1ca4d89a70d72c34a9 Daniel Kabel committed Sep 2, 2012
Showing with 2,302 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +448 −0 data/Movie.cpp
  3. +27 −0 data/Movie.h
  4. +1,826 −0 doc/Doxyfile
View
1 .gitignore
@@ -1 +1,2 @@
*.pro.user
+doc/html
View
448 data/Movie.cpp
@@ -5,6 +5,11 @@
#include <QDir>
#include <QFileInfo>
+/**
+ * @brief Constructs a new movie object
+ * @param files List of files for this movie
+ * @param parent
+ */
Movie::Movie(QStringList files, QObject *parent) :
QObject(parent)
{
@@ -37,6 +42,9 @@ Movie::~Movie()
{
}
+/**
+ * @brief Clears all infos in the movie
+ */
void Movie::clear()
{
QList<int> infos;
@@ -57,6 +65,10 @@ void Movie::clear()
clear(infos);
}
+/**
+ * @brief Clears contents of the movie based on a list
+ * @param infos List of infos which should be cleared
+ */
void Movie::clear(QList<int> infos)
{
if (infos.contains(MovieScraperInfos::Actors))
@@ -89,6 +101,11 @@ void Movie::clear(QList<int> infos)
m_certification = "";
}
+/**
+ * @brief Saves the movies infos with the given MediaCenterInterface
+ * @param mediaCenterInterface MediaCenterInterface to use for saving
+ * @return Saving was successful or not
+ */
bool Movie::saveData(MediaCenterInterface *mediaCenterInterface)
{
bool saved = mediaCenterInterface->saveMovie(this);
@@ -98,6 +115,12 @@ bool Movie::saveData(MediaCenterInterface *mediaCenterInterface)
return saved;
}
+/**
+ * @brief Loads the movies infos with the given MediaCenterInterface
+ * @param mediaCenterInterface MediaCenterInterface to use for loading
+ * @param force Force the loading. If set to false and infos were already loeaded this function just returns
+ * @return Loading was successful or not
+ */
bool Movie::loadData(MediaCenterInterface *mediaCenterInterface, bool force)
{
if ((m_infoLoaded || hasChanged()) && !force)
@@ -135,16 +158,31 @@ bool Movie::loadData(MediaCenterInterface *mediaCenterInterface, bool force)
return infoLoaded;
}
+/**
+ * @brief Loads the movies info from a scraper
+ * @param id Id of the movie within the given ScraperInterface
+ * @param scraperInterface ScraperInterface to use for loading
+ * @param infos List of infos to load
+ */
void Movie::loadData(QString id, ScraperInterface *scraperInterface, QList<int> infos)
{
scraperInterface->loadData(id, this, infos);
}
+/**
+ * @brief Called when a ScraperInterface has finished loading
+ * Emits the loaded signal
+ */
void Movie::scraperLoadDone()
{
emit loaded(this);
}
+/**
+ * @brief Loads the movies images using the given MediaCenterInterface
+ * @param mediaCenterInterface MediaCenterInterface to use for loading images
+ * @param force When set to true, force loading of images, regardless if they were already loaded
+ */
void Movie::loadImages(MediaCenterInterface *mediaCenterInterface, bool force)
{
if (!m_imagesLoaded || force)
@@ -154,56 +192,121 @@ void Movie::loadImages(MediaCenterInterface *mediaCenterInterface, bool force)
/*** GETTER ***/
+/**
+ * @property Movie::name
+ * @brief Holds the movies name
+ * @return The movies name
+ * @see Movie::setName
+ */
QString Movie::name() const
{
return m_name;
}
+/**
+ * @property Movie::sortTitle
+ * @brief Holds the sort title
+ * @return Sort title of the movie
+ * @see Movie::setSortTitle
+ */
QString Movie::sortTitle() const
{
return m_sortTitle;
}
+/**
+ * @property Movie::originalName
+ * @brief Holds the original name
+ * @return Original name of the movie
+ * @see Movie::setOriginalName
+ */
QString Movie::originalName() const
{
return m_originalName;
}
+/**
+ * @property Movie::overview
+ * @brief Holds the movies plot
+ * @return Plot of the movie
+ * @see Movie::setOverview
+ */
QString Movie::overview() const
{
return m_overview;
}
+/**
+ * @brief Holds the movies rating
+ * @return Rating of the movie
+ * @see Movie::setRating
+ */
qreal Movie::rating() const
{
return m_rating;
}
+/**
+ * @property Movie::released
+ * @brief Holds the movies release date
+ * @return Release date of the movie
+ * @see Movie::setReleased
+ */
QDate Movie::released() const
{
return m_released;
}
+/**
+ * @property Movie::tagline
+ * @brief Holds the movies tagline
+ * @return Tagline of the movie
+ * @see Movie::setTagline
+ */
QString Movie::tagline() const
{
return m_tagline;
}
+/**
+ * @brief Holds the movies runtime
+ * @return Runtime of the movie
+ * @see Movie::setRuntime
+ */
int Movie::runtime() const
{
return m_runtime;
}
+/**
+ * @property Movie::certification
+ * @brief Holds the movies certification
+ * @return Certification of the movie
+ * @see Movie::setCertification
+ */
QString Movie::certification() const
{
return m_certification;
}
+/**
+ * @property Movie::genres
+ * @brief Holds a list of the movies genres
+ * @return List of genres of the movie
+ * @see Movie::setGenres
+ * @see Movie::genresPointer
+ * @see Movie::addGenre
+ * @see Movie::removeGenre
+ */
QStringList Movie::genres() const
{
return m_genres;
}
+/**
+ * @brief Returns a list of pointers to QStrings
+ * @return List of pointers to the movies genres
+ */
QList<QString*> Movie::genresPointer()
{
QList<QString*> genres;
@@ -212,11 +315,24 @@ QList<QString*> Movie::genresPointer()
return genres;
}
+/**
+ * @property Movie::countries
+ * @brief Holds the movies countries
+ * @return List of production countries of the movie
+ * @see Movie::setCountries
+ * @see Movie::countriesPointer
+ * @see Movie::addCountry
+ * @see Movie::removeCountry
+ */
QStringList Movie::countries() const
{
return m_countries;
}
+/**
+ * @brief Returns a list of pointers to QStrings
+ * @return List of pointers to the movies production countries
+ */
QList<QString*> Movie::countriesPointer()
{
QList<QString*> countries;
@@ -225,11 +341,24 @@ QList<QString*> Movie::countriesPointer()
return countries;
}
+/**
+ * @property Movie::studios
+ * @brief Holds the movies studios
+ * @return List of studios of the movies
+ * @see Movie::setStudios
+ * @see Movie::studiosPointer
+ * @see Movie::addStudio
+ * @see Movie::removeStudio
+ */
QStringList Movie::studios() const
{
return m_studios;
}
+/**
+ * @brief Returns a list of pointers of QStrings
+ * @return List of pointers to the movies studios
+ */
QList<QString*> Movie::studiosPointer()
{
QList<QString*> studios;
@@ -238,16 +367,35 @@ QList<QString*> Movie::studiosPointer()
return studios;
}
+/**
+ * @property Movie::trailer
+ * @brief Holds the movies trailer
+ * @return Trailer of the movie
+ * @see Movie::setTrailer
+ */
QUrl Movie::trailer() const
{
return m_trailer;
}
+/**
+ * @property Movie::actors
+ * @brief Holds the movies actors
+ * @return List of actors of the movie
+ * @see Movie::setActors
+ * @see Movie::actorsPointer
+ * @see Movie::addActor
+ * @see Movie::removeActor
+ */
QList<Actor> Movie::actors() const
{
return m_actors;
}
+/**
+ * @brief Returns a list of pointers of Actor
+ * @return List of pointers to movies actors
+ */
QList<Actor*> Movie::actorsPointer()
{
QList<Actor*> actors;
@@ -256,222 +404,425 @@ QList<Actor*> Movie::actorsPointer()
return actors;
}
+/**
+ * @brief Holds the files of the movie
+ * @return List of files
+ */
QStringList Movie::files() const
{
return m_files;
}
+/**
+ * @property Movie::playcount
+ * @brief Holds the playcount
+ * @return Playcount of the movie
+ * @see Movie::setPlayCount
+ */
int Movie::playcount() const
{
return m_playcount;
}
+/**
+ * @property Movie::lastPlayed
+ * @brief Holds the date when the movie was last played
+ * If the movie was never played an invalid date will be returned
+ * @return Date of last playtime
+ * @see Movie::setLastPlayed
+ */
QDateTime Movie::lastPlayed() const
{
return m_lastPlayed;
}
+/**
+ * @property Movie::id
+ * @brief Holds the movies id
+ * @return Id of the movie
+ * @see Movie::setId
+ */
QString Movie::id() const
{
return m_id;
}
+/**
+ * @property Movie::set
+ * @brief Holds the set of the movie
+ * @return Set of the movie
+ * @see Movie::setSet
+ */
QString Movie::set() const
{
return m_set;
}
+/**
+ * @property Movie::posters
+ * @brief Holds a list of posters of the movie
+ * @return List of posters
+ * @see Movie::setPosters
+ * @see Movie::setPoster
+ * @see Movie::addPoster
+ */
QList<Poster> Movie::posters() const
{
return m_posters;
}
+/**
+ * @property Movie::backdrops
+ * @brief Holds a list of backdrops of the movie
+ * @return List of backdrops
+ * @see Movie::setBackdrops
+ * @see Movie::setBackdrop
+ * @see Movie::addBackdrop
+ */
QList<Poster> Movie::backdrops() const
{
return m_backdrops;
}
+/**
+ * @brief Holds the current movie poster
+ * @return Current movie poster
+ */
QImage *Movie::posterImage()
{
return &m_posterImage;
}
+/**
+ * @brief Holds the current movie backdrop
+ * @return Current movie backdrop
+ */
QImage *Movie::backdropImage()
{
return &m_backdropImage;
}
+/**
+ * @brief Returns the parent folder of the movie
+ * @return Parent folder of the movie
+ */
QString Movie::folderName() const
{
return m_folderName;
}
+/**
+ * @brief Holds wether movie infos were loaded from a MediaCenterInterface or ScraperInterface
+ * @return Infos were loaded
+ */
bool Movie::infoLoaded() const
{
return m_infoLoaded;
}
+/**
+ * @brief Holds a property indicating if the poster image was changed
+ * @return Movies poster image was changed
+ */
bool Movie::posterImageChanged() const
{
return m_posterImageChanged;
}
+/**
+ * @brief Holds a property indicating if the backdrop image was changed
+ * @return Movies backdrop image was changed
+ */
bool Movie::backdropImageChanged() const
{
return m_backdropImageChanged;
}
+/**
+ * @property Movie::watched
+ * @brief Holds the movies watched status
+ * @return Watched status of the movie
+ * @see Movie::hasWatched
+ */
bool Movie::watched() const
{
return m_watched;
}
+/**
+ * @property Movie::hasChanged
+ * @brief Holds a property if the movies infos were changed by a setter or a ScraperInterface
+ * @return True if some of the movies infos were changed
+ * @see Movie::setChanged
+ */
bool Movie::hasChanged() const
{
return m_hasChanged;
}
+
+/**
+ * @brief Holds a unique MediaElch movie id
+ * @return MediaElchs id of the movie
+ */
int Movie::movieId() const
{
return m_movieId;
}
+/**
+ * @brief Returns true if a download is in progress
+ * @return Download is in progress
+ */
bool Movie::downloadsInProgress() const
{
return m_downloadsInProgress;
}
+/**
+ * @brief Returns how many downloads are left for this movie
+ * @return Number of downloads left
+ */
int Movie::downloadsSize() const
{
return m_downloadsSize;
}
+/**
+ * @brief Holds if the movies files are stored in a separate folder
+ * @return Movies files are stored in a separate folder
+ */
bool Movie::inSeparateFolder() const
{
return m_inSeparateFolder;
}
+/**
+ * @brief Movie::mediaCenterId
+ * @return Id in a MediaCenterInterface
+ */
int Movie::mediaCenterId() const
{
return m_mediaCenterId;
}
/*** SETTER ***/
+/**
+ * @brief Sets the movies name
+ * @param name Name of the movie
+ * @see Movie::name
+ */
void Movie::setName(QString name)
{
m_name = name;
setChanged(true);
}
+/**
+ * @brief Sets the movies sort title
+ * @param sortTitle Sort title of the movie
+ * @see Movie::sortTitle
+ */
void Movie::setSortTitle(QString sortTitle)
{
m_sortTitle = sortTitle;
setChanged(true);
}
+/**
+ * @brief Sets the movies original name
+ * @param originalName Original name of the movie
+ * @see Movie::originalName
+ */
void Movie::setOriginalName(QString originalName)
{
m_originalName = originalName;
setChanged(true);
}
+/**
+ * @brief Sets the movies plot
+ * @param overview Plot of the movie
+ * @see Movie::overview
+ */
void Movie::setOverview(QString overview)
{
m_overview = overview;
setChanged(true);
}
+/**
+ * @brief Sets the movies rating
+ * @param rating Rating of the movie
+ * @see Movie::rating
+ */
void Movie::setRating(qreal rating)
{
m_rating = rating;
setChanged(true);
}
+/**
+ * @brief Sets the movies release date
+ * @param released Release date of the movie
+ * @see Movie::released
+ */
void Movie::setReleased(QDate released)
{
m_released = released;
setChanged(true);
}
+/**
+ * @brief Sets the movies tagline
+ * @param tagline Tagline of the movie
+ * @see Movie::tagline
+ */
void Movie::setTagline(QString tagline)
{
m_tagline = tagline;
setChanged(true);
}
+/**
+ * @brief Sets the movies runtime
+ * @param runtime Runtime in minutes
+ * @see Movie::runtime
+ */
void Movie::setRuntime(int runtime)
{
m_runtime = runtime;
setChanged(true);
}
+/**
+ * @brief Sets the movies certification
+ * @param certification Certification of the movie
+ * @see Movie::certification
+ */
void Movie::setCertification(QString certification)
{
m_certification = certification;
setChanged(true);
}
+/**
+ * @brief Sets the movies genres
+ * @param genres List of genres of the movie
+ * @see Movie::genres
+ */
void Movie::setGenres(QStringList genres)
{
m_genres = genres;
setChanged(true);
}
+/**
+ * @brief Sets the movies production countries
+ * @param countries List of production countries
+ * @see Movie::countries
+ */
void Movie::setCountries(QStringList countries)
{
m_countries = countries;
setChanged(true);
}
+/**
+ * @brief Sets the movies studios
+ * @param studios List of studios
+ * @see Movie::studios
+ */
void Movie::setStudios(QStringList studios)
{
m_studios = studios;
setChanged(true);
}
+/**
+ * @brief Sets the movies trailer
+ * @param trailer URL of the movies trailer
+ * @see Movie::trailer
+ */
void Movie::setTrailer(QUrl trailer)
{
m_trailer = trailer;
setChanged(true);
}
+/**
+ * @brief Sets the movies actors
+ * @param actors List of actors
+ * @see Movie::actors
+ */
void Movie::setActors(QList<Actor> actors)
{
m_actors = actors;
setChanged(true);
}
+/**
+ * @brief Sets the movies playcount
+ * @param playcount Playcount of the movie
+ * @see Movie::playcount
+ */
void Movie::setPlayCount(int playcount)
{
m_playcount = playcount;
setChanged(true);
}
+/**
+ * @brief Sets the movies last playtime. If the movie has never played, set an invalid date.
+ * @param lastPlayed Last playtime of the movie
+ * @see Movie::lastPlayed
+ */
void Movie::setLastPlayed(QDateTime lastPlayed)
{
m_lastPlayed = lastPlayed;
setChanged(true);
}
+/**
+ * @brief Sets the id of the movie
+ * @param id Id of the movie
+ * @see Movie::id
+ */
void Movie::setId(QString id)
{
m_id = id;
setChanged(true);
}
+/**
+ * @brief Sets the movies set
+ * @param set Setname of the movie
+ * @see Movie::set
+ */
void Movie::setSet(QString set)
{
m_set = set;
setChanged(true);
}
+/**
+ * @brief Sets the movies posters
+ * @param posters List of poster
+ * @see Movie::posters
+ */
void Movie::setPosters(QList<Poster> posters)
{
m_posters = posters;
setChanged(true);
}
+/**
+ * @brief Sets a specific movie poster
+ * @param index Index of the position in the poster list
+ * @param poster Poster to set
+ * @see Movie::posters
+ */
void Movie::setPoster(int index, Poster poster)
{
if (m_posters.size() < index)
@@ -480,12 +831,23 @@ void Movie::setPoster(int index, Poster poster)
setChanged(true);
}
+/**
+ * @brief Sets the movies backdrops
+ * @param backdrops List of backdrops
+ * @see Movie::backdrops
+ */
void Movie::setBackdrops(QList<Poster> backdrops)
{
m_backdrops.append(backdrops);
setChanged(true);
}
+/**
+ * @brief Sets a specific movie backdrop
+ * @param index Index of the position in the backdrop list
+ * @param backdrop Backdrop to set
+ * @see Movie::backdrops
+ */
void Movie::setBackdrop(int index, Poster backdrop)
{
if (m_backdrops.size() < index)
@@ -494,83 +856,149 @@ void Movie::setBackdrop(int index, Poster backdrop)
setChanged(true);
}
+/**
+ * @brief Sets the movies watched status
+ * @param watched Watched status of the movie
+ * @see Movie::watched
+ */
void Movie::setWatched(bool watched)
{
m_watched = watched;
setChanged(true);
}
+/**
+ * @brief Sets if some of the movies info has changed. Emits the sigChanged signal
+ * @param changed Infos have changed
+ * @see Movie::hasChanged
+ */
void Movie::setChanged(bool changed)
{
m_hasChanged = changed;
emit sigChanged(this);
}
+/**
+ * @brief Sets if downloads are in progress
+ * @param inProgress Status of downloads
+ */
void Movie::setDownloadsInProgress(bool inProgress)
{
m_downloadsInProgress = inProgress;
}
+/**
+ * @brief Sets the number of downloads left
+ * @param downloadsLeft Number of downloads left
+ */
void Movie::setDownloadsSize(int downloadsLeft)
{
m_downloadsSize = downloadsLeft;
}
+/**
+ * @brief Sets if the movies files are stored in a separate folder
+ * @param inSepFolder Files of the movie are in one separate folder
+ */
void Movie::setInSeparateFolder(bool inSepFolder)
{
m_inSeparateFolder = inSepFolder;
}
+/**
+ * @brief Sets the media center id of the movie
+ * @param mediaCenterId Id of the movie
+ */
void Movie::setMediaCenterId(int mediaCenterId)
{
m_mediaCenterId = mediaCenterId;
}
/*** ADDER ***/
+/**
+ * @brief Adds an actor to the movie
+ * @param actor Actor to add
+ * @see Movie::actors
+ */
void Movie::addActor(Actor actor)
{
m_actors.append(actor);
setChanged(true);
}
+/**
+ * @brief Adds a country to the movie
+ * @param country Country to add
+ * @see Movie::countries
+ */
void Movie::addCountry(QString country)
{
m_countries.append(country);
setChanged(true);
}
+/**
+ * @brief Adds a genre to the movie
+ * @param genre Genre to add
+ * @see Movie::genres
+ */
void Movie::addGenre(QString genre)
{
m_genres.append(genre);
setChanged(true);
}
+/**
+ * @brief Adds a studio to the movie
+ * @param studio Studio to add
+ * @see Movie::studios
+ */
void Movie::addStudio(QString studio)
{
m_studios.append(studio);
setChanged(true);
}
+/**
+ * @brief Adds a poster to the movie
+ * @param poster Poster to add
+ * @see Movie::posters
+ */
void Movie::addPoster(Poster poster)
{
m_posters.append(poster);
setChanged(true);
}
+/**
+ * @brief Adds a backdrop to the movie
+ * @param backdrop Backdrop to add
+ * @see Movie::backdrops
+ */
void Movie::addBackdrop(Poster backdrop)
{
m_backdrops.append(backdrop);
setChanged(true);
}
+/**
+ * @brief Sets the current poster image
+ * @param poster Current poster image
+ * @see Movie::posters
+ */
void Movie::setPosterImage(QImage poster)
{
m_posterImage = QImage(poster);
m_posterImageChanged = true;
setChanged(true);
}
+/**
+ * @brief Sets the current backdrop image
+ * @param backdrop Current backdrop image
+ * @see Movie::backdrops
+ */
void Movie::setBackdropImage(QImage backdrop)
{
m_backdropImage = QImage(backdrop);
@@ -580,6 +1008,11 @@ void Movie::setBackdropImage(QImage backdrop)
/*** REMOVER ***/
+/**
+ * @brief Removes an actor from the movie
+ * @param actor Pointer to the actor to remove
+ * @see Movie::actors
+ */
void Movie::removeActor(Actor *actor)
{
for (int i=0, n=m_actors.size() ; i<n ; ++i) {
@@ -591,6 +1024,11 @@ void Movie::removeActor(Actor *actor)
setChanged(true);
}
+/**
+ * @brief Removes a production country from the movie
+ * @param country Pointer to the country to remove
+ * @see Movie::countries
+ */
void Movie::removeCountry(QString *country)
{
for (int i=0, n=m_countries.size() ; i<n ; ++i) {
@@ -602,6 +1040,11 @@ void Movie::removeCountry(QString *country)
setChanged(true);
}
+/**
+ * @brief Movie::removeGenre
+ * @param genre
+ * @see Movie::genres
+ */
void Movie::removeGenre(QString *genre)
{
for (int i=0, n=m_genres.size() ; i<n ; ++i) {
@@ -613,6 +1056,11 @@ void Movie::removeGenre(QString *genre)
setChanged(true);
}
+/**
+ * @brief Removes a studio from the movie
+ * @param studio Pointer to the studio to remove
+ * @see Movie::studios
+ */
void Movie::removeStudio(QString *studio)
{
for (int i=0, n=m_studios.size() ; i<n ; ++i) {
View
27 data/Movie.h
@@ -15,9 +15,36 @@
class MediaCenterInterface;
class ScraperInterface;
+/**
+ * @brief The Movie class
+ * This class represents a single movie
+ */
class Movie : public QObject
{
Q_OBJECT
+ Q_PROPERTY(QString name READ name WRITE setName)
+ Q_PROPERTY(QString sortTitle READ sortTitle WRITE setSortTitle)
+ Q_PROPERTY(QString originalName READ originalName WRITE setOriginalName)
+ Q_PROPERTY(QString overview READ overview WRITE setOverview)
+ Q_PROPERTY(qreal rating READ rating WRITE setRating)
+ Q_PROPERTY(QDate released READ released WRITE setReleased)
+ Q_PROPERTY(QString tagline READ tagline WRITE setTagline)
+ Q_PROPERTY(int runtime READ runtime WRITE setRuntime)
+ Q_PROPERTY(QString certification READ certification WRITE setCertification)
+ Q_PROPERTY(QStringList genres READ genres WRITE setGenres)
+ Q_PROPERTY(QStringList countries READ countries WRITE setCountries)
+ Q_PROPERTY(QStringList studios READ studios WRITE setStudios)
+ Q_PROPERTY(QUrl trailer READ trailer WRITE setTrailer)
+ Q_PROPERTY(QList<Actor> actors READ actors WRITE setActors)
+ Q_PROPERTY(int playcount READ playcount WRITE setPlayCount)
+ Q_PROPERTY(QDateTime lastPlayed READ lastPlayed WRITE setLastPlayed)
+ Q_PROPERTY(QString id READ id WRITE setId)
+ Q_PROPERTY(QString set READ set WRITE setSet)
+ Q_PROPERTY(QList<Poster> posters READ posters WRITE setPosters)
+ Q_PROPERTY(QList<Poster> backdrops READ backdrops WRITE setBackdrops)
+ Q_PROPERTY(bool watched READ watched WRITE setWatched)
+ Q_PROPERTY(bool hasChanged READ hasChanged WRITE setChanged)
+
public:
explicit Movie(QStringList files, QObject *parent = 0);
~Movie();
View
1,826 doc/Doxyfile
1,826 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 7487ef2

Please sign in to comment.
Something went wrong with that request. Please try again.