korganizer

kojournalview.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00004     Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 #ifndef KOJOURNALVIEW_H
00025 #define KOJOURNALVIEW_H
00026 
00027 #include <korganizer/baseview.h>
00028 
00029 class JournalDateEntry;
00030 class JournalEntry;
00031 class TQScrollView;
00032 class TQVBox;
00033 
00041 class KOJournalView : public KOrg::BaseView
00042 {
00043     Q_OBJECT
00044   TQ_OBJECT
00045   public:
00046     KOJournalView( Calendar *calendar, TQWidget *parent = 0,
00047                    const char *name = 0);
00048     ~KOJournalView();
00049 
00050     virtual int currentDateCount();
00051     virtual Incidence::List selectedIncidences();
00052     DateList selectedIncidenceDates() { return DateList(); }
00053     void appendJournal( Journal*journal, const TQDate &dt);
00054 
00055     CalPrinterBase::PrintType printType();
00056 
00057   public slots:
00058     // Don't update the view when midnight passed, otherwise we'll have data loss (bug 79145)
00059     virtual void dayPassed( const TQDate & ) {}
00060     void updateView();
00061     void flushView();
00062 
00063     void showDates( const TQDate &start, const TQDate &end );
00064     void showIncidences( const Incidence::List &incidenceList, const TQDate &date );
00065 
00066     void changeIncidenceDisplay( Incidence *, int );
00067     void setIncidenceChanger( IncidenceChangerBase *changer );
00068     void newJournal();
00069   signals:
00070     void flushEntries();
00071     void setIncidenceChangerSignal( IncidenceChangerBase * );
00072     void journalEdited( Journal* );
00073     void journalDeleted( Journal* );
00074 
00075   protected:
00076     void clearEntries();
00077 
00078   private:
00079     TQScrollView *mSV;
00080     TQVBox *mVBox;
00081     TQMap<TQDate, JournalDateEntry*> mEntries;
00082 //    DateList mSelectedDates;  // List of dates to be displayed
00083 };
00084 
00085 #endif