kalarm Library API Documentation

alarmcalendar.h

00001 /*
00002  *  alarmcalendar.h  -  KAlarm calendar file access
00003  *  Program:  kalarm
00004  *  (C) 2001, 2002 by David Jarvie  software@astrojar.org.uk
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef ALARMCALENDAR_H
00022 #define ALARMCALENDAR_H
00023 
00024 #include <libkcal/calendarlocal.h>
00025 #include "msgevent.h"
00026 using namespace KCal;
00027 
00028 
00029 class AlarmCalendar
00030 {
00031         public:
00032                 AlarmCalendar() : mCalendar(0L), mKAlarmVersion(-1), mKAlarmVersion057_UTC(false) { }
00033                 bool            open();
00034                 int             load();
00035                 int             reload();
00036                 bool            save()                              { return save(mLocalFile); }
00037                 void            close();
00038                 Event*          event(const QString& uniqueID)      { return mCalendar->event(uniqueID); }
00039                 QPtrList<Event> events()                            { return mCalendar->events(); }
00040                 void            addEvent(const KAlarmEvent&);
00041                 void            updateEvent(const KAlarmEvent&);
00042                 void            deleteEvent(const QString& eventID);
00043                 bool            isOpen() const                      { return !!mCalendar; }
00044                 void            getURL() const;
00045                 const QString   urlString() const                   { getURL();  return mUrl.url(); }
00046                 int             KAlarmVersion() const               { return mKAlarmVersion; }
00047                 bool            KAlarmVersion057_UTC() const        { return mKAlarmVersion057_UTC; }
00048                 static int      KAlarmVersion(int major, int minor, int rev)  { return major*10000 + minor*100 + rev; }
00049         private:
00050                 CalendarLocal*  mCalendar;
00051                 KURL            mUrl;           // URL of calendar file
00052                 QString         mLocalFile;     // local name of calendar file
00053                 mutable int     mKAlarmVersion; // version of KAlarm which created the loaded calendar file
00054                 mutable bool    mKAlarmVersion057_UTC;  // calendar file was created by KDE 3.0.0 KAlarm 0.5.7
00055                 bool            mVCal;          // true if calendar file is in VCal format
00056 
00057                 bool            create();
00058                 bool            save(const QString& tempFile);
00059                 void            getKAlarmVersion() const;
00060                 bool            isUTC() const;
00061 };
00062 
00063 #endif // ALARMCALENDAR_H
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:26 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001