00001 /*************************************************************************** 00002 radiocfgxmlhandler.h - description 00003 ------------------- 00004 begin : Son Jan 12 2003 00005 copyright : (C) 2003 by Martin Witte 00006 email : emw-kradio@nocabal.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 #ifndef KRADIO_RADIOCFGXMLHANDLER_H 00018 #define KRADIO_RADIOCFGXMLHANDLER_H 00019 00020 #ifdef HAVE_CONFIG_H 00021 #include <config.h> 00022 #endif 00023 00024 #include <QtXml/QtXml> 00025 #include <QtCore/QObject> 00026 00027 #include "radiostation.h" 00028 #include "stationlist.h" 00029 00030 class KDE_EXPORT StationListXmlHandler : public QXmlDefaultHandler 00031 { 00032 protected: 00033 QStringList m_status; 00034 const IErrorLogClient&m_logger; 00035 00036 StationList m_stations; 00037 00038 RadioStation *m_newStation; 00039 00040 bool m_compatMode; 00041 00042 public : 00043 StationListXmlHandler (const IErrorLogClient &logger); 00044 virtual ~StationListXmlHandler (); 00045 bool startDocument (); 00046 bool startElement (const QString &ns, const QString &localname, 00047 const QString& qname, const QXmlAttributes &); 00048 bool endElement (const QString &ns, const QString &localname, 00049 const QString &qname); 00050 bool characters (const QString &ch); 00051 00052 const StationList &getStations() const { return m_stations; } 00053 00054 bool wasCompatMode() const { return m_compatMode; } 00055 00056 protected: 00057 00058 void clearNewStation(); 00059 }; 00060 00061 00062 00063 extern const char *KRadioConfigElement; 00064 extern const char *StationListElement; 00065 00066 extern const char *StationListInfo; 00067 extern const char *StationListInfoMaintainer; 00068 extern const char *StationListInfoCountry; 00069 extern const char *StationListInfoCity; 00070 extern const char *StationListInfoMedia; 00071 extern const char *StationListInfoComments; 00072 extern const char *StationListInfoChanged; 00073 extern const char *StationListInfoCreator; 00074 00075 extern const char *StationQuickSelectElement; 00076 extern const char *StationDockingMenuElement; 00077 extern const char *StationListFormat; 00078 00079 #define STATION_LIST_FORMAT "kradio-1.0" 00080 00081 00082 #endif