author | zautrix <zautrix> | 2005-06-29 10:36:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 10:36:31 (UTC) |
commit | b7044dfc9516d546683973985555c481d59fc677 (patch) (unidiff) | |
tree | b521090cfc8eb6c8c6a6f6f8167c83058ea1361b /libkcal | |
parent | f226b4cd2ce06a6948811fe04d80fe3ffa44f695 (diff) | |
download | kdepimpi-b7044dfc9516d546683973985555c481d59fc677.zip kdepimpi-b7044dfc9516d546683973985555c481d59fc677.tar.gz kdepimpi-b7044dfc9516d546683973985555c481d59fc677.tar.bz2 |
journal fixxx
-rw-r--r-- | libkcal/calendar.h | 1 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 14 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 2efa355..4652fe5 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h | |||
@@ -182,128 +182,129 @@ public: | |||
182 | */ | 182 | */ |
183 | QPtrList<Event> events( const QDate &date, bool sorted = false); | 183 | QPtrList<Event> events( const QDate &date, bool sorted = false); |
184 | /** | 184 | /** |
185 | Get events, which occur on the given date. | 185 | Get events, which occur on the given date. |
186 | The calendar filter is applied. | 186 | The calendar filter is applied. |
187 | */ | 187 | */ |
188 | QPtrList<Event> events( const QDateTime &qdt ); | 188 | QPtrList<Event> events( const QDateTime &qdt ); |
189 | /** | 189 | /** |
190 | Get events in a range of dates. If inclusive is set to true, only events | 190 | Get events in a range of dates. If inclusive is set to true, only events |
191 | are returned, which are completely included in the range. | 191 | are returned, which are completely included in the range. |
192 | The calendar filter is applied. | 192 | The calendar filter is applied. |
193 | */ | 193 | */ |
194 | QPtrList<Event> events( const QDate &start, const QDate &end, | 194 | QPtrList<Event> events( const QDate &start, const QDate &end, |
195 | bool inclusive = false); | 195 | bool inclusive = false); |
196 | /** | 196 | /** |
197 | Return filtered list of all events in calendar. | 197 | Return filtered list of all events in calendar. |
198 | */ | 198 | */ |
199 | virtual QPtrList<Event> events(); | 199 | virtual QPtrList<Event> events(); |
200 | /** | 200 | /** |
201 | Return unfiltered list of all events in calendar. | 201 | Return unfiltered list of all events in calendar. |
202 | */ | 202 | */ |
203 | virtual QPtrList<Event> rawEvents() = 0; | 203 | virtual QPtrList<Event> rawEvents() = 0; |
204 | 204 | ||
205 | /** | 205 | /** |
206 | Add a todo to the todolist. | 206 | Add a todo to the todolist. |
207 | 207 | ||
208 | @return true on success, false on error. | 208 | @return true on success, false on error. |
209 | */ | 209 | */ |
210 | virtual bool addTodo( Todo *todo ) = 0; | 210 | virtual bool addTodo( Todo *todo ) = 0; |
211 | virtual bool addTodoNoDup( Todo *todo ) = 0; | 211 | virtual bool addTodoNoDup( Todo *todo ) = 0; |
212 | /** | 212 | /** |
213 | Remove a todo from the todolist. | 213 | Remove a todo from the todolist. |
214 | */ | 214 | */ |
215 | virtual void deleteTodo( Todo * ) = 0; | 215 | virtual void deleteTodo( Todo * ) = 0; |
216 | virtual void deleteJournal( Journal * ) = 0; | 216 | virtual void deleteJournal( Journal * ) = 0; |
217 | /** | 217 | /** |
218 | Return filterd list of todos. | 218 | Return filterd list of todos. |
219 | */ | 219 | */ |
220 | virtual QPtrList<Todo> todos(); | 220 | virtual QPtrList<Todo> todos(); |
221 | /** | 221 | /** |
222 | Searches todolist for an event with this unique string identifier, | 222 | Searches todolist for an event with this unique string identifier, |
223 | returns a pointer or null. | 223 | returns a pointer or null. |
224 | */ | 224 | */ |
225 | virtual Todo *todo( const QString &uid ) = 0; | 225 | virtual Todo *todo( const QString &uid ) = 0; |
226 | virtual Todo *todo( QString, QString ) = 0; | 226 | virtual Todo *todo( QString, QString ) = 0; |
227 | /** | 227 | /** |
228 | Returns list of todos due on the specified date. | 228 | Returns list of todos due on the specified date. |
229 | */ | 229 | */ |
230 | virtual QPtrList<Todo> todos( const QDate &date ) = 0; | 230 | virtual QPtrList<Todo> todos( const QDate &date ) = 0; |
231 | /** | 231 | /** |
232 | Return unfiltered list of todos. | 232 | Return unfiltered list of todos. |
233 | */ | 233 | */ |
234 | virtual QPtrList<Todo> rawTodos() = 0; | 234 | virtual QPtrList<Todo> rawTodos() = 0; |
235 | 235 | ||
236 | /** | 236 | /** |
237 | Add a Journal entry to calendar. | 237 | Add a Journal entry to calendar. |
238 | 238 | ||
239 | @return true on success, false on error. | 239 | @return true on success, false on error. |
240 | */ | 240 | */ |
241 | virtual bool addJournal( Journal * ) = 0; | 241 | virtual bool addJournal( Journal * ) = 0; |
242 | /** | 242 | /** |
243 | Return Journal for given date. | 243 | Return Journal for given date. |
244 | */ | 244 | */ |
245 | virtual Journal *journal( const QDate & ) = 0; | 245 | virtual Journal *journal( const QDate & ) = 0; |
246 | virtual QPtrList<Journal> journals4Date( const QDate & ) = 0; | ||
246 | /** | 247 | /** |
247 | Return Journal with given UID. | 248 | Return Journal with given UID. |
248 | */ | 249 | */ |
249 | virtual Journal *journal( const QString &UID ) = 0; | 250 | virtual Journal *journal( const QString &UID ) = 0; |
250 | /** | 251 | /** |
251 | Return list of all Journal entries. | 252 | Return list of all Journal entries. |
252 | */ | 253 | */ |
253 | virtual QPtrList<Journal> journals() = 0; | 254 | virtual QPtrList<Journal> journals() = 0; |
254 | 255 | ||
255 | /** | 256 | /** |
256 | Searches all incidence types for an incidence with this unique | 257 | Searches all incidence types for an incidence with this unique |
257 | string identifier, returns a pointer or null. | 258 | string identifier, returns a pointer or null. |
258 | */ | 259 | */ |
259 | Incidence* incidence( const QString&UID ); | 260 | Incidence* incidence( const QString&UID ); |
260 | 261 | ||
261 | /** | 262 | /** |
262 | Setup relations for an incidence. | 263 | Setup relations for an incidence. |
263 | */ | 264 | */ |
264 | virtual void setupRelations( Incidence * ); | 265 | virtual void setupRelations( Incidence * ); |
265 | /** | 266 | /** |
266 | Remove all relations to an incidence | 267 | Remove all relations to an incidence |
267 | */ | 268 | */ |
268 | virtual void removeRelations( Incidence * ); | 269 | virtual void removeRelations( Incidence * ); |
269 | 270 | ||
270 | /** | 271 | /** |
271 | Set calendar filter, which filters events for the events() functions. | 272 | Set calendar filter, which filters events for the events() functions. |
272 | The Filter object is owned by the caller. | 273 | The Filter object is owned by the caller. |
273 | */ | 274 | */ |
274 | void setFilter( CalFilter * ); | 275 | void setFilter( CalFilter * ); |
275 | /** | 276 | /** |
276 | Return calendar filter. | 277 | Return calendar filter. |
277 | */ | 278 | */ |
278 | CalFilter *filter(); | 279 | CalFilter *filter(); |
279 | virtual QDateTime nextAlarm( int daysTo ) = 0; | 280 | virtual QDateTime nextAlarm( int daysTo ) = 0; |
280 | virtual QString nextSummary( ) const = 0; | 281 | virtual QString nextSummary( ) const = 0; |
281 | virtual void reInitAlarmSettings() = 0; | 282 | virtual void reInitAlarmSettings() = 0; |
282 | virtual QDateTime nextAlarmEventDateTime() const = 0; | 283 | virtual QDateTime nextAlarmEventDateTime() const = 0; |
283 | virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; | 284 | virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; |
284 | /** | 285 | /** |
285 | Return all alarms, which ocur in the given time interval. | 286 | Return all alarms, which ocur in the given time interval. |
286 | */ | 287 | */ |
287 | virtual Alarm::List alarms( const QDateTime &from, | 288 | virtual Alarm::List alarms( const QDateTime &from, |
288 | const QDateTime &to ) = 0; | 289 | const QDateTime &to ) = 0; |
289 | 290 | ||
290 | class Observer { | 291 | class Observer { |
291 | public: | 292 | public: |
292 | virtual void calendarModified( bool, Calendar * ) = 0; | 293 | virtual void calendarModified( bool, Calendar * ) = 0; |
293 | }; | 294 | }; |
294 | 295 | ||
295 | void registerObserver( Observer * ); | 296 | void registerObserver( Observer * ); |
296 | 297 | ||
297 | void setModified( bool ); | 298 | void setModified( bool ); |
298 | 299 | ||
299 | /** | 300 | /** |
300 | Set product id returned by loadedProductId(). This function is only | 301 | Set product id returned by loadedProductId(). This function is only |
301 | useful for the calendar loading code. | 302 | useful for the calendar loading code. |
302 | */ | 303 | */ |
303 | void setLoadedProductId( const QString & ); | 304 | void setLoadedProductId( const QString & ); |
304 | /** | 305 | /** |
305 | Return product id taken from file that has been loaded. Returns | 306 | Return product id taken from file that has been loaded. Returns |
306 | QString::null, if no calendar has been loaded. | 307 | QString::null, if no calendar has been loaded. |
307 | */ | 308 | */ |
308 | QString loadedProductId(); | 309 | QString loadedProductId(); |
309 | int defaultCalendar(); | 310 | int defaultCalendar(); |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 418bfca..ca64e66 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -715,153 +715,155 @@ QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, | |||
715 | QDate next = event->getNextOccurence( start, &founOne ).date(); | 715 | QDate next = event->getNextOccurence( start, &founOne ).date(); |
716 | if ( founOne ) { | 716 | if ( founOne ) { |
717 | if ( next <= end ) { | 717 | if ( next <= end ) { |
718 | found = true; | 718 | found = true; |
719 | } | 719 | } |
720 | } | 720 | } |
721 | 721 | ||
722 | /* | 722 | /* |
723 | // crap !!! | 723 | // crap !!! |
724 | if ( rStart <= end ) { // Start date not after range | 724 | if ( rStart <= end ) { // Start date not after range |
725 | if ( rStart >= start ) { // Start date within range | 725 | if ( rStart >= start ) { // Start date within range |
726 | found = true; | 726 | found = true; |
727 | } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever | 727 | } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever |
728 | found = true; | 728 | found = true; |
729 | } else if ( event->recurrence()->duration() == 0 ) { // End date set | 729 | } else if ( event->recurrence()->duration() == 0 ) { // End date set |
730 | QDate rEnd = event->recurrence()->endDate(); | 730 | QDate rEnd = event->recurrence()->endDate(); |
731 | if ( rEnd >= start && rEnd <= end ) { // End date within range | 731 | if ( rEnd >= start && rEnd <= end ) { // End date within range |
732 | found = true; | 732 | found = true; |
733 | } | 733 | } |
734 | } else { // Duration set | 734 | } else { // Duration set |
735 | // TODO: Calculate end date from duration. Should be done in Event | 735 | // TODO: Calculate end date from duration. Should be done in Event |
736 | // For now include all events with a duration. | 736 | // For now include all events with a duration. |
737 | found = true; | 737 | found = true; |
738 | } | 738 | } |
739 | } | 739 | } |
740 | */ | 740 | */ |
741 | 741 | ||
742 | } | 742 | } |
743 | 743 | ||
744 | if ( found ) eventList.append( event ); | 744 | if ( found ) eventList.append( event ); |
745 | } else { | 745 | } else { |
746 | QDate s = event->dtStart().date(); | 746 | QDate s = event->dtStart().date(); |
747 | QDate e = event->dtEnd().date(); | 747 | QDate e = event->dtEnd().date(); |
748 | 748 | ||
749 | if ( inclusive ) { | 749 | if ( inclusive ) { |
750 | if ( s >= start && e <= end ) { | 750 | if ( s >= start && e <= end ) { |
751 | eventList.append( event ); | 751 | eventList.append( event ); |
752 | } | 752 | } |
753 | } else { | 753 | } else { |
754 | if ( ( e >= start && s <= end ) ) { | 754 | if ( ( e >= start && s <= end ) ) { |
755 | eventList.append( event ); | 755 | eventList.append( event ); |
756 | } | 756 | } |
757 | } | 757 | } |
758 | } | 758 | } |
759 | } | 759 | } |
760 | 760 | ||
761 | return eventList; | 761 | return eventList; |
762 | } | 762 | } |
763 | 763 | ||
764 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) | 764 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) |
765 | { | 765 | { |
766 | return rawEventsForDate( qdt.date() ); | 766 | return rawEventsForDate( qdt.date() ); |
767 | } | 767 | } |
768 | 768 | ||
769 | QPtrList<Event> CalendarLocal::rawEvents() | 769 | QPtrList<Event> CalendarLocal::rawEvents() |
770 | { | 770 | { |
771 | QPtrList<Event> el; | 771 | QPtrList<Event> el; |
772 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) | 772 | for ( Event *it = mEventList.first(); it; it = mEventList.next() ) |
773 | if ( it->calEnabled() ) el.append( it ); | 773 | if ( it->calEnabled() ) el.append( it ); |
774 | return el; | 774 | return el; |
775 | } | 775 | } |
776 | 776 | ||
777 | bool CalendarLocal::addJournal(Journal *journal) | 777 | bool CalendarLocal::addJournal(Journal *journal) |
778 | { | 778 | { |
779 | if ( journal->dtStart().isValid()) | 779 | mJournalList.append(journal); |
780 | kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; | ||
781 | else | ||
782 | kdDebug(5800) << "Adding Journal without a DTSTART" << endl; | ||
783 | |||
784 | mJournalList.append(journal); | ||
785 | 780 | ||
786 | journal->registerObserver( this ); | 781 | journal->registerObserver( this ); |
787 | 782 | ||
788 | setModified( true ); | 783 | setModified( true ); |
789 | journal->setCalID( mDefaultCalendar ); | 784 | journal->setCalID( mDefaultCalendar ); |
790 | journal->setCalEnabled( true ); | 785 | journal->setCalEnabled( true ); |
791 | return true; | 786 | return true; |
792 | } | 787 | } |
793 | 788 | ||
794 | void CalendarLocal::deleteJournal( Journal *journal ) | 789 | void CalendarLocal::deleteJournal( Journal *journal ) |
795 | { | 790 | { |
796 | if ( mUndoIncidence ) delete mUndoIncidence; | 791 | if ( mUndoIncidence ) delete mUndoIncidence; |
797 | mUndoIncidence = journal->clone(); | 792 | mUndoIncidence = journal->clone(); |
798 | mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); | 793 | mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); |
799 | if ( mJournalList.removeRef(journal) ) { | 794 | if ( mJournalList.removeRef(journal) ) { |
800 | setModified( true ); | 795 | setModified( true ); |
801 | } | 796 | } |
802 | } | 797 | } |
803 | 798 | ||
799 | QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) | ||
800 | { | ||
801 | QPtrList<Journal> el; | ||
802 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | ||
803 | if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); | ||
804 | return el; | ||
805 | } | ||
804 | Journal *CalendarLocal::journal( const QDate &date ) | 806 | Journal *CalendarLocal::journal( const QDate &date ) |
805 | { | 807 | { |
806 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; | 808 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; |
807 | 809 | ||
808 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 810 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
809 | if ( it->calEnabled() && it->dtStart().date() == date ) | 811 | if ( it->calEnabled() && it->dtStart().date() == date ) |
810 | return it; | 812 | return it; |
811 | 813 | ||
812 | return 0; | 814 | return 0; |
813 | } | 815 | } |
814 | 816 | ||
815 | Journal *CalendarLocal::journal( const QString &uid ) | 817 | Journal *CalendarLocal::journal( const QString &uid ) |
816 | { | 818 | { |
817 | Journal * retVal = 0; | 819 | Journal * retVal = 0; |
818 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 820 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
819 | if ( it->calEnabled() && it->uid() == uid ) { | 821 | if ( it->calEnabled() && it->uid() == uid ) { |
820 | if ( retVal ) { | 822 | if ( retVal ) { |
821 | if ( retVal->calID() > it->calID() ) { | 823 | if ( retVal->calID() > it->calID() ) { |
822 | retVal = it; | 824 | retVal = it; |
823 | } | 825 | } |
824 | } else { | 826 | } else { |
825 | retVal = it; | 827 | retVal = it; |
826 | } | 828 | } |
827 | } | 829 | } |
828 | return retVal; | 830 | return retVal; |
829 | } | 831 | } |
830 | 832 | ||
831 | QPtrList<Journal> CalendarLocal::journals() | 833 | QPtrList<Journal> CalendarLocal::journals() |
832 | { | 834 | { |
833 | QPtrList<Journal> el; | 835 | QPtrList<Journal> el; |
834 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 836 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
835 | if ( it->calEnabled() ) el.append( it ); | 837 | if ( it->calEnabled() ) el.append( it ); |
836 | return el; | 838 | return el; |
837 | } | 839 | } |
838 | void CalendarLocal::setCalendarRemove( int id ) | 840 | void CalendarLocal::setCalendarRemove( int id ) |
839 | { | 841 | { |
840 | 842 | ||
841 | { | 843 | { |
842 | QPtrList<Event> EventList = mEventList; | 844 | QPtrList<Event> EventList = mEventList; |
843 | Event * ev = EventList.first(); | 845 | Event * ev = EventList.first(); |
844 | while ( ev ) { | 846 | while ( ev ) { |
845 | if ( ev->calID() == id ) | 847 | if ( ev->calID() == id ) |
846 | deleteEvent( ev ); | 848 | deleteEvent( ev ); |
847 | ev = EventList.next(); | 849 | ev = EventList.next(); |
848 | } | 850 | } |
849 | } | 851 | } |
850 | { | 852 | { |
851 | 853 | ||
852 | QPtrList<Todo> TodoList = mTodoList; | 854 | QPtrList<Todo> TodoList = mTodoList; |
853 | Todo * ev = TodoList.first(); | 855 | Todo * ev = TodoList.first(); |
854 | while ( ev ) { | 856 | while ( ev ) { |
855 | if ( ev->calID() == id ) | 857 | if ( ev->calID() == id ) |
856 | deleteTodo( ev ); | 858 | deleteTodo( ev ); |
857 | ev = TodoList.next(); | 859 | ev = TodoList.next(); |
858 | } | 860 | } |
859 | } | 861 | } |
860 | { | 862 | { |
861 | QPtrList<Journal> JournalList = mJournalList; | 863 | QPtrList<Journal> JournalList = mJournalList; |
862 | Journal * ev = JournalList.first(); | 864 | Journal * ev = JournalList.first(); |
863 | while ( ev ) { | 865 | while ( ev ) { |
864 | if ( ev->calID() == id ) | 866 | if ( ev->calID() == id ) |
865 | deleteJournal( ev ); | 867 | deleteJournal( ev ); |
866 | ev = JournalList.next(); | 868 | ev = JournalList.next(); |
867 | } | 869 | } |
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index d32597f..98d16a3 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h | |||
@@ -70,128 +70,129 @@ class CalendarLocal : public Calendar | |||
70 | void save() {} | 70 | void save() {} |
71 | 71 | ||
72 | /** | 72 | /** |
73 | Add Event to calendar. | 73 | Add Event to calendar. |
74 | */ | 74 | */ |
75 | void removeSyncInfo( QString syncProfile); | 75 | void removeSyncInfo( QString syncProfile); |
76 | bool addAnniversaryNoDup( Event *event ); | 76 | bool addAnniversaryNoDup( Event *event ); |
77 | bool addEventNoDup( Event *event ); | 77 | bool addEventNoDup( Event *event ); |
78 | bool addEvent( Event *event ); | 78 | bool addEvent( Event *event ); |
79 | /** | 79 | /** |
80 | Deletes an event from this calendar. | 80 | Deletes an event from this calendar. |
81 | */ | 81 | */ |
82 | void deleteEvent( Event *event ); | 82 | void deleteEvent( Event *event ); |
83 | 83 | ||
84 | /** | 84 | /** |
85 | Retrieves an event on the basis of the unique string ID. | 85 | Retrieves an event on the basis of the unique string ID. |
86 | */ | 86 | */ |
87 | Event *event( const QString &uid ); | 87 | Event *event( const QString &uid ); |
88 | /** | 88 | /** |
89 | Return unfiltered list of all events in calendar. | 89 | Return unfiltered list of all events in calendar. |
90 | */ | 90 | */ |
91 | QPtrList<Event> rawEvents(); | 91 | QPtrList<Event> rawEvents(); |
92 | QPtrList<Event> getExternLastSyncEvents(); | 92 | QPtrList<Event> getExternLastSyncEvents(); |
93 | /** | 93 | /** |
94 | Add a todo to the todolist. | 94 | Add a todo to the todolist. |
95 | */ | 95 | */ |
96 | bool addTodo( Todo *todo ); | 96 | bool addTodo( Todo *todo ); |
97 | bool addTodoNoDup( Todo *todo ); | 97 | bool addTodoNoDup( Todo *todo ); |
98 | /** | 98 | /** |
99 | Remove a todo from the todolist. | 99 | Remove a todo from the todolist. |
100 | */ | 100 | */ |
101 | void deleteTodo( Todo * ); | 101 | void deleteTodo( Todo * ); |
102 | /** | 102 | /** |
103 | Searches todolist for an event with this unique string identifier, | 103 | Searches todolist for an event with this unique string identifier, |
104 | returns a pointer or null. | 104 | returns a pointer or null. |
105 | */ | 105 | */ |
106 | Todo *todo( const QString &uid ); | 106 | Todo *todo( const QString &uid ); |
107 | /** | 107 | /** |
108 | Return list of all todos. | 108 | Return list of all todos. |
109 | */ | 109 | */ |
110 | QPtrList<Todo> rawTodos(); | 110 | QPtrList<Todo> rawTodos(); |
111 | /** | 111 | /** |
112 | Returns list of todos due on the specified date. | 112 | Returns list of todos due on the specified date. |
113 | */ | 113 | */ |
114 | QPtrList<Todo> todos( const QDate &date ); | 114 | QPtrList<Todo> todos( const QDate &date ); |
115 | /** | 115 | /** |
116 | Return list of all todos. | 116 | Return list of all todos. |
117 | 117 | ||
118 | Workaround because compiler does not recognize function of base class. | 118 | Workaround because compiler does not recognize function of base class. |
119 | */ | 119 | */ |
120 | QPtrList<Todo> todos() { return Calendar::todos(); } | 120 | QPtrList<Todo> todos() { return Calendar::todos(); } |
121 | 121 | ||
122 | /** | 122 | /** |
123 | Add a Journal entry to calendar. | 123 | Add a Journal entry to calendar. |
124 | */ | 124 | */ |
125 | bool addJournal( Journal * ); | 125 | bool addJournal( Journal * ); |
126 | /** | 126 | /** |
127 | Remove a Journal from the calendar. | 127 | Remove a Journal from the calendar. |
128 | */ | 128 | */ |
129 | void deleteJournal( Journal * ); | 129 | void deleteJournal( Journal * ); |
130 | /** | 130 | /** |
131 | Return Journal for given date. | 131 | Return Journal for given date. |
132 | */ | 132 | */ |
133 | Journal *journal( const QDate & ); | 133 | Journal *journal( const QDate & ); |
134 | QPtrList<Journal> journals4Date( const QDate & ); | ||
134 | /** | 135 | /** |
135 | Return Journal with given UID. | 136 | Return Journal with given UID. |
136 | */ | 137 | */ |
137 | Journal *journal( const QString &uid ); | 138 | Journal *journal( const QString &uid ); |
138 | /** | 139 | /** |
139 | Return list of all Journals stored in calendar. | 140 | Return list of all Journals stored in calendar. |
140 | */ | 141 | */ |
141 | QPtrList<Journal> journals(); | 142 | QPtrList<Journal> journals(); |
142 | 143 | ||
143 | /** | 144 | /** |
144 | Return all alarms, which ocur in the given time interval. | 145 | Return all alarms, which ocur in the given time interval. |
145 | */ | 146 | */ |
146 | Alarm::List alarms( const QDateTime &from, const QDateTime &to ); | 147 | Alarm::List alarms( const QDateTime &from, const QDateTime &to ); |
147 | 148 | ||
148 | /** | 149 | /** |
149 | Return all alarms, which ocur before given date. | 150 | Return all alarms, which ocur before given date. |
150 | */ | 151 | */ |
151 | Alarm::List alarmsTo( const QDateTime &to ); | 152 | Alarm::List alarmsTo( const QDateTime &to ); |
152 | 153 | ||
153 | QDateTime nextAlarm( int daysTo ) ; | 154 | QDateTime nextAlarm( int daysTo ) ; |
154 | QDateTime nextAlarmEventDateTime() const; | 155 | QDateTime nextAlarmEventDateTime() const; |
155 | void checkAlarmForIncidence( Incidence *, bool deleted ) ; | 156 | void checkAlarmForIncidence( Incidence *, bool deleted ) ; |
156 | void registerAlarm(); | 157 | void registerAlarm(); |
157 | void deRegisterAlarm(); | 158 | void deRegisterAlarm(); |
158 | QString getAlarmNotification(); | 159 | QString getAlarmNotification(); |
159 | QString nextSummary() const ; | 160 | QString nextSummary() const ; |
160 | /** | 161 | /** |
161 | This method should be called whenever a Event is modified directly | 162 | This method should be called whenever a Event is modified directly |
162 | via it's pointer. It makes sure that the calendar is internally | 163 | via it's pointer. It makes sure that the calendar is internally |
163 | consistent. | 164 | consistent. |
164 | */ | 165 | */ |
165 | void update( IncidenceBase *incidence ); | 166 | void update( IncidenceBase *incidence ); |
166 | 167 | ||
167 | /** | 168 | /** |
168 | Builds and then returns a list of all events that match for the | 169 | Builds and then returns a list of all events that match for the |
169 | date specified. useful for dayView, etc. etc. | 170 | date specified. useful for dayView, etc. etc. |
170 | */ | 171 | */ |
171 | QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); | 172 | QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); |
172 | /** | 173 | /** |
173 | Get unfiltered events for date \a qdt. | 174 | Get unfiltered events for date \a qdt. |
174 | */ | 175 | */ |
175 | QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); | 176 | QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); |
176 | /** | 177 | /** |
177 | Get unfiltered events in a range of dates. If inclusive is set to true, | 178 | Get unfiltered events in a range of dates. If inclusive is set to true, |
178 | only events are returned, which are completely included in the range. | 179 | only events are returned, which are completely included in the range. |
179 | */ | 180 | */ |
180 | QPtrList<Event> rawEvents( const QDate &start, const QDate &end, | 181 | QPtrList<Event> rawEvents( const QDate &start, const QDate &end, |
181 | bool inclusive = false ); | 182 | bool inclusive = false ); |
182 | Todo *todo( QString, QString ); | 183 | Todo *todo( QString, QString ); |
183 | Event *event( QString, QString ); | 184 | Event *event( QString, QString ); |
184 | 185 | ||
185 | public slots: | 186 | public slots: |
186 | void setCalendarEnabled( int id, bool enable ); | 187 | void setCalendarEnabled( int id, bool enable ); |
187 | void setAlarmEnabled( int id, bool enable ); | 188 | void setAlarmEnabled( int id, bool enable ); |
188 | void setReadOnly( int id, bool enable ); | 189 | void setReadOnly( int id, bool enable ); |
189 | void setDefaultCalendarEnabledOnly(); | 190 | void setDefaultCalendarEnabledOnly(); |
190 | void setCalendarRemove( int id ); | 191 | void setCalendarRemove( int id ); |
191 | 192 | ||
192 | protected: | 193 | protected: |
193 | 194 | ||
194 | // Event* mNextAlarmEvent; | 195 | // Event* mNextAlarmEvent; |
195 | QString mNextSummary; | 196 | QString mNextSummary; |
196 | QString mNextAlarmEventDateTimeString; | 197 | QString mNextAlarmEventDateTimeString; |
197 | QString mLastAlarmNotificationString; | 198 | QString mLastAlarmNotificationString; |