00001 #ifndef NOATUNPLAYLISTSAVER_H
00002 #define NOATUNPLAYLISTSAVER_H
00003
00004 #include <kurl.h>
00005 #include <qmap.h>
00006 #include <noatun/playlist.h>
00007
00008 class Structure;
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 class PlaylistSaver
00020 {
00021 friend class Structure;
00022 public:
00023 enum Options
00024 {
00025 XMLPlaylist=1,
00026 M3U=2,
00027 PLS=4
00028 };
00029
00030 PlaylistSaver();
00031 virtual ~PlaylistSaver();
00032
00033 bool save(const KURL &file, int options=0);
00034 bool load(const KURL &file, int options=0);
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 bool metalist(const KURL &url);
00047
00048
00049
00050
00051
00052 virtual void setGroup(const QString &);
00053
00054 protected:
00055
00056
00057
00058
00059
00060 virtual void readItem(const QMap<QString,QString> &properties) = 0;
00061
00062
00063
00064
00065
00066 virtual PlaylistItem writeItem() = 0;
00067
00068
00069
00070
00071
00072 virtual void changeGroup(const QString &) {}
00073
00074
00075
00076
00077
00078
00079
00080
00081 virtual void reset() {}
00082
00083 private:
00084 bool loadXML(const KURL &file, int x=0);
00085 bool saveXML(const KURL &file, int x=0);
00086
00087 bool loadM3U(const KURL &file, int x=0);
00088 bool saveM3U(const KURL &file, int x=0);
00089
00090 bool loadPLS(const KURL &file, int x=0);
00091 bool savePLS(const KURL &file, int x=0);
00092
00093 private:
00094 class Private;
00095 PlaylistSaver::Private *d;
00096
00097 };
00098
00099 #endif