-rw-r--r-- | libopie/pim/opimnotifymanager.cpp | 16 | ||||
-rw-r--r-- | libopie/pim/opimnotifymanager.h | 15 | ||||
-rw-r--r-- | libopie/pim/orecur.h | 5 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimnotifymanager.cpp | 16 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimnotifymanager.h | 15 | ||||
-rw-r--r-- | libopie2/opiepim/core/orecur.h | 5 |
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 { 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; } 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: 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& ); 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 @@ #include <qvaluelist.h> #include <qmap.h> + +/** + * Class to handle Recurrencies.. + */ + class ORecur { public: 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 { 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; } 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: 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& ); 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 @@ #include <qvaluelist.h> #include <qmap.h> + +/** + * Class to handle Recurrencies.. + */ + class ORecur { public: typedef QValueList<QDate> ExceptionList; |