summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimnotifymanager.cpp16
-rw-r--r--libopie/pim/opimnotifymanager.h15
-rw-r--r--libopie/pim/orecur.h5
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp16
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.h15
-rw-r--r--libopie2/opiepim/core/orecur.h5
6 files changed, 72 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
@@ -45,6 +45,22 @@ OPimNotifyManager::Reminders OPimNotifyManager::reminders()const {
45OPimNotifyManager::Alarms OPimNotifyManager::alarms()const { 45OPimNotifyManager::Alarms OPimNotifyManager::alarms()const {
46 return m_al; 46 return m_al;
47} 47}
48OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found ) const {
49 Alarms::ConstIterator it;
50 found = true;
51
52 for ( it = m_al.begin(); it != m_al.end(); ++it ){
53 if ( (*it).dateTime() == when )
54 return (*it);
55 }
56
57 // Fall through if nothing could be found
58 found = false;
59 OPimAlarm empty;
60 return empty;
61}
62
63
48void OPimNotifyManager::setAlarms( const Alarms& al) { 64void OPimNotifyManager::setAlarms( const Alarms& al) {
49 m_al = al; 65 m_al = al;
50} 66}
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
@@ -22,8 +22,23 @@ public:
22 void replace( const OPimNotify& ); 22 void replace( const OPimNotify& );
23 23
24 Reminders reminders()const; 24 Reminders reminders()const;
25
26 /**
27 * Return
28 */
25 Alarms alarms()const; 29 Alarms alarms()const;
26 30
31 /**
32 * Return alarm at DateTime "when". If more than one is registered at this
33 * DateTime, the first one is returned.
34 * If none was found, an empty Alarm is returned.
35 * @param when The date and time of the returned alarm
36 * @param found Returns true if anything was found.
37 * @return Returns the found alarm at given DateTime. It is empty if found is false
38 * (nothing could be found at given date and time)
39 */
40 OPimAlarm alarmAtDateTime( const QDateTime& when, bool& found ) const;
41
27 void setAlarms( const Alarms& ); 42 void setAlarms( const Alarms& );
28 void setReminders( const Reminders& ); 43 void setReminders( const Reminders& );
29 44
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
@@ -11,6 +11,11 @@
11#include <qvaluelist.h> 11#include <qvaluelist.h>
12#include <qmap.h> 12#include <qmap.h>
13 13
14
15/**
16 * Class to handle Recurrencies..
17 */
18
14class ORecur { 19class ORecur {
15public: 20public:
16 typedef QValueList<QDate> ExceptionList; 21 typedef QValueList<QDate> ExceptionList;
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index 53ad4c3..d6f0ead 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -45,6 +45,22 @@ OPimNotifyManager::Reminders OPimNotifyManager::reminders()const {
45OPimNotifyManager::Alarms OPimNotifyManager::alarms()const { 45OPimNotifyManager::Alarms OPimNotifyManager::alarms()const {
46 return m_al; 46 return m_al;
47} 47}
48OPimAlarm OPimNotifyManager::alarmAtDateTime( const QDateTime& when, bool& found ) const {
49 Alarms::ConstIterator it;
50 found = true;
51
52 for ( it = m_al.begin(); it != m_al.end(); ++it ){
53 if ( (*it).dateTime() == when )
54 return (*it);
55 }
56
57 // Fall through if nothing could be found
58 found = false;
59 OPimAlarm empty;
60 return empty;
61}
62
63
48void OPimNotifyManager::setAlarms( const Alarms& al) { 64void OPimNotifyManager::setAlarms( const Alarms& al) {
49 m_al = al; 65 m_al = al;
50} 66}
diff --git a/libopie2/opiepim/core/opimnotifymanager.h b/libopie2/opiepim/core/opimnotifymanager.h
index 48410e7..f3c22f9 100644
--- a/libopie2/opiepim/core/opimnotifymanager.h
+++ b/libopie2/opiepim/core/opimnotifymanager.h
@@ -22,8 +22,23 @@ public:
22 void replace( const OPimNotify& ); 22 void replace( const OPimNotify& );
23 23
24 Reminders reminders()const; 24 Reminders reminders()const;
25
26 /**
27 * Return
28 */
25 Alarms alarms()const; 29 Alarms alarms()const;
26 30
31 /**
32 * Return alarm at DateTime "when". If more than one is registered at this
33 * DateTime, the first one is returned.
34 * If none was found, an empty Alarm is returned.
35 * @param when The date and time of the returned alarm
36 * @param found Returns true if anything was found.
37 * @return Returns the found alarm at given DateTime. It is empty if found is false
38 * (nothing could be found at given date and time)
39 */
40 OPimAlarm alarmAtDateTime( const QDateTime& when, bool& found ) const;
41
27 void setAlarms( const Alarms& ); 42 void setAlarms( const Alarms& );
28 void setReminders( const Reminders& ); 43 void setReminders( const Reminders& );
29 44
diff --git a/libopie2/opiepim/core/orecur.h b/libopie2/opiepim/core/orecur.h
index 7750c12..d7ecd90 100644
--- a/libopie2/opiepim/core/orecur.h
+++ b/libopie2/opiepim/core/orecur.h
@@ -11,6 +11,11 @@
11#include <qvaluelist.h> 11#include <qvaluelist.h>
12#include <qmap.h> 12#include <qmap.h>
13 13
14
15/**
16 * Class to handle Recurrencies..
17 */
18
14class ORecur { 19class ORecur {
15public: 20public:
16 typedef QValueList<QDate> ExceptionList; 21 typedef QValueList<QDate> ExceptionList;