From 977193cc46768da220ddb01aca74286b28e6b7ee Mon Sep 17 00:00:00 2001 From: alwin Date: Fri, 18 Mar 2005 16:57:24 +0000 Subject: work on plugins finished. these plugins now may have a config-widget (sorry guys - I had to change the plugininterface and so the UUID again.) the plugin for nationalholidays now has such a widget, the datebook will insert configwidgets into its settingsdialog. corrected the .pro file of opiepim2/ui so it contains the header/cpp files for that pluginsystem. --- (limited to 'libopie2/opiepim/ui') diff --git a/libopie2/opiepim/ui/oholidayplugin.h b/libopie2/opiepim/ui/oholidayplugin.h index 52db0eb..192a020 100644 --- a/libopie2/opiepim/ui/oholidayplugin.h +++ b/libopie2/opiepim/ui/oholidayplugin.h @@ -5,12 +5,15 @@ #include #include #include +#include class EffectiveEvent; namespace Opie { namespace Datebook { +class HolidayPluginConfigWidget; + class HolidayPlugin { public: @@ -21,8 +24,9 @@ public: virtual QStringList entries(unsigned year, unsigned month, unsigned day)=0; virtual QMap entries(const QDate&,const QDate&)=0; virtual QValueList events(const QDate&,const QDate&)=0; -}; + virtual HolidayPluginConfigWidget*configWidget(QWidget *parent=0, const char *name = 0, QWidget::WFlags fl = 0 ){return 0;} +}; } } #endif diff --git a/libopie2/opiepim/ui/oholidayplugincfgwidget.cpp b/libopie2/opiepim/ui/oholidayplugincfgwidget.cpp new file mode 100644 index 0000000..43380bb --- a/dev/null +++ b/libopie2/opiepim/ui/oholidayplugincfgwidget.cpp @@ -0,0 +1,14 @@ +#include "oholidayplugincfgwidget.h" + +namespace Opie { +namespace Datebook { +HolidayPluginConfigWidget::HolidayPluginConfigWidget( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{} + +HolidayPluginConfigWidget::~HolidayPluginConfigWidget() +{} + +} +} + diff --git a/libopie2/opiepim/ui/oholidayplugincfgwidget.h b/libopie2/opiepim/ui/oholidayplugincfgwidget.h new file mode 100644 index 0000000..17af467 --- a/dev/null +++ b/libopie2/opiepim/ui/oholidayplugincfgwidget.h @@ -0,0 +1,30 @@ +#ifndef _HOLIDAY_PLUGIN_CFG_WIDGET +#define _HOLIDAY_PLUGIN_CFG_WIDGET +#include + +namespace Opie { +namespace Datebook { +class HolidayPluginConfigWidget:public QWidget +{ + Q_OBJECT +public: + /** + * This will construct the widget. The widget gets deleted once the parent + * gets deleted as in any Qt application + * + * A Parent is required! + * + * @param parent The parent of the widget + * @param name The name of the object + */ + HolidayPluginConfigWidget(QWidget *parent, const char *name = 0, WFlags fl = 0 ); + virtual ~HolidayPluginConfigWidget(); + + virtual void saveConfig()=0; +}; + +} +} + +#endif + diff --git a/libopie2/opiepim/ui/oholidaypluginif.h b/libopie2/opiepim/ui/oholidaypluginif.h index 825d3ad..618d371 100644 --- a/libopie2/opiepim/ui/oholidaypluginif.h +++ b/libopie2/opiepim/ui/oholidaypluginif.h @@ -4,8 +4,8 @@ #include #ifndef QT_NO_COMPONENT -//017f90d4-34fc-4dc5-aed7-498c6da6571e -#define IID_HOLIDAY_PLUGIN QUuid(0x017f90d4,0x34fc,0x4dc5,0xae,0xd7,0x49,0x8c,0x6d,0xa6,0x57,0x1e) +//c0a5f73f-975e-4492-9285-af555284c4ab +#define IID_HOLIDAY_PLUGIN QUuid(0xc0a5f73f,0x975e,0x4492,0x92,0x85,0xaf,0x55,0x52,0x84,0xc4,0xab) #endif namespace Opie { @@ -18,7 +18,7 @@ class HolidayPluginIf:public QUnknownInterface public: HolidayPluginIf():QUnknownInterface(){} virtual ~HolidayPluginIf(){} - + virtual HolidayPlugin*plugin()=0; }; @@ -29,7 +29,6 @@ public: virtual ~HolidayPluginWrapper(){if (_plugin) delete _plugin;} QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface ) { - odebug << "HolidayPluginWrapper::queryInterface()" << oendl; *iface = 0; if (uuid == IID_HOLIDAY_PLUGIN || uuid == IID_QUnknown) { *iface = this; @@ -55,7 +54,6 @@ protected: Q_EXPORT_INTERFACE() { \ Q_CREATE_INSTANCE( Opie::Datebook::HolidayPluginWrapper ) \ } - } } #endif diff --git a/libopie2/opiepim/ui/ui.pro b/libopie2/opiepim/ui/ui.pro index 53c7ae2..97c8d81 100644 --- a/libopie2/opiepim/ui/ui.pro +++ b/libopie2/opiepim/ui/ui.pro @@ -1,10 +1,14 @@ HEADERS += ui/opimmainwindow.h \ ui/opimrecurrencewidget.h \ ui/todayconfigwidget.h \ - ui/todayplugininterface.h + ui/todayplugininterface.h \ + ui/oholidayplugin.h \ + ui/oholidayplugincfgwidget.h \ + ui/oholidaypluginif.h SOURCES += ui/opimmainwindow.cpp \ ui/opimrecurrencewidget.cpp \ - ui/todayconfigwidget.cpp + ui/todayconfigwidget.cpp \ + ui/oholidayplugincfgwidget.cpp INTERFACES += ui/opimrecurrencebase.ui -- cgit v0.9.0.2