Not crap after all...
[amarok.git] / src / podcastsettings.h
blob672af5258ef83c2727f73ffa75f22146329eb210
1 // (c) 2005 Seb Ruiz <me@sebruiz.net>
2 // See COPYING file for licensing information.
4 #ifndef AMAROK_PODCASTSETTINGS_H
5 #define AMAROK_PODCASTSETTINGS_H
7 #include "kdialog.h" //baseclass
9 #include <kurl.h>
11 #include <q3ptrlist.h>
13 class PodcastChannel;
14 class PodcastEpisode;
15 class PodcastSettingsDialogBase;
16 class QDomNode;
17 class QDomElement;
19 enum MediaFetch{ STREAM=0, AUTOMATIC=1 };
21 class PodcastSettings
23 public:
24 PodcastSettings( const QDomNode &channelSettings, const QString &title );
25 PodcastSettings( const PodcastSettings *parentSettings, const QString &title );
26 PodcastSettings( const QString &title ); // standard settings
27 PodcastSettings( const QString &title, const QString &save, const bool autoScan,
28 const int fetchType, const bool autotransfer, const bool purge, const int purgecount );
30 const QString &saveLocation() { return m_saveLocation; }
31 const QString &title() { return m_title; }
32 bool autoscan() { return m_autoScan; }
33 int fetchType() { return m_fetch; }
34 bool autoTransfer() { return m_addToMediaDevice; }
35 bool hasPurge() { return m_purge; }
36 int purgeCount() { return m_purgeCount; }
38 QString m_title; //the title of the podcast or category these settings belong to
39 QString m_saveLocation;
40 bool m_autoScan;
41 int m_fetch;
42 bool m_addToMediaDevice;
43 bool m_purge;
44 int m_purgeCount;
48 class PodcastSettingsDialog : public KDialog
50 Q_OBJECT
52 public:
53 explicit PodcastSettingsDialog( PodcastSettings *list, QWidget* parent=0 );
54 PodcastSettingsDialog( const Q3PtrList<PodcastSettings> &list, const QString &caption, QWidget* parent=0 );
56 bool configure();
57 PodcastSettings *getSettings() { return m_settings; }
59 protected:
60 bool hasChanged();
62 protected slots:
63 void checkModified();
64 void slotOk();
65 void slotUser1();
67 private:
68 void init();
69 void setSettings( PodcastSettings *settings );
70 QString requesterSaveLocation();
72 PodcastSettingsDialogBase *m_ps;
73 Q3PtrList<PodcastSettings> m_settingsList;
74 PodcastSettings *m_settings;
77 #endif /*AMAROK_PODCASTSETTINGS_H*/