diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /korganizer/interfaces/korganizer/baseview.h | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/interfaces/korganizer/baseview.h')
-rw-r--r-- | korganizer/interfaces/korganizer/baseview.h | 95 |
1 files changed, 72 insertions, 23 deletions
diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h index 64fbd72b..6d60a0a5 100644 --- a/korganizer/interfaces/korganizer/baseview.h +++ b/korganizer/interfaces/korganizer/baseview.h @@ -2,7 +2,7 @@ This file is part of the KOrganizer interfaces. Copyright (c) 1999,2001,2003 Cornelius Schumacher <schumacher@kde.org> - Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> + Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -38,17 +38,19 @@ using namespace KCal; -namespace KCal { class Calendar; } +namespace KCal { + class Calendar; + class ResourceCalendar; +} namespace KOrg { - /** - This class provides an interface for all views being displayed within the main - calendar view. It has functions to update the view, to specify date range and - other display parameter and to return selected objects. An important class, - which inherits KOBaseView is KOEventView, which provides the interface for all - views of event data like the agenda or the month view. + This class provides an interface for all views being displayed within the + main calendar view. It has functions to update the view, to specify date + range and other display parameter and to return selected objects. An + important class, which inherits KOBaseView is KOEventView, which provides + the interface for all views of event data like the agenda or the month view. @short Base class for calendar views @author Preston Brown, Cornelius Schumacher @@ -56,7 +58,7 @@ namespace KOrg { */ class KDE_EXPORT BaseView : public QWidget { - Q_OBJECT + Q_OBJECT public: /** Constructs a view. @@ -66,21 +68,41 @@ class KDE_EXPORT BaseView : public QWidget @param parent parent widget. @param name name of this widget. */ - BaseView( Calendar *cal, TQWidget *parent = 0, - const char *name = 0 ) - : TQWidget( parent, name ), mCalendar( cal ), mChanger( 0 ) {} + BaseView( Calendar *cal, TQWidget *parent = 0, const char *name = 0 ) + : TQWidget( parent, name ), + mReadOnly( false ), mCalendar( cal ), mResource( 0 ), mChanger( 0 ) {} /** Destructor. Views will do view-specific cleanups here. */ virtual ~BaseView() {} + /** Flag indicating if the view is read-only */ + void setReadOnly( bool readonly ) { mReadOnly = readonly; } + bool readOnly() { return mReadOnly; } + virtual void setCalendar( Calendar *cal ) { mCalendar = cal; } /** Return calendar object of this view. */ virtual Calendar *calendar() { return mCalendar; } + virtual void setResource( ResourceCalendar *res, const TQString &subResource ) + { + mResource = res; + mSubResource = subResource; + } + + /** + Return resourceCalendar of this view. + */ + ResourceCalendar *resourceCalendar() { return mResource; } + + /** + Return subResourceCalendar of this view. + */ + TQString subResourceCalendar() const { return mSubResource; } + /** @return a list of selected events. Most views can probably only select a single event at a time, but some may be able to select @@ -93,7 +115,19 @@ class KDE_EXPORT BaseView : public QWidget select a single event at a time, but some may be able to select more than one. */ - virtual DateList selectedDates() = 0; + virtual DateList selectedIncidenceDates() = 0; + + /** + Returns the start of the selection, or an invalid TQDateTime if there is no selection + or the view doesn't support selecting cells. + */ + virtual TQDateTime selectionStart() { return TQDateTime(); } + + /** + Returns the end of the selection, or an invalid TQDateTime if there is no selection + or the view doesn't support selecting cells. + */ + virtual TQDateTime selectionEnd() { return TQDateTime(); } virtual CalPrinterBase::PrintType printType() { @@ -108,6 +142,11 @@ class KDE_EXPORT BaseView : public QWidget /** Return if this view is a view for displaying events. */ virtual bool isEventView() { return false; } + /** Returns true if the view supports navigation through the date navigator + ( selecting a date range, changing month, changing year, etc. ) + */ + virtual bool supportsDateNavigation() const { return false; } + public slots: /** Show incidences for the given date range. The date range actually shown may be @@ -124,8 +163,9 @@ class KDE_EXPORT BaseView : public QWidget show all given events. @param incidenceList a list of incidences to show. + @param date is the TQDate on which the incidences are being shown. */ - virtual void showIncidences( const Incidence::List &incidenceList ) = 0; + virtual void showIncidences( const Incidence::List &incidenceList, const TQDate &date ) = 0; /** Updates the current display to reflect changes that may have happened @@ -166,19 +206,19 @@ class KDE_EXPORT BaseView : public QWidget virtual bool eventDurationHint(TQDateTime &/*startDt*/, TQDateTime &/*endDt*/, bool &/*allDay*/) { return false; } signals: - void incidenceSelected( Incidence * ); + void incidenceSelected( Incidence *, const TQDate & ); /** * instructs the receiver to show the incidence in read-only mode. */ - void showIncidenceSignal(Incidence *); + void showIncidenceSignal( Incidence *, const TQDate & ); /** * instructs the receiver to begin editing the incidence specified in * some manner. Doesn't make sense to connect to more than one * receiver. */ - void editIncidenceSignal(Incidence *); + void editIncidenceSignal( Incidence *, const TQDate & ); /** * instructs the receiver to delete the Incidence in some manner; some @@ -220,31 +260,40 @@ class KDE_EXPORT BaseView : public QWidget * instructs the receiver to create a new event. Doesn't make * sense to connect to more than one receiver. */ - void newEventSignal(); + void newEventSignal( ResourceCalendar *res, const TQString &subResource ); /** * instructs the receiver to create a new event with the specified beginning * time. Doesn't make sense to connect to more than one receiver. */ - void newEventSignal( const TQDate & ); + void newEventSignal( ResourceCalendar *res, const TQString &subResource, + const TQDate & ); /** * instructs the receiver to create a new event with the specified beginning * time. Doesn't make sense to connect to more than one receiver. */ - void newEventSignal( const TQDateTime & ); + void newEventSignal( ResourceCalendar *res, const TQString &subResource, + const TQDateTime & ); /** * instructs the receiver to create a new event, with the specified * beginning end ending times. Doesn't make sense to connect to more * than one receiver. */ - void newEventSignal( const TQDateTime &, const TQDateTime & ); + void newEventSignal( ResourceCalendar *res, const TQString &subResource, + const TQDateTime &, const TQDateTime & ); - void newTodoSignal( const TQDate & ); + void newTodoSignal( ResourceCalendar *res,const TQString &subResource, + const TQDate & ); void newSubTodoSignal( Todo * ); - void newJournalSignal( const TQDate & ); + void newJournalSignal( ResourceCalendar *res,const TQString &subResource, + const TQDate & ); private: + bool mReadOnly; Calendar *mCalendar; + ResourceCalendar *mResource; + TQString mSubResource; + protected: IncidenceChangerBase *mChanger; }; |