korganizer

incidencechangerbase.h

00001 /*
00002     This file is part of the KOrganizer interfaces.
00003 
00004     Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library 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 GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef KORG_INCIDENCECHANGERBASE_H
00022 #define KORG_INCIDENCECHANGERBASE_H
00023 
00024 #include "korganizer/koglobals.h"
00025 #include <libkcal/scheduler.h>
00026 #include <libkcal/incidence.h>
00027 #include <tqobject.h>
00028 
00029 class TQWidget;
00030 namespace KCal {
00031   class Calendar;
00032   class Incidence;
00033   class ResourceCalendar;
00034 }
00035 using namespace KCal;
00036 
00037 namespace KOrg {
00038 
00039 class IncidenceChangerBase : public TQObject
00040 {
00041 Q_OBJECT
00042   
00043 public:
00044   IncidenceChangerBase( Calendar*cal, TQObject *parent = 0 ) :
00045         TQObject( parent ), mCalendar( cal ) {}
00046   virtual ~IncidenceChangerBase() {}
00047 
00048   virtual bool sendGroupwareMessage( Incidence *incidence,
00049                                      KCal::Scheduler::Method method,
00050                                      KOGlobals::HowChanged action,
00051                                      TQWidget *parent ) = 0;
00052 
00053   virtual bool beginChange( Incidence *incidence,
00054                             ResourceCalendar *res, const TQString &subRes ) = 0;
00055   virtual bool endChange( Incidence *incidence,
00056                           ResourceCalendar *res, const TQString &subRes ) = 0;
00057 
00058   virtual bool addIncidence( Incidence *incidence,
00059                              ResourceCalendar *res, const TQString &subRes,
00060                              TQWidget *parent ) = 0;
00061   virtual bool addIncidence( Incidence *incidence,
00062                              ResourceCalendar *res, const TQString &subRes,
00063                              TQWidget *parent, int dontAskForGroupware) = 0;
00064 
00065   virtual bool changeIncidence( Incidence *oldinc, Incidence *newinc,
00066                                 KOGlobals::WhatChanged, TQWidget *parent ) = 0;
00067   virtual bool changeIncidence( Incidence *oldinc, Incidence *newinc,
00068                                 KOGlobals::WhatChanged, TQWidget *parent, int dontAskForGroupware ) = 0;
00069 
00070   virtual bool deleteIncidence( Incidence *incidence, TQWidget *parent ) = 0;
00071 
00072   virtual bool cutIncidences( const Incidence::List &incidences, TQWidget *parent ) = 0;
00073   virtual bool cutIncidence( Incidence *incidence, TQWidget *parent ) = 0;
00074 
00075 signals:
00076   void incidenceAdded( Incidence * );
00077   void incidenceChanged( Incidence *oldInc, Incidence *newInc, KOGlobals::WhatChanged );
00078   void incidenceToBeDeleted( Incidence * );
00079   void incidenceDeleted( Incidence * );
00080 
00081   void schedule( Scheduler::Method method, Incidence *incidence );
00082 protected:
00083   Calendar *mCalendar;
00084 };
00085 
00086 
00087 
00088 
00089 }
00090 
00091 #endif