Add another crash guard, should cover Andy's LDAP crashes.
[kdepim.git] / korganizer / koeventpopupmenu.h
blob99752fef80486a117a0238bd604dd960866ddcb0
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
26 #ifndef KOEVENTPOPUPMENU_H
27 #define KOEVENTPOPUPMENU_H
29 #include <QDate>
30 #include <QMenu>
32 #include <Akonadi/Item>
34 namespace CalendarSupport {
35 class Calendar;
38 /**
39 * Context menu for event views with standard event actions.
41 class KOEventPopupMenu : public QMenu
43 Q_OBJECT
44 public:
45 explicit KOEventPopupMenu( CalendarSupport::Calendar *, QWidget *parent = 0 );
46 void setCalendar( CalendarSupport::Calendar * );
48 public slots:
49 void showIncidencePopup( const Akonadi::Item &, const QDate & );
51 protected slots:
52 void popupShow();
53 void popupEdit();
54 void popupPaste();
55 void print();
56 void printPreview();
57 void popupDelete();
58 void popupCut();
59 void popupCopy();
60 void toggleAlarm();
61 void toggleTodoCompleted();
62 void dissociateOccurrences();
63 void forward();
65 signals:
66 void configChanged();
67 void editIncidenceSignal( const Akonadi::Item & );
68 void showIncidenceSignal( const Akonadi::Item & );
69 void deleteIncidenceSignal( const Akonadi::Item & );
70 void cutIncidenceSignal( const Akonadi::Item & );
71 void copyIncidenceSignal( const Akonadi::Item & );
72 void pasteIncidenceSignal();
73 void toggleAlarmSignal( const Akonadi::Item & );
74 void toggleTodoCompletedSignal( const Akonadi::Item & );
75 void copyIncidenceToResourceSignal( const Akonadi::Item &, const QString & );
76 void moveIncidenceToResourceSignal( const Akonadi::Item &, const QString & );
77 void dissociateOccurrencesSignal( const Akonadi::Item &, const QDate & );
79 private:
80 void print( bool previous );
82 CalendarSupport::Calendar *mCalendar;
83 Akonadi::Item mCurrentIncidence;
84 QDate mCurrentDate;
86 bool mHasAdditionalItems;
87 QList<QAction *> mEditOnlyItems;
88 QList<QAction *> mTodoOnlyItems;
89 QList<QAction *> mRecurrenceItems;
90 QAction *mDissociateOccurrences;
91 QAction *mToggleReminder;
94 #endif