korganizer

koeventpopupmenu.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2000,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 Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 #ifndef KOEVENTPOPUPMENU_H
00025 #define KOEVENTPOPUPMENU_H
00026 //
00027 // Context menu for event views with standard event actions
00028 //
00029 
00030 #include <qpopupmenu.h>
00031 #include <qdatetime.h>
00032 
00033 namespace KCal {
00034 class Calendar;
00035 class Incidence;
00036 }
00037 using namespace KCal;
00038 
00039 class KOEventPopupMenu : public QPopupMenu {
00040     Q_OBJECT
00041   public:
00042     KOEventPopupMenu();
00043 
00044     void addAdditionalItem(const QIconSet &icon,const QString &text,
00045                            const QObject *receiver, const char *member,
00046                            bool editOnly=false);
00047 
00048 
00049   public slots:
00050     void showIncidencePopup( Calendar *, Incidence *, const QDate & );
00051 
00052   protected slots:
00053     void popupShow();
00054     void popupEdit();
00055     void popupPaste();
00056     void print();
00057     void popupDelete();
00058     void popupCut();
00059     void popupCopy();
00060     void popupAlarm();
00061     void dissociateOccurrence();
00062     void dissociateFutureOccurrence();
00063     void forward();
00064 
00065   signals:
00066     void editIncidenceSignal(Incidence *);
00067     void showIncidenceSignal(Incidence *);
00068     void deleteIncidenceSignal(Incidence *);
00069     void cutIncidenceSignal(Incidence *);
00070     void copyIncidenceSignal(Incidence *);
00071     void pasteIncidenceSignal();
00072     void toggleAlarmSignal(Incidence *);
00073     void dissociateOccurrenceSignal( Incidence *, const QDate & );
00074     void dissociateFutureOccurrenceSignal( Incidence *, const QDate & );
00075 
00076   private:
00077     Calendar *mCalendar;
00078     Incidence *mCurrentIncidence;
00079     QDate mCurrentDate;
00080 
00081     bool mHasAdditionalItems;
00082     QValueList<int> mEditOnlyItems;
00083     QValueList<int> mRecurrenceItems;
00084 };
00085 
00086 #endif