summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventview.h
Unidiff
Diffstat (limited to 'korganizer/koeventview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventview.h172
1 files changed, 172 insertions, 0 deletions
diff --git a/korganizer/koeventview.h b/korganizer/koeventview.h
new file mode 100644
index 0000000..77ec111
--- a/dev/null
+++ b/korganizer/koeventview.h
@@ -0,0 +1,172 @@
1/*
2 This file is part of KOrganizer.
3 Copyright (c) 1999 Preston Brown <pbrown@kde.org>
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
23*/
24#ifndef _KOEVENTVIEW_H
25#define _KOEVENTVIEW_H
26
27#include <libkcal/calendar.h>
28#include <libkcal/event.h>
29
30#include <korganizer/baseview.h>
31
32#include "koeventpopupmenu.h"
33
34using namespace KCal;
35
36class CalPrinter;
37
38/**
39 KOEventView is the abstract base class from which all other
40 calendar views for event data are derived. It provides methods for
41 displaying
42 appointments and events on one or more days. The actual number of
43 days that a view actually supports is not defined by this abstract class;
44 that is up to the classes that inherit from it. It also provides
45 methods for updating the display, retrieving the currently selected
46 event (or events), and the like.
47
48 @short Abstract class from which all event views are derived.
49 @author Preston Brown <pbrown@kde.org>
50 @see KOListView, KOAgendaView, KOWeekView, KOMonthView
51*/
52class KOEventView : public KOrg::BaseView
53{
54 Q_OBJECT
55
56 public:
57 /**
58 * Constructs a view.
59 * @param cal is a pointer to the calendar object from which events
60 * will be retrieved for display.
61 */
62 KOEventView(Calendar *cal,QWidget *parent=0,const char *name=0);
63
64 /**
65 * Destructor. Views will do view-specific cleanups here.
66 */
67 virtual ~KOEventView();
68
69 /**
70 * provides a hint back to the caller on the maximum number of dates
71 * that the view supports. A return value of 0 means no maximum.
72 */
73 virtual int maxDatesHint() = 0;
74
75 /**
76 * Construct a standard context menu for an event.
77 */
78 KOEventPopupMenu *eventPopup();
79
80 /** This view is an view for displaying events. */
81 bool isEventView() { return true; }
82
83 public slots:
84
85 /**
86 * Show context menu for event.
87 * @param event event, which is to be manipulated by the menu actions
88 * @param popup a popop menu created with eventPopup()
89 */
90 void showIncidencePopup(QPopupMenu *popup, Incidence *event);
91
92 /**
93 Perform the default action for an incidence, e.g. open the event editor,
94 when double-clicking an event in the agenda view.
95 */
96 void defaultAction( Incidence * );
97
98 signals:
99 /**
100 * when the view changes the dates that are selected in one way or
101 * another, this signal is emitted. It should be connected back to
102 * the @see KDateNavigator object so that it changes appropriately,
103 * and any other objects that need to be aware that the list of
104 * selected dates has changed.
105 */
106 void datesSelected(const DateList);
107
108 /**
109 * instructs the receiver to show the incidence in read-only mode.
110 */
111 void showIncidenceSignal(Incidence *);
112
113 /**
114 * instructs the receiver to begin editing the incidence specified in
115 * some manner. Doesn't make sense to connect to more than one
116 * receiver.
117 */
118 void editIncidenceSignal(Incidence *);
119 void cloneIncidenceSignal(Incidence *);
120 void cancelIncidenceSignal(Incidence *);
121 void beamIncidenceSignal(Incidence *);
122 void moveIncidenceSignal(Incidence *);
123
124 /**
125 * instructs the receiver to delete the Incidence in some manner; some
126 * possibilities include automatically, with a confirmation dialog
127 * box, etc. Doesn't make sense to connect to more than one receiver.
128 */
129 void deleteIncidenceSignal(Incidence *);
130
131 /**
132 * instructs the receiver to create a new event. Doesn't make
133 * sense to connect to more than one receiver.
134 */
135 void newEventSignal();
136 /**
137 * instructs the receiver to create a new event with the specified beginning
138 * time. Doesn't make sense to connect to more than one receiver.
139 */
140 void newEventSignal(QDate);
141 /**
142 * instructs the receiver to create a new event with the specified beginning
143 * time. Doesn't make sense to connect to more than one receiver.
144 */
145 void newEventSignal(QDateTime);
146 /**
147 * instructs the receiver to create a new event, with the specified
148 * beginning end ending times. Doesn't make sense to connect to more
149 * than one receiver.
150 */
151 void newEventSignal(QDateTime, QDateTime);
152
153 //ET CVS MERGE !
154 /**
155 * Emitted when an event is moved using the mouse in an agenda
156 * view (week / month).
157 */
158 void shiftedEvent(const QDate& olddate, const QDate& newdate);
159
160
161 protected slots:
162 void popupShow();
163 void popupEdit();
164 void popupDelete();
165 void popupClone();
166 void popupCancel();
167
168 protected:
169 Incidence *mCurrentIncidence; // Incidence selected e.g. for a context menu
170};
171
172#endif