korganizer

kojournaleditor.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 1997, 1998 Preston Brown <pbrown@kde.org>
00005     Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
00006     Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021 
00022     As a special exception, permission is given to link this program
00023     with any edition of Qt, and distribute the resulting executable,
00024     without including the source code for Qt in the source distribution.
00025 */
00026 #ifndef KOJOURNALEDITOR_H
00027 #define KOJOURNALEDITOR_H
00028 
00029 #include "koincidenceeditor.h"
00030 
00031 #include <qdatetime.h>
00032 
00033 class QDateTime;
00034 namespace KCal {
00035 class Calendar;
00036 class Journal;
00037 class Incidence;
00038 }
00039 using namespace KCal;
00040 
00041 class KOEditorGeneralJournal;
00042 
00046 class KOJournalEditor : public KOIncidenceEditor
00047 {
00048     Q_OBJECT
00049   public:
00053     KOJournalEditor( Calendar *calendar, QWidget *parent );
00054     virtual ~KOJournalEditor();
00055 
00056     void init();
00057 
00058     void reload();
00059 
00063     void newJournal( const QDate &date );
00064     void newJournal( const QString &text, const QDate &date );
00065 
00069     void newJournal( const QString &text );
00073     //TODO:
00074     // void newJournal( const QString &summary, const QString &description,
00075     //               const QString &attachment );
00076 
00078     void editIncidence(Incidence *);
00079 
00081     void setDefaults( const QDate &date );
00083     void readJournal( Journal * );
00085     void writeJournal( Journal * );
00086 
00087     int msgItemDelete();
00089     bool validateInput();
00092     bool processInput();
00093 
00095     void modified (int change=0);
00096 
00097   protected slots:
00098     void loadDefaults();
00099     void deleteJournal();
00100 
00101     void slotSaveTemplate( const QString & );
00102 
00103   protected:
00104     QString type() { return "Journal"; }
00105     void setupGeneral();
00106 //    int msgItemDelete();
00107 
00108     void loadTemplate( /*const*/ CalendarLocal& );
00109     QStringList& templates() const;
00110   private:
00111     Journal *mJournal;
00112     KOEditorGeneralJournal *mGeneral;
00113 };
00114 
00115 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys