You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
5.2 KiB
186 lines
5.2 KiB
15 years ago
|
/*
|
||
|
This file is part of libkcal.
|
||
|
|
||
|
Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
11 years ago
|
#ifndef KCAL_RESOURCETDEABC_H
|
||
|
#define KCAL_RESOURCETDEABC_H
|
||
15 years ago
|
|
||
15 years ago
|
#include <tqptrlist.h>
|
||
|
#include <tqstring.h>
|
||
|
#include <tqdatetime.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdeconfig.h>
|
||
15 years ago
|
|
||
|
#include "libkcal/incidence.h"
|
||
|
#include "libkcal/calendarlocal.h"
|
||
12 years ago
|
#include <tdeabc/addressbook.h>
|
||
15 years ago
|
|
||
|
#include "libkcal/resourcecalendar.h"
|
||
|
|
||
13 years ago
|
#include "libtdepim/tdepimmacros.h"
|
||
15 years ago
|
|
||
12 years ago
|
namespace TDEIO {
|
||
15 years ago
|
class FileCopyJob;
|
||
|
class Job;
|
||
|
}
|
||
|
|
||
|
namespace KCal {
|
||
|
|
||
|
/**
|
||
|
Resource providing birthdays and anniversaries as events.
|
||
|
*/
|
||
12 years ago
|
class KDE_EXPORT ResourceTDEABC : public ResourceCalendar
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
12 years ago
|
friend class ResourceTDEABCConfig;
|
||
15 years ago
|
|
||
|
public:
|
||
12 years ago
|
ResourceTDEABC( const TDEConfig * );
|
||
|
ResourceTDEABC( );
|
||
|
virtual ~ResourceTDEABC();
|
||
15 years ago
|
|
||
12 years ago
|
void readConfig( const TDEConfig *config );
|
||
|
void writeConfig( TDEConfig* config );
|
||
15 years ago
|
|
||
|
void setAlarm( bool );
|
||
|
bool alarm();
|
||
|
|
||
|
void setAlarmDays( int );
|
||
|
int alarmDays();
|
||
|
|
||
15 years ago
|
void setCategories( const TQStringList &categories );
|
||
|
TQStringList categories() const;
|
||
15 years ago
|
|
||
|
void setUseCategories( bool useCategories );
|
||
|
bool useCategories() const;
|
||
|
|
||
|
bool isSaving();
|
||
|
|
||
12 years ago
|
TDEABC::Lock *lock();
|
||
15 years ago
|
|
||
|
/** Add Event to calendar. */
|
||
15 years ago
|
KDE_DEPRECATED bool addEvent(Event *event);
|
||
|
bool addEvent( Event *event, const TQString &subresource );
|
||
15 years ago
|
/** deletes an event from this calendar. */
|
||
|
bool deleteEvent(Event *);
|
||
|
|
||
|
/**
|
||
|
Retrieves an event on the basis of the unique string ID.
|
||
|
*/
|
||
15 years ago
|
Event *event(const TQString &UniqueStr);
|
||
15 years ago
|
/**
|
||
|
Return unfiltered list of all events in calendar.
|
||
|
*/
|
||
|
Event::List rawEvents( EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
|
||
|
/**
|
||
|
Builds and then returns a list of all events that match for the
|
||
|
date specified. useful for dayView, etc. etc.
|
||
|
*/
|
||
15 years ago
|
Event::List rawEventsForDate( const TQDate &date, EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
|
||
15 years ago
|
/**
|
||
|
Get unfiltered events for date \a qdt.
|
||
|
*/
|
||
15 years ago
|
Event::List rawEventsForDate( const TQDateTime &qdt );
|
||
15 years ago
|
/**
|
||
|
Get unfiltered events in a range of dates. If inclusive is set to true,
|
||
|
only events are returned, which are completely included in the range.
|
||
|
*/
|
||
15 years ago
|
Event::List rawEvents( const TQDate &start, const TQDate &end,
|
||
15 years ago
|
bool inclusive = false );
|
||
|
|
||
|
/**
|
||
|
Add a todo to the todolist.
|
||
|
*/
|
||
15 years ago
|
KDE_DEPRECATED bool addTodo( Todo *todo );
|
||
|
bool addTodo( Todo *todo, const TQString &subresource );
|
||
15 years ago
|
/**
|
||
|
Remove a todo from the todolist.
|
||
|
*/
|
||
|
bool deleteTodo( Todo * );
|
||
|
/**
|
||
|
Searches todolist for an event with this unique string identifier,
|
||
|
returns a pointer or null.
|
||
|
*/
|
||
15 years ago
|
Todo *todo( const TQString &uid );
|
||
15 years ago
|
/**
|
||
|
Return list of all todos.
|
||
|
*/
|
||
|
Todo::List rawTodos( TodoSortField sortField = TodoSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
|
||
|
/**
|
||
|
Returns list of todos due on the specified date.
|
||
|
*/
|
||
15 years ago
|
Todo::List rawTodosForDate( const TQDate &date );
|
||
15 years ago
|
/** Add a Journal entry to calendar */
|
||
15 years ago
|
KDE_DEPRECATED bool addJournal( Journal *journal );
|
||
|
bool addJournal( Journal *journal, const TQString &subresource );
|
||
|
|
||
15 years ago
|
/** Remove journal from the calendar. */
|
||
|
bool deleteJournal( Journal * );
|
||
|
/** Return Journal with given UID */
|
||
15 years ago
|
virtual Journal *journal(const TQString &uid);
|
||
15 years ago
|
/**
|
||
|
Return list of all journals.
|
||
|
*/
|
||
|
Journal::List rawJournals( JournalSortField sortField = JournalSortUnsorted, SortDirection sortDirection = SortDirectionAscending );
|
||
|
/**
|
||
|
Returns list of journals for the given date.
|
||
|
*/
|
||
15 years ago
|
Journal::List rawJournalsForDate( const TQDate &date );
|
||
15 years ago
|
|
||
|
/** Return all alarms, which ocur in the given time interval. */
|
||
15 years ago
|
Alarm::List alarms( const TQDateTime &from, const TQDateTime &to );
|
||
15 years ago
|
|
||
|
/** Return all alarms, which ocur before given date. */
|
||
15 years ago
|
Alarm::List alarmsTo( const TQDateTime &to );
|
||
15 years ago
|
|
||
|
void dump() const;
|
||
|
|
||
15 years ago
|
void setTimeZoneId( const TQString &timeZoneId );
|
||
15 years ago
|
|
||
|
protected:
|
||
|
bool doOpen();
|
||
|
bool doLoad();
|
||
|
bool doSave();
|
||
|
|
||
|
private slots:
|
||
|
void reload();
|
||
|
|
||
|
private:
|
||
|
void init();
|
||
|
|
||
|
CalendarLocal mCalendar;
|
||
|
|
||
|
int mAlarmDays;
|
||
|
bool mAlarm;
|
||
15 years ago
|
TQStringList mCategories;
|
||
15 years ago
|
bool mUseCategories;
|
||
12 years ago
|
TDEABC::AddressBook *mAddressbook;
|
||
15 years ago
|
|
||
12 years ago
|
TDEABC::Lock *mLock;
|
||
15 years ago
|
|
||
|
class Private;
|
||
|
Private *d;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|