diff --git a/kcal/calendarnull.h b/kcal/calendarnull.h index aa82be28d..93bebe2b1 100644 --- a/kcal/calendarnull.h +++ b/kcal/calendarnull.h @@ -1,81 +1,82 @@ /* This file is part of libkcal. Copyright (c) 2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_CALENDARNULL_H #define KCAL_CALENDARNULL_H #include "calendar.h" +#include "libkcal_export.h" class KConfig; namespace KCal { /** This is a null calendar object which does nothing. It can be passed to functions which need a calendar object when there actually isn't a real calendar yet. CalendarNull can be used to implement the null object design pattern. Instead of passing a 0 pointer and checking for 0 with each access a CalendarNull object can be passed. */ -class CalendarNull : public Calendar +class LIBKCAL_EXPORT CalendarNull : public Calendar { public: CalendarNull() {} ~CalendarNull() {} static CalendarNull *self(); void incidenceUpdated( IncidenceBase * ) {} void close() {} void save() {} bool addEvent( Event * ) { return false; } void deleteEvent( Event * ) {} Event *event( const QString & ) { return 0; } Event::List rawEvents( EventSortField, SortDirection ) { return Event::List(); } Event::List rawEvents( const QDate &, const QDate &, bool ) { return Event::List(); } Event::List rawEventsForDate( const QDateTime & ) { return Event::List(); } Event::List rawEventsForDate( const QDate &, bool ) { return Event::List(); } bool addTodo( Todo * ) { return false; } void deleteTodo( Todo * ) {} Todo *todo( const QString & ) { return 0; } Todo::List rawTodos( TodoSortField, SortDirection ) { return Todo::List(); } Todo::List rawTodosForDate( const QDate & ) { return Todo::List(); } bool addJournal( Journal * ) { return false; } void deleteJournal( Journal * ) {} Journal *journal( const QString & ) { return 0; } Journal::List rawJournals( JournalSortField, SortDirection ) { return Journal::List(); } Journal::List rawJournalsForDate( const QDate & ) { return Journal::List(); } Alarm::List alarms( const QDateTime &, const QDateTime & ) { return Alarm::List(); } private: static CalendarNull *mSelf; class Private; Private *d; }; } #endif diff --git a/kcal/calfilter.h b/kcal/calfilter.h index ab4534505..173d35857 100644 --- a/kcal/calfilter.h +++ b/kcal/calfilter.h @@ -1,142 +1,143 @@ /* This file is part of libkcal. Copyright (c) 2001,2003,2004 Cornelius Schumacher Copyright (C) 2003-2004 Reinhold Kainhofer 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_CALFILTER_H #define KCAL_CALFILTER_H #include #include #include "event.h" #include "todo.h" #include "journal.h" +#include "libkcal_export.h" namespace KCal { /** Filter for calendar objects. */ -class CalFilter +class LIBKCAL_EXPORT CalFilter { public: /** Construct filter. */ CalFilter(); /** Construct filter with name */ CalFilter( const QString &name ); /** Destruct filter. */ ~CalFilter(); /** Set name of filter. */ void setName( const QString &name ) { mName = name; } /** Return name of filter. */ QString name() const { return mName; } /** Apply filter to eventlist, all events not matching filter criterias are removed from the list. */ void apply( Event::List *eventlist ) const; /** Apply filter to todolist, all todos not matching filter criterias are removed from the list. */ void apply( Todo::List *todolist ) const; /** Apply filter to todolist, all todos not matching filter criterias are removed from the list. */ void apply( Journal::List *journallist) const; /** Apply filter criteria on the specified incidence. Return true, if event passes criteria, otherwise return false. */ bool filterIncidence( Incidence * ) const; /** Enable or disable filter. */ void setEnabled( bool ); /** Return wheter the filter is enabled or not. */ bool isEnabled() const; /** Set list of categories, which is used for showing/hiding categories of events. See related functions. */ void setCategoryList( const QStringList & ); /** Return category list, used for showing/hiding categories of events. See related functions. */ QStringList categoryList() const; enum { HideRecurring = 1, HideCompleted = 2, ShowCategories = 4, HideInactiveTodos = 8 }; /** Set criteria, which have to be fulfilled by events passing the filter. */ void setCriteria( int ); /** Get inclusive filter criteria. */ int criteria() const; /** Set the number of days for "Hide completed todos", after which todos are not shown any more. If nothing is set explicitly, all finished todos will be hidden if the "hide completed todos" option is selected. */ void setCompletedTimeSpan( int timespan ); /** Return the number of days for "Hide completed todos", after which todos are not shown any more. */ int completedTimeSpan() const; private: QString mName; int mCriteria; bool mEnabled; QStringList mCategoryList; int mCompletedTimeSpan; class Private; Private *d; }; } #endif diff --git a/kcal/dndfactory.h b/kcal/dndfactory.h index 6a99744a1..bc36bcb35 100644 --- a/kcal/dndfactory.h +++ b/kcal/dndfactory.h @@ -1,71 +1,73 @@ /* This file is part of libkcal. Copyright (c) 1998 Preston Brown Copyright (c) 2001,2002,2003 Cornelius Schumacher Copyright (C) 2003-2004 Reinhold Kainhofer 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_DNDFACTORY_H #define KCAL_DNDFACTORY_H +#include "libkcal_export.h" + namespace KCal { class ICalDrag; class Event; class Todo; class Calendar; /** This class implements functions to create Drag and Drop objects used for Drag-and-Drop and Copy-and-Paste. @short vCalendar/iCalendar Drag-and-Drop object factory. */ -class DndFactory +class LIBKCAL_EXPORT DndFactory { public: DndFactory( Calendar * ); /** Create a drag object. */ ICalDrag *createDrag( Incidence *incidence, QWidget *owner ); /** Create Todo object from drop event */ Todo *createDropTodo(QDropEvent *de); /** Create Event object from drop event */ Event *createDrop(QDropEvent *de); /** cut incidence to clipboard */ void cutIncidence( Incidence * ); /** copy the incidence to clipboard */ bool copyIncidence( Incidence * ); /** pastes the event or todo and returns a pointer to the new incidence pasted. */ Incidence *pasteIncidence( const QDate &, const QTime *newTime = 0 ); private: Calendar *mCalendar; class Private; Private *d; }; } #endif diff --git a/kcal/icaldrag.h b/kcal/icaldrag.h index a2d095077..be3e8b884 100644 --- a/kcal/icaldrag.h +++ b/kcal/icaldrag.h @@ -1,59 +1,60 @@ /* This file is part of libkcal. Copyright (c) 1998 Preston Brown Copyright (c) 2001-2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_ICALDRAG_H #define KCAL_ICALDRAG_H #include #include "calendar.h" +#include "libkcal_export.h" namespace KCal { /** iCalendar drag&drop class. */ -class ICalDrag : public QStoredDrag +class LIBKCAL_EXPORT ICalDrag : public QStoredDrag { public: /** Create a drag&drop object for iCalendar component \a ical. */ ICalDrag( Calendar *cal, QWidget *parent = 0, const char *name = 0 ); ~ICalDrag() {}; /** Return, if drag&drop object can be decode to iCalendar. */ static bool canDecode( QMimeSource * ); /** Decode drag&drop object to iCalendar component \a cal. */ static bool decode( QMimeSource *e, Calendar *cal ); private: class Private; Private *d; }; } #endif diff --git a/kcal/imipscheduler.h b/kcal/imipscheduler.h index 87d70a421..125545881 100644 --- a/kcal/imipscheduler.h +++ b/kcal/imipscheduler.h @@ -1,54 +1,55 @@ /* This file is part of libkcal. Copyright (c) 2001-2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_IMIPSCHEDULER_H #define KCAL_IMIPSCHEDULER_H #include +#include "libkcal_export.h" #include "scheduler.h" namespace KCal { /* \internal This class implements the iTIP interface using the email interface specified as iMIP. */ -class IMIPScheduler : public Scheduler +class KDE_EXPORT IMIPScheduler : public Scheduler { public: IMIPScheduler( Calendar * ); virtual ~IMIPScheduler(); bool publish (IncidenceBase *incidence,const QString &recipients); bool performTransaction(IncidenceBase *incidence,Method method); QPtrList retrieveTransactions(); private: class Private; Private *d; }; } #endif diff --git a/kcal/period.h b/kcal/period.h index 84ba7d3f3..9d7651137 100644 --- a/kcal/period.h +++ b/kcal/period.h @@ -1,59 +1,60 @@ /* This file is part of libkcal. Copyright (c) 2001-2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_PERIOD_H #define KCAL_PERIOD_H #include +#include "libkcal_export.h" #include "duration.h" namespace KCal { /** This class represents a period of time. The period can be defined by either a start time and an end time or by a start time and a duration. */ -class Period +class KDE_EXPORT Period { public: Period(); Period( const QDateTime &start, const QDateTime &end ); Period( const QDateTime &start, const Duration &duration ); QDateTime start() const; QDateTime end() const; Duration duration(); bool hasDuration()const; private: QDateTime mStart; QDateTime mEnd; bool mHasDuration; class Private; Private *d; }; } #endif diff --git a/kcal/qtopiaformat.h b/kcal/qtopiaformat.h index 0fc7fe331..d2ee7203f 100644 --- a/kcal/qtopiaformat.h +++ b/kcal/qtopiaformat.h @@ -1,54 +1,55 @@ /* This file is part of libkcal. Copyright (c) 2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_QTOPIAFORMAT_H #define KCAL_QTOPIAFORMAT_H #include #include "scheduler.h" +#include "libkcal_export.h" #include "calformat.h" namespace KCal { /** This class implements the calendar format used by Qtopia. */ -class QtopiaFormat : public CalFormat +class LIBKCAL_EXPORT QtopiaFormat : public CalFormat { public: QtopiaFormat(); virtual ~QtopiaFormat(); bool load( Calendar *, const QString &fileName ); bool save( Calendar *, const QString &fileName ); bool fromString( Calendar *, const QString & ); QString toString( Calendar * ); private: class Private; Private *d; }; } #endif diff --git a/kcal/scheduler.h b/kcal/scheduler.h index 93bc064f4..9dac0dcd6 100644 --- a/kcal/scheduler.h +++ b/kcal/scheduler.h @@ -1,191 +1,193 @@ /* This file is part of libkcal. Copyright (c) 2001-2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_SCHEDULER_H #define KCAL_SCHEDULER_H #include #include +#include "libkcal_export.h" + namespace KCal { class IncidenceBase; class Event; class Calendar; class ICalFormat; class FreeBusyCache; /** This class provides an encapsulation of a scheduling message. It associates an incidence with a method and status information. This class is used by the Scheduler class. @short A Scheduling message */ class ScheduleMessage { public: /** Message status. */ enum Status { PublishNew, PublishUpdate, Obsolete, RequestNew, RequestUpdate, Unknown }; /** Create a scheduling message with method as defined in Scheduler::Method and a status. */ ScheduleMessage( IncidenceBase *, int method, Status status ); ~ScheduleMessage() {}; /** Return event associated with this message. */ IncidenceBase *event() { return mIncidence; } /** Return iTIP method associated with this message. */ int method() { return mMethod; } /** Return status of this message. */ Status status() { return mStatus; } /** Return error message if there is any. */ QString error() { return mError; } /** Return a human-readable name for an iTIP message status. */ static QString statusName( Status status ); private: IncidenceBase *mIncidence; int mMethod; Status mStatus; QString mError; class Private; Private *d; }; /** This class provides an encapsulation of iTIP transactions. It is an abstract base class for inheritance by implementations of the iTIP scheme like iMIP or iRIP. */ -class Scheduler +class LIBKCAL_EXPORT Scheduler { public: /** iTIP methods. */ enum Method { Publish,Request,Refresh,Cancel,Add,Reply,Counter, Declinecounter,NoMethod }; /** Create scheduler for calendar specified as argument. */ Scheduler( Calendar *calendar ); virtual ~Scheduler(); /** iTIP publish action */ virtual bool publish( IncidenceBase *incidence, const QString &recipients ) = 0; /** Perform iTIP transaction on incidence. The method is specified as the method argument and can be any valid iTIP method. */ virtual bool performTransaction( IncidenceBase *incidence, Method method ) = 0; /** Perform iTIP transaction on incidence to specified recipient(s). The method is specified as the method argumanet and can be any valid iTIP method. */ virtual bool performTransaction( IncidenceBase *incidence, Method method, const QString &recipients ) = 0; /** Retrieve incoming iTIP transactions. */ virtual QPtrList retrieveTransactions() = 0; /** Accept transaction. The incidence argument specifies the iCal compoennt on which the transaction acts. The status is the result of processing a iTIP message with the current calendar and specifies the action to be taken for this incidence. */ bool acceptTransaction( IncidenceBase *, Method method, ScheduleMessage::Status status ); /** Return a machine-readable name for a iTIP method. */ static QString methodName( Method ); /** Return a translated human-readable name for a iTIP method. */ static QString translatedMethodName( Method ); virtual bool deleteTransaction( IncidenceBase *incidence ); /** Returns the directory where the free-busy information is stored. */ virtual QString freeBusyDir() = 0; /** Set free/busy cache used to store free/busy information. */ void setFreeBusyCache( FreeBusyCache * ); /** Return free/busy cache. */ FreeBusyCache *freeBusyCache() const; protected: bool acceptPublish( IncidenceBase *, ScheduleMessage::Status status, Method method ); bool acceptRequest( IncidenceBase *, ScheduleMessage::Status status ); bool acceptAdd( IncidenceBase *, ScheduleMessage::Status status ); bool acceptCancel( IncidenceBase *, ScheduleMessage::Status status ); bool acceptDeclineCounter( IncidenceBase *, ScheduleMessage::Status status ); bool acceptReply( IncidenceBase *, ScheduleMessage::Status status, Method method ); bool acceptRefresh( IncidenceBase *, ScheduleMessage::Status status ); bool acceptCounter( IncidenceBase *, ScheduleMessage::Status status ); bool acceptFreeBusy( IncidenceBase *, Method method ); Calendar *mCalendar; ICalFormat *mFormat; private: class Private; Private *d; }; } #endif diff --git a/kcal/vcaldrag.h b/kcal/vcaldrag.h index c16c35e1f..4388b6db2 100644 --- a/kcal/vcaldrag.h +++ b/kcal/vcaldrag.h @@ -1,59 +1,60 @@ /* This file is part of libkcal. Copyright (c) 1998 Preston Brown Copyright (c) 2001-2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_VCALDRAG_H #define KCAL_VCALDRAG_H #include +#include "libkcal_export.h" namespace KCal { class Calendar; /** vCalendar drag&drop class. */ -class VCalDrag : public QStoredDrag +class KDE_EXPORT VCalDrag : public QStoredDrag { public: /** Create a drag&drop object for vCalendar component \a vcal. */ VCalDrag( Calendar *vcal, QWidget *parent = 0, const char *name = 0 ); ~VCalDrag() {} /** Return, if drag&drop object can be decode to vCalendar. */ static bool canDecode( QMimeSource * ); /** Decode drag&drop object to vCalendar component \a vcal. */ static bool decode( QMimeSource *e, Calendar *cal ); private: class Private; Private *d; }; } #endif diff --git a/kcal/vcalformat.h b/kcal/vcalformat.h index a7bb2c0c4..cb2fd203f 100644 --- a/kcal/vcalformat.h +++ b/kcal/vcalformat.h @@ -1,120 +1,121 @@ /* This file is part of libkcal. Copyright (c) 1998 Preston Brown Copyright (c) 2001-2003 Cornelius Schumacher 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef KCAL_VCALFORMAT_H #define KCAL_VCALFORMAT_H #include "calformat.h" #include "todo.h" #include "event.h" +#include "libkcal_export.h" #define _VCAL_VERSION "1.0" class VObject; namespace KCal { /** This class implements the vCalendar format. It provides methods for loading/saving/converting vCalendar format data into the internal KOrganizer representation as Calendar and Events. @short vCalendar format implementation */ -class VCalFormat : public CalFormat +class LIBKCAL_EXPORT VCalFormat : public CalFormat { public: VCalFormat(); virtual ~VCalFormat(); /** Loads a calendar on disk in vCalendar format into the given calendar. @param calendar Calendar object the loaded data is stored into. @param fileName Name of the vCalendar file on disk. @return true on success, otherwise false */ bool load( Calendar *calendar, const QString &fileName ); /** Writes out the given calendar to disk in vCalendar format. @param calendar Calendar object holding data to be written @param fileName the name of the file @return true on success, otherwise false */ bool save(Calendar *calendar, const QString &fileName); /** Parse string and populate calendar with that information. */ bool fromString( Calendar *, const QString & ); /** Return calendar information as string. */ QString toString( Calendar * ); protected: /** translates a VObject of the TODO type into a Event */ Todo *VTodoToEvent(VObject *vtodo); /** translates a VObject into a Event and returns a pointer to it. */ Event *VEventToEvent(VObject *vevent); /** translate a Event into a VTodo-type VObject and return pointer */ VObject *eventToVTodo(const Todo *anEvent); /** translate a Event into a VObject and returns a pointer to it. */ VObject* eventToVEvent(const Event *anEvent); /** takes a QDate and returns a string in the format YYYYMMDDTHHMMSS */ QString qDateToISO(const QDate &); /** takes a QDateTime and returns a string in format YYYYMMDDTHHMMSS */ QString qDateTimeToISO(const QDateTime &, bool zulu=TRUE); /** takes a string in the format YYYYMMDDTHHMMSS and returns a * valid QDateTime. */ QDateTime ISOToQDateTime(const QString & dtStr); /** takes a string in the format YYYYMMDD and returns a * valid QDate. */ QDate ISOToQDate(const QString & dtStr); /** takes a vCalendar tree of VObjects, and puts all of them that have * the "event" property into the dictionary, todos in the todo-list, etc. */ void populate(VObject *vcal); /** takes a number 0 - 6 and returns the two letter string of that day, * i.e. MO, TU, WE, etc. */ const char *dayFromNum(int day); /** the reverse of the above function. */ int numFromDay(const QString &day); Attendee::PartStat readStatus(const char *s) const; QCString writeStatus(Attendee::PartStat status) const; private: Calendar *mCalendar; Event::List mEventsRelate; // events with relations Todo::List mTodosRelate; // todos with relations class Private; Private *d; }; } #endif