25 #ifndef KOAGENDAVIEW_H
26 #define KOAGENDAVIEW_H
28 #include <tqscrollview.h>
33 #include "calprinter.h"
34 #include "calendarview.h"
36 #include "agendaview.h"
48 class IncidenceChangerBase;
51 class EventIndicator :
public TQFrame
56 enum Location { Top, Bottom };
57 EventIndicator( Location loc = Top, TQWidget *parent = 0,
58 const char *name = 0 );
59 virtual ~EventIndicator();
61 void changeColumns(
int columns );
63 void enableColumn(
int column,
bool enable );
66 void drawContents( TQPainter * );
72 TQMemArray<bool> mEnabled;
75 class KOAlternateLabel :
public TQLabel
80 KOAlternateLabel(
const TQString &shortlabel,
const TQString &longlabel,
81 const TQString &extensivelabel = TQString(),
82 TQWidget *parent = 0,
const char *name = 0 );
85 virtual TQSize minimumSizeHint()
const;
87 enum TextType { Short = 0, Long = 1, Extensive = 2 };
88 TextType largestFittingTextType()
const;
89 void setFixedType( TextType type );
94 void useExtensiveText();
95 void useDefaultText();
98 virtual void resizeEvent( TQResizeEvent * );
99 virtual void squeezeTextToLabel();
101 TQString mShortText, mLongText, mExtensiveText;
115 TQWidget *parent = 0,
116 const char *name = 0,
117 bool isSideBySide =
false );
133 virtual bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt,
bool &allDay);
138 KOrg::CalPrinterBase::PrintType printType();
151 void setTypeAheadReceiver( TQObject * );
153 KOAgenda* agenda()
const {
return mAgenda; }
154 TQSplitter* splitter()
const {
return mSplitterAgenda; }
155 TQFrame *dayLabels()
const {
return mDayLabels; }
158 void calendarIncidenceAdded(
Incidence *incidence );
159 void calendarIncidenceChanged(
Incidence *incidence );
160 void calendarIncidenceDeleted(
Incidence *incidence );
163 virtual void updateView();
164 virtual void updateConfig();
165 virtual void showDates(
const TQDate &start,
const TQDate &end );
166 virtual void showIncidences(
const Incidence::List &incidenceList,
const TQDate &date );
168 void insertIncidence(
Incidence *incidence,
const TQDate &curDate );
169 void changeIncidenceDisplayAdded(
Incidence *incidence );
170 void changeIncidenceDisplay(
Incidence *incidence,
int mode );
172 void clearSelection();
177 void readSettings( TDEConfig * );
178 void writeSettings( TDEConfig * );
180 void setContentsPos(
int y );
182 void setExpandedButton(
bool expanded );
184 void finishTypeAhead();
189 void enableAgendaUpdate(
bool enable );
190 void setIncidenceChanger( KOrg::IncidenceChangerBase *changer );
192 void zoomInHorizontally(
const TQDate& date=TQDate() );
193 void zoomOutHorizontally(
const TQDate& date=TQDate() );
195 void zoomInVertically( );
196 void zoomOutVertically( );
198 void zoomView(
const int delta,
const TQPoint &pos,
200 const TQt::Orientation orient=TQt::Horizontal );
202 void clearTimeSpanSelection();
204 void resourcesChanged();
208 void zoomViewHorizontally(
const TQDate &,
int count );
210 void timeSpanSelectionChanged();
219 void connectAgenda( KOAgenda*agenda, TQPopupMenu*popup, KOAgenda* otherAgenda );
236 void updateTimeBarWidth();
238 virtual void resizeEvent( TQResizeEvent *resizeEvent );
246 void updateEventIndicatorTop(
int newY );
247 void updateEventIndicatorBottom(
int newY );
254 void updateDayLabelSizes();
257 bool filterByResource(
Incidence *incidence );
258 void displayIncidence(
Incidence *incidence );
263 TQHBox *mDayLabelsFrame;
264 TQBoxLayout *mLayoutDayLabels;
265 TQPtrList<KOAlternateLabel> mDateDayLabels;
266 TQFrame *mAllDayFrame;
267 KOAgenda *mAllDayAgenda;
269 TimeLabels *mTimeLabels;
270 TQWidget *mDummyAllDayLeft;
271 TQSplitter *mSplitterAgenda;
272 TQPushButton *mExpandButton;
274 DateList mSelectedDates;
275 DateList mSaveSelectedDates;
278 KOEventPopupMenu *mAgendaPopup;
279 KOEventPopupMenu *mAllDayAgendaPopup;
281 EventIndicator *mEventIndicatorTop;
282 EventIndicator *mEventIndicatorBottom;
284 TQMemArray<int> mMinY;
285 TQMemArray<int> mMaxY;
287 TQMemArray<bool> mHolidayMask;
289 TQPixmap mExpandedPixmap;
290 TQPixmap mNotExpandedPixmap;
292 TQDateTime mTimeSpanBegin;
293 TQDateTime mTimeSpanEnd;
294 bool mTimeSpanInAllDay;
295 bool mAllowAgendaUpdate;
300 bool mPendingChanges;
308 bool mAreDatesInitialized;
TQDateTime selectionStart()
start-datetime of selection
virtual bool eventDurationHint(TQDateTime &startDt, TQDateTime &endDt, bool &allDay)
return the default start/end date/time for new events
void clearView()
Remove all events from view.
void doUpdateItem()
update just the display of the given incidence, called by a single-shot timer
virtual Incidence::List selectedIncidences()
returns the currently selected events
void fillAgenda()
Fill agenda using the current set value for the start date.
void setHolidayMasks()
Set the masks on the agenda widgets indicating, which days are holidays.
void updateEventIndicators()
Updates the event indicators after a certain incidence was modified or removed.
virtual int maxDatesHint()
Returns maximum number of days supported by the koagendaview.
void updateEventDates(KOAgendaItem *item)
Update event belonging to agenda item.
virtual DateList selectedIncidenceDates()
returns the currently selected events
virtual int currentDateCount()
Returns number of currently shown dates.
bool selectedIsAllDay()
returns true if selection is for whole day
void deleteSelectedDateTime()
make selected start/end invalid
TQDateTime selectionEnd()
end-datetime of selection
This is the main calendar widget.
Base class for single/multi agenda views.
void newTimeSpanSelectedAllDay(const TQPoint &start, const TQPoint &end)
Updates data for selected timespan for all day event.
void slotTodoDropped(Todo *, const TQPoint &, bool)
reschedule the todo to the given x- and y- coordinates.
bool selectedIsSingleCell()
returns if only a single cell is selected, or a range of cells
void createDayLabels(bool force)
Create labels for the selected dates.
KOAgendaView is the agenda-like view used to display events in a single one or multi-day view.
void newTimeSpanSelected(const TQPoint &start, const TQPoint &end)
Updates data for selected timespan.