summaryrefslogtreecommitdiffstats
path: root/tderadio3/src/include/stationlistxmlhandler.h
blob: 177ec211978522bede000d7639d3372d3e69eff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/***************************************************************************
                          radiocfgxmlhandler.h  -  description
                             -------------------
    begin                : Son Jan 12 2003
    copyright            : (C) 2003 by Martin Witte
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef KRADIO_RADIOCFGXMLHANDLER_H
#define KRADIO_RADIOCFGXMLHANDLER_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <tqxml.h>
#include <tqobject.h>

#include "radiostation.h"
#include "stationlist.h"

class StationListXmlHandler : public TQXmlDefaultHandler
{
protected:
    TQStringList           m_status;
    const IErrorLogClient&m_logger;

    RawStationList        m_stations;
    StationListMetaData   m_metaData;

    RadioStation         *m_newStation;

    bool                  m_compatMode;

public :
    StationListXmlHandler (const IErrorLogClient &logger);
    virtual ~StationListXmlHandler ();
    bool startDocument ();
    bool startElement (const TQString &ns, const TQString &localname,
                       const TQString& qname, const TQXmlAttributes &);
    bool endElement   (const TQString &ns, const TQString &localname,
                       const TQString &qname);
    bool characters   (const TQString &ch);

    const RawStationList &getStations() const { return m_stations; }
    const StationListMetaData &getMetaData() const { return m_metaData; }


    bool  wasCompatMode() const { return m_compatMode; }

protected:

    void clearNewStation();
};



extern const char *TDERadioConfigElement;
extern const char *StationListElement;

extern const char *StationListInfo;
extern const char *StationListInfoMaintainer;
extern const char *StationListInfoCountry;
extern const char *StationListInfoCity;
extern const char *StationListInfoMedia;
extern const char *StationListInfoComments;
extern const char *StationListInfoChanged;
extern const char *StationListInfoCreator;

extern const char *StationQuickSelectElement;
extern const char *StationDockingMenuElement;
extern const char *StationListFormat;

#define STATION_LIST_FORMAT   "kradio-1.0"


#endif