From 47fc358e914aecd13c4cb3d9cb4b3f2ca1a93b6c Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 22 Feb 2003 22:59:37 +0000 Subject: import the new layout/design of datebook sorry this was not put into a branch and once its done it'll replace datebook and be put into that subdir. but currently I want both versions available so I can test... So by design it'll feature Showing BirthDays Showing Due and OVerDue Todos Better AllDay handling Pinning Events to TimeZones Exceptions to Recurrence --- (limited to 'core/pim/datebook2/view.h') diff --git a/core/pim/datebook2/view.h b/core/pim/datebook2/view.h new file mode 100644 index 0000000..a7bc1d8 --- a/dev/null +++ b/core/pim/datebook2/view.h @@ -0,0 +1,122 @@ +#ifndef OPIE_DATE_BOOK_VIEW_H +#define OPIE_DATE_BOOK_VIEW_H + +#include +#include + +#include +#include + +class Config; +namespace Datebook { + class MainWindow; + class View { + public: + View( MainWindow* window, QWidget* parent ); + virtual ~View() = 0; + + static QDate dateFromWeek( int week, int year, bool startOnMonda ); + static bool calcWeek( const QDate& d, int &week, int &year, bool startOnMonday = false ); + + virtual QPixmap pixmap()const = 0; + virtual QString description()const = 0; + + /** + * loadConfig + * saveConfig + */ + void loadConfig( Config* ); + void saveConfig( Config* ); + + /** + * the current range + */ + void currentRange( const QDateTime& src, const QDateTime& from); + + /** + * the clock format changed + */ + virtual void clockChanged() = 0; + + /** + * the day change means that either + * monday or sunday is the week start + */ + virtual void dayChanged() = 0; + + /** + * show date in your view!! + */ + virtual void showDay( const QDate& date ) = 0; + + /** + * return the widget + */ + virtual QWidget* widget(); + + /** + * the view needs an update! + */ + virtual void reschedule() = 0 + protected: + void popup( int ); + QString toShortText(const OEffectiveEvent& eff)const; + QString toText(const OEffectiveEvent& eff)const; + virtual void doLoadConfig( Config* ) = 0; + virtual void doSaveConfig( Config* ) = 0; + + /** + * create a new event starting + * on start + */ + void add( const QDate& start ); + + /** + * create a new event in a given range + */ + void add( const QDateTime& start, const QDateTime& end ); + + /** + * will make the MainWindow to open the editor + */ + void edit( int uid ); + + /** + * remove item with uid + */ + void remove( int uid ); + + /** + * give access to all events + */ + ODateBookAccess::List allEvents()const; + + /** + * return events + */ + OEffectiveEvent::ValueList events( const QDate& start, const QDate& end ); + + /** + * return an Event + */ + OEvent event( int uid )const; + + /** + * Is the clock AP/PM or 24h? + */ + bool isAP()const; + + /** + * if the week starts on monday? + */ + bool weekStartOnMonday()const; + + /** + * return related records for days + */ + QPtrList records( const QDate& on ); + QPtrList records( const QDate& start, const QDate& to ); + }; +} + +#endif -- cgit v0.9.0.2