itunesdbdatasource.h

00001  /*****************************************************************************
00002  *   Copyright (C) 2004 by Michael Schulze                                    *
00003  *   mike.s@genion.de                                                         *
00004  *                                                                            *
00005  *  The code contained in this file is free software; you can redistribute    *
00006  *  it and/or modify it under the terms of the GNU Lesser General Public      *
00007  *  License as published by the Free Software Foundation; either version      *
00008  *  2.1 of the License, or (at your option) any later version.                *
00009  *                                                                            *
00010  *  This file is distributed in the hope that it will be useful,              *
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00013  *  Lesser General Public License for more details.                           *
00014  *                                                                            *
00015  *  You should have received a copy of the GNU Lesser General Public          *
00016  *  License along with this code; if not, write to the Free Software          *
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
00018  *                                                                            *
00019  *  iTunes and iPod are trademarks of Apple                                   *
00020  *                                                                            *
00021  *  This product is not supported/written/published by Apple!                 *
00022  *****************************************************************************/
00023 
00024 #ifndef ITUNESDBITUNESDBDATASOURCE_H
00025 #define ITUNESDBITUNESDBDATASOURCE_H
00026 
00027 #include "track.h"
00028 #include "playlist.h"
00029 #include "playlistitem.h"
00030 
00031 namespace itunesdb {
00032 
00033 /**
00034  * ItunesDBDataSource is the interface that delivers data to an iTunesDBWriter
00035  * @author Michael Schulze
00036 */
00037 class ItunesDBDataSource {
00038 public:
00039 
00040     virtual ~ItunesDBDataSource() {}
00041 
00042     /**
00043      * called when the ItunesDBWriter starts to write
00044      */
00045     virtual void writeInit() = 0;
00046 
00047     /**
00048      * called when the ItunesDBWriter is done writing the database
00049      */
00050     virtual void writeFinished() = 0;
00051 
00052     /**
00053      * returns the number of playlists that need to be written
00054      */
00055     virtual Q_UINT32 getNumPlaylists() = 0;
00056 
00057     /**
00058      * returns the number of tracks that need to be written
00059      */
00060     virtual Q_UINT32 getNumTracks() = 0;
00061 
00062     /**
00063      * Returns a list with all the tracks
00064      */
00065     virtual TrackPtrList& getTrackList() = 0;
00066 
00067     /**
00068      * returns the first playlist and sets the playlist position for nextPlaylist() to the first
00069      * playlist
00070      * 
00071      */
00072     virtual Playlist * firstPlaylist() = 0;
00073 
00074     /**
00075      * returns the next playlist (see firstPlaylist())
00076      */
00077     virtual Playlist * nextPlaylist() = 0;
00078 
00079     /**
00080      * gets called if an error occured during the write process.
00081      * The write process ends after a call to this method.
00082      */
00083     virtual void handleError( const QString& message) = 0;
00084 
00085     /**
00086      * Returns the title of the master Playlist (thus the title of the iPod)
00087      */
00088     virtual const QString& getTitle() = 0;
00089 };
00090 
00091 }
00092 
00093 #endif

Generated on Wed Dec 19 00:15:19 2007 for libqtpod by  doxygen 1.5.0