Diffstat (limited to 'core/pim/datebook/holiday/national/nationalcfg.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/holiday/national/nationalcfg.h | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/core/pim/datebook/holiday/national/nationalcfg.h b/core/pim/datebook/holiday/national/nationalcfg.h index 8f15097..872df65 100644 --- a/core/pim/datebook/holiday/national/nationalcfg.h +++ b/core/pim/datebook/holiday/national/nationalcfg.h | |||
@@ -1,39 +1,75 @@ | |||
1 | #ifndef _NATIONAL_CFG_H | 1 | #ifndef _NATIONAL_CFG_H |
2 | #define _NATIONAL_CFG_H | 2 | #define _NATIONAL_CFG_H |
3 | 3 | ||
4 | #include <qxml.h> | 4 | #include <qxml.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qvaluelist.h> | ||
6 | #include <qmap.h> | 7 | #include <qmap.h> |
7 | #include <qdatetime.h> | 8 | #include <qdatetime.h> |
8 | 9 | ||
9 | typedef QMap<QDate,QStringList> tholidaylist; | 10 | typedef QMap<QDate,QStringList> tholidaylist; |
10 | 11 | ||
12 | class NHentry | ||
13 | { | ||
14 | public: | ||
15 | enum entry_type{fix,floating}; | ||
16 | NHentry(); | ||
17 | virtual ~NHentry(); | ||
18 | |||
19 | void setName(const QString&); | ||
20 | const QString&name()const; | ||
21 | void setType(entry_type); | ||
22 | entry_type type()const; | ||
23 | void setDate(const QDate&); | ||
24 | const QDate&date()const; | ||
25 | void setWeekday(const QString&); | ||
26 | const QString&weekday()const; | ||
27 | void setDayofmonth(const QString&); | ||
28 | const QString&dayofmonth()const; | ||
29 | void setDaydep(const QString&); | ||
30 | const QString&daydep()const; | ||
31 | void setMonth(const QString&); | ||
32 | const QString&month()const; | ||
33 | void setOffet(int); | ||
34 | const int offset()const; | ||
35 | |||
36 | protected: | ||
37 | entry_type m_Type; | ||
38 | QString m_Name,m_Weekday,m_Dayofmonth,m_Depth,m_Month; | ||
39 | QDate m_Date; | ||
40 | int m_Offset; | ||
41 | }; | ||
42 | |||
43 | typedef QValueList<NHentry> tentrylist; | ||
44 | |||
11 | class NHcfg:public QXmlDefaultHandler | 45 | class NHcfg:public QXmlDefaultHandler |
12 | { | 46 | { |
13 | public: | 47 | public: |
14 | NHcfg(); | 48 | NHcfg(); |
15 | virtual ~NHcfg(); | 49 | virtual ~NHcfg(); |
16 | 50 | ||
17 | bool load(const QString&); | 51 | bool load(const QString&); |
18 | const tholidaylist&days()const; | 52 | const tentrylist&fixDates()const; |
53 | const tentrylist&floatingDates()const; | ||
19 | 54 | ||
20 | virtual bool warning(const QXmlParseException& e); | 55 | virtual bool warning(const QXmlParseException& e); |
21 | virtual bool error(const QXmlParseException& e); | 56 | virtual bool error(const QXmlParseException& e); |
22 | virtual bool fatalError(const QXmlParseException& e); | 57 | virtual bool fatalError(const QXmlParseException& e); |
23 | virtual bool startElement(const QString&, const QString&,const QString& name, const QXmlAttributes& attr); | 58 | virtual bool startElement(const QString&, const QString&,const QString& name, const QXmlAttributes& attr); |
24 | virtual bool endElement(const QString&, const QString&,const QString& name); | 59 | virtual bool endElement(const QString&, const QString&,const QString& name); |
25 | virtual const QString&errorString()const; | 60 | virtual const QString&errorString()const; |
26 | 61 | ||
27 | protected: | 62 | protected: |
28 | tholidaylist _content; | 63 | QString err,_contentname; |
29 | QString _contentname; | ||
30 | QString err; | ||
31 | QString _path; | 64 | QString _path; |
32 | 65 | ||
66 | NHentry m_currentEntry; | ||
67 | |||
33 | bool setName(const QXmlAttributes&); | 68 | bool setName(const QXmlAttributes&); |
34 | bool parsevalue(const QString&,const QXmlAttributes&); | 69 | bool parsevalue(const QString&,const QXmlAttributes&); |
35 | int stage; | 70 | bool parseCalc(const QString&,const QXmlAttributes&); |
36 | // int pos; | 71 | int stage,counter,level; |
72 | tentrylist currentFloatList,currentFixList; | ||
37 | }; | 73 | }; |
38 | 74 | ||
39 | #endif | 75 | #endif |