summaryrefslogtreecommitdiff
path: root/libopie/pim/orecur.h
authoreilers <eilers>2003-11-10 08:28:38 (UTC)
committer eilers <eilers>2003-11-10 08:28:38 (UTC)
commitf3326a60ba002b420f33b6132dc1740c0fc4ffef (patch) (side-by-side diff)
tree6809f30857a241cf3334f7d25f60edc6fbb83901 /libopie/pim/orecur.h
parentefa3f9a756fb5a9afd0d35bc783e1331bf40bc6a (diff)
downloadopie-f3326a60ba002b420f33b6132dc1740c0fc4ffef.zip
opie-f3326a60ba002b420f33b6132dc1740c0fc4ffef.tar.gz
opie-f3326a60ba002b420f33b6132dc1740c0fc4ffef.tar.bz2
Platform MacOS-X: Disable backtrce in odebug..
Libopie PIM: Finishing SQL-Backend for Todo. Recurrance events are supported now. What is still missing: Custom entries currently not stored. It isn't easy to implement them with enabled prefetch-cache. LibopieDB2: Adding -lsqlite here instead linking it to libopie
Diffstat (limited to 'libopie/pim/orecur.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/orecur.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libopie/pim/orecur.h b/libopie/pim/orecur.h
index b214b3f..47901b0 100644
--- a/libopie/pim/orecur.h
+++ b/libopie/pim/orecur.h
@@ -1,44 +1,47 @@
/*
* GPL from TT
*/
#ifndef OPIE_RECUR_H
#define OPIE_RECUR_H
#include <sys/types.h>
#include <qdatetime.h>
#include <qvaluelist.h>
-
+#include <qmap.h>
class ORecur {
public:
typedef QValueList<QDate> ExceptionList;
enum RepeatType{ NoRepeat = -1, Daily, Weekly, MonthlyDay,
MonthlyDate, Yearly };
enum Days { MON = 0x01, TUE = 0x02, WED = 0x04, THU = 0x08,
FRI = 0x10, SAT = 0x20, SUN = 0x40 };
+ enum Fields{ RType = 0, RWeekdays, RPosition, RFreq, RHasEndDate,
+ EndDate, Created, Exceptions };
+
ORecur();
ORecur( const ORecur& );
~ORecur();
ORecur &operator=( const ORecur& );
bool operator==(const ORecur& )const;
bool doesRecur()const;
/* if it recurrs on that day */
bool doesRecur( const QDate& );
RepeatType type()const;
int frequency()const;
int position()const;
char days()const;
bool hasEndDate()const;
QDate start()const;
QDate endDate()const;
QDateTime createdDateTime()const;
/**
* starting on monday=0, sunday=6
* for convience
*/
bool repeatOnWeekDay( int day )const;
@@ -52,40 +55,47 @@ public:
*/
QString service()const;
/*
* reference to the exception list
*/
ExceptionList &exceptions();
/**
* the current repetition
*/
int repetition()const;
void setType( const RepeatType& );
void setFrequency( int freq );
void setPosition( int pos );
void setDays( char c);
void setEndDate( const QDate& dt );
void setStart( const QDate& dt );
void setCreatedDateTime( const QDateTime& );
void setHasEndDate( bool b );
void setRepitition(int );
void setService( const QString& ser );
+
+ QMap<int, QString> toMap() const;
+ void fromMap( const QMap<int, QString>& map );
/* almost internal */
QString toString()const;
private:
bool p_nextOccurrence( const QDate& from, QDate& next );
void deref();
inline void checkOrModify();
+ /* Converts rType to String */
+ QString rTypeString() const;
+ /* Returns a map to convert Stringname for RType to RepeatType */
+ QMap<QString, RepeatType> rTypeValueConvertMap() const;
class Data;
Data* data;
class ORecurPrivate;
ORecurPrivate *d;
};
#endif