author | alwin <alwin> | 2005-03-21 14:31:01 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-21 14:31:01 (UTC) |
commit | 5b2632bcae03b159d137fe9489eb2620c0f65f1a (patch) (side-by-side diff) | |
tree | 7984efeeff1bba3083494b38378aaa223a82d117 /core/pim/datebook/holiday/national/nationalcfg.h | |
parent | 18825d8195f05d1a82affc0111f524371dbdeb5f (diff) | |
download | opie-5b2632bcae03b159d137fe9489eb2620c0f65f1a.zip opie-5b2632bcae03b159d137fe9489eb2620c0f65f1a.tar.gz opie-5b2632bcae03b159d137fe9489eb2620c0f65f1a.tar.bz2 |
design bug fixed.
xml-file now may contain floating holidays. syntax of it - see german.xml as
example and/or README file in OPIEDIR/etc/nationaldays/
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 @@ -5,2 +5,3 @@ #include <qstringlist.h>
+#include <qvaluelist.h>
#include <qmap.h>
@@ -10,2 +11,35 @@ typedef QMap<QDate,QStringList> tholidaylist; +class NHentry
+{
+public:
+ enum entry_type{fix,floating};
+ NHentry();
+ virtual ~NHentry();
+
+ void setName(const QString&);
+ const QString&name()const;
+ void setType(entry_type);
+ entry_type type()const;
+ void setDate(const QDate&);
+ const QDate&date()const;
+ void setWeekday(const QString&);
+ const QString&weekday()const;
+ void setDayofmonth(const QString&);
+ const QString&dayofmonth()const;
+ void setDaydep(const QString&);
+ const QString&daydep()const;
+ void setMonth(const QString&);
+ const QString&month()const;
+ void setOffet(int);
+ const int offset()const;
+
+protected:
+ entry_type m_Type;
+ QString m_Name,m_Weekday,m_Dayofmonth,m_Depth,m_Month;
+ QDate m_Date;
+ int m_Offset;
+};
+
+typedef QValueList<NHentry> tentrylist;
+
class NHcfg:public QXmlDefaultHandler
@@ -17,3 +51,4 @@ public: bool load(const QString&);
- const tholidaylist&days()const;
+ const tentrylist&fixDates()const;
+ const tentrylist&floatingDates()const;
@@ -27,11 +62,12 @@ public: protected:
- tholidaylist _content;
- QString _contentname;
- QString err;
+ QString err,_contentname;
QString _path;
+ NHentry m_currentEntry;
+
bool setName(const QXmlAttributes&);
bool parsevalue(const QString&,const QXmlAttributes&);
- int stage;
-// int pos;
+ bool parseCalc(const QString&,const QXmlAttributes&);
+ int stage,counter,level;
+ tentrylist currentFloatList,currentFixList;
};
|