summaryrefslogtreecommitdiff
path: root/libopie/pim/orecur.h
authoreilers <eilers>2003-12-08 15:18:10 (UTC)
committer eilers <eilers>2003-12-08 15:18:10 (UTC)
commit6974a4bbdc674a2a5d41d801f80035a183faedb5 (patch) (side-by-side diff)
tree09a719ef263047e92ffb866da13168b7f7d41f23 /libopie/pim/orecur.h
parent7f2f736597490fd1592d7ed1f40e4abf824673c0 (diff)
downloadopie-6974a4bbdc674a2a5d41d801f80035a183faedb5.zip
opie-6974a4bbdc674a2a5d41d801f80035a183faedb5.tar.gz
opie-6974a4bbdc674a2a5d41d801f80035a183faedb5.tar.bz2
Committing unfinished sql implementation before merging to libopie2 starts..
Diffstat (limited to 'libopie/pim/orecur.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/orecur.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie/pim/orecur.h b/libopie/pim/orecur.h
index 47901b0..7750c12 100644
--- a/libopie/pim/orecur.h
+++ b/libopie/pim/orecur.h
@@ -1,101 +1,102 @@
/*
* 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 QMap<int, QString>& map );
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;
/**
* FromWhereToStart is not included!!!
*/
bool nextOcurrence( const QDate& FromWhereToStart, QDate &recurDate );
/**
* The module this ORecur belongs to
*/
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