korganizer

eventarchiver.h
00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
00004     Copyright (c) 2004 David Faure <faure@kde.org>
00005     Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of TQt, and distribute the resulting executable,
00023     without including the source code for TQt in the source distribution.
00024 */
00025 #ifndef EVENTARCHIVER_H
00026 #define EVENTARCHIVER_H
00027 
00028 #include <tqobject.h>
00029 #include <tqdatetime.h>
00030 #include <libkcal/event.h>
00031 
00032 namespace KCal {
00033 class Calendar;
00034 class Event;
00035 }
00036 using namespace KCal;
00037 
00047 class EventArchiver : public TQObject
00048 {
00049     Q_OBJECT
00050   TQ_OBJECT
00051 
00052   public:
00053     EventArchiver( TQObject* parent = 0, const char* name = 0 );
00054     virtual ~EventArchiver();
00055 
00063     void runOnce( Calendar* calendar, const TQDate& limitDate, TQWidget* widget  );
00064 
00073     void runAuto( Calendar* calendar, TQWidget* widget, bool withGUI );
00074 
00075   signals:
00076     void eventsDeleted();
00077 
00078   private:
00079     void run( Calendar* calendar, const TQDate& limitDate, TQWidget* widget, bool withGUI, bool errorIfNone );
00080 
00081     void deleteIncidences( Calendar* calendar, const TQDate& limitDate, TQWidget* widget,
00082                            const Incidence::List& incidences, bool withGUI );
00083     void archiveIncidences( Calendar* calendar, const TQDate& limitDate, TQWidget* widget,
00084                            const Incidence::List& incidences, bool withGUI );
00085 
00093     bool isSubTreeComplete( const Todo *todo, const TQDate &limitDate,
00094                             TQStringList checkedUids = TQStringList() ) const;
00095 };
00096 
00097 #endif /* EVENTARCHIVER_H */