playlistitem.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 ITUNESDBPLAYLISTITEM_H
00025 #define ITUNESDBPLAYLISTITEM_H
00026 
00027 #include "listitem.h"
00028 
00029 #define PLAYLISTITEM_INVALID 0xEEEEEEEE
00030 
00031 namespace itunesdb {
00032 
00036 class PlaylistItem : public ListItem
00037 {
00038     friend class ItunesDBParser;
00039     friend class Playlist;
00040 
00041 public:
00042 
00043     virtual ~PlaylistItem();
00044 
00049     Q_UINT32 getID() const;
00050 
00054     Q_UINT32 getPosition() const;
00055 
00059     void setPosition( Q_UINT32 pos );
00060 
00064     bool isPositionSet() const { return m_pos != PLAYLISTITEM_INVALID; }
00065 
00066 protected:
00067 
00068     PlaylistItem();
00069     PlaylistItem( Q_UINT32 ipod_id);
00070 
00074     virtual void doneAddingData();
00075 
00079     virtual void readMHOD( QDataStream& stream, Q_UINT32 type, Q_UINT32 blocklen );
00080 
00081     Q_UINT32 m_id;
00082     Q_UINT32 m_pos;
00083 };
00084 
00089 class PlaylistItemComparator {
00090 public:
00091     virtual ~PlaylistItemComparator() {}
00092     virtual int compare( const PlaylistItem& item1, const PlaylistItem& item2 ) = 0;
00093 };
00094 
00095 }
00096 
00097 #endif

Generated on Tue Dec 12 16:39:27 2006 for libqtpod.kdevelop by  doxygen 1.5.1