summaryrefslogtreecommitdiff
path: root/libopie/pim
authoreilers <eilers>2004-01-16 13:37:03 (UTC)
committer eilers <eilers>2004-01-16 13:37:03 (UTC)
commit839775ea257f2c9be752a77c41a09416469df591 (patch) (side-by-side diff)
treed856530aad005f66adae3634bd384d3d02bb6c95 /libopie/pim
parentf7936b488e81f8706c4ea900979f2ea70734cfe9 (diff)
downloadopie-839775ea257f2c9be752a77c41a09416469df591.zip
opie-839775ea257f2c9be752a77c41a09416469df591.tar.gz
opie-839775ea257f2c9be752a77c41a09416469df591.tar.bz2
Some changes to handle alarms for datebook-sql db..
Diffstat (limited to 'libopie/pim') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/opimnotifymanager.cpp16
-rw-r--r--libopie/pim/opimnotifymanager.h15
-rw-r--r--libopie/pim/orecur.h5
3 files changed, 36 insertions, 0 deletions
diff --git a/libopie/pim/opimnotifymanager.cpp b/libopie/pim/opimnotifymanager.cpp
index 53ad4c3..d6f0ead 100644
--- a/libopie/pim/opimnotifymanager.cpp
+++ b/libopie/pim/opimnotifymanager.cpp
@@ -42,12 +42,28 @@ void OPimNotifyManager::replace( const OPimNotify& noti) {
OPimNotifyManager::Reminders OPimNotifyManager::reminders()const {
return m_rem;
}
OPimNotifyManager::Alarms OPimNotifyManager::alarms()const {
return m_al;
}
+OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found ) const {
+ Alarms::ConstIterator it;
+ found = true;
+
+ for ( it = m_al.begin(); it != m_al.end(); ++it ){
+ if ( (*it).dateTime() == when )
+ return (*it);
+ }
+
+ // Fall through if nothing could be found
+ found = false;
+ OPimAlarm empty;
+ return empty;
+}
+
+
void OPimNotifyManager::setAlarms( const Alarms& al) {
m_al = al;
}
void OPimNotifyManager::setReminders( const Reminders& rem) {
m_rem = rem;
}
diff --git a/libopie/pim/opimnotifymanager.h b/libopie/pim/opimnotifymanager.h
index 48410e7..f3c22f9 100644
--- a/libopie/pim/opimnotifymanager.h
+++ b/libopie/pim/opimnotifymanager.h
@@ -19,14 +19,29 @@ public:
void add( const OPimNotify& );
void remove( const OPimNotify& );
/* replaces all with this one! */
void replace( const OPimNotify& );
Reminders reminders()const;
+
+ /**
+ * Return
+ */
Alarms alarms()const;
+ /**
+ * Return alarm at DateTime "when". If more than one is registered at this
+ * DateTime, the first one is returned.
+ * If none was found, an empty Alarm is returned.
+ * @param when The date and time of the returned alarm
+ * @param found Returns true if anything was found.
+ * @return Returns the found alarm at given DateTime. It is empty if found is false
+ * (nothing could be found at given date and time)
+ */
+ OPimAlarm alarmAtDateTime( const QDateTime& when, bool& found ) const;
+
void setAlarms( const Alarms& );
void setReminders( const Reminders& );
/* register is a Ansi C keyword... */
/**
* This function will register the Notify to the Alarm Server
diff --git a/libopie/pim/orecur.h b/libopie/pim/orecur.h
index 7750c12..d7ecd90 100644
--- a/libopie/pim/orecur.h
+++ b/libopie/pim/orecur.h
@@ -8,12 +8,17 @@
#include <sys/types.h>
#include <qdatetime.h>
#include <qvaluelist.h>
#include <qmap.h>
+
+/**
+ * Class to handle Recurrencies..
+ */
+
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,