00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#include <kgenericfactory.h>
00023
#include <kdebug.h>
00024
00025
#include <konnectorinfo.h>
00026
#include <kapabilities.h>
00027
00028
#include <calendarsyncee.h>
00029
00030
#include "dummykonnector.h"
00031
00032
using namespace KSync;
00033
using namespace KCal;
00034
00035
class DummyKonnectorFactory :
public KRES::PluginFactoryBase
00036 {
00037
public:
00038 KRES::Resource *resource(
const KConfig *config )
00039 {
00040
return new DummyKonnector( config );
00041 }
00042
00043 KRES::ConfigWidget *configWidget(
QWidget * )
00044 {
00045
return 0;
00046 }
00047 };
00048
00049
extern "C"
00050 {
00051
void *init_libdummykonnector()
00052 {
00053
return new DummyKonnectorFactory();
00054 }
00055 }
00056
00057
00058 DummyKonnector::DummyKonnector(
const KConfig *config )
00059 :
Konnector( config )
00060 {
00061 Event *event =
new Event;
00062 event->setSummary(
"An Event" );
00063 mCalendar.addEvent( event );
00064
00065 event =
new Event;
00066 event->setSummary(
"Another Event" );
00067 mCalendar.addEvent( event );
00068
00069
CalendarSyncee *calendarSyncee =
new CalendarSyncee( &mCalendar );
00070 mSyncees.append( calendarSyncee );
00071 }
00072
00073 DummyKonnector::~DummyKonnector()
00074 {
00075 }
00076
00077 KSync::Kapabilities
DummyKonnector::capabilities()
00078 {
00079 KSync::Kapabilities caps;
00080
00081 caps.setSupportMetaSyncing(
false );
00082 caps.setSupportsPushSync(
false );
00083 caps.setNeedsConnection(
false );
00084 caps.setSupportsListDir(
false );
00085 caps.setNeedsIPs(
false );
00086 caps.setNeedsSrcIP(
false );
00087 caps.setNeedsDestIP(
false );
00088 caps.setAutoHandle(
false );
00089 caps.setNeedAuthentication(
false );
00090 caps.setNeedsModelName(
false );
00091
00092
return caps;
00093 }
00094
00095 void DummyKonnector::setCapabilities(
const KSync::Kapabilities & )
00096 {
00097 }
00098
00099 SynceeList DummyKonnector::syncees()
00100 {
00101
return mSyncees;
00102 }
00103
00104 bool DummyKonnector::readSyncees()
00105 {
00106 kdDebug() <<
"DummyKonnector::readSyncees()" << endl;
00107
00108 emit
synceesRead(
this );
00109
00110
return true;
00111 }
00112
00113 bool DummyKonnector::connectDevice()
00114 {
00115
return true;
00116 }
00117
00118 bool DummyKonnector::disconnectDevice()
00119 {
00120
return true;
00121 }
00122
00123 KSync::KonnectorInfo DummyKonnector::info()
const
00124
{
00125
return KonnectorInfo( i18n(
"Dummy Konnector"),
00126
QIconSet(),
00127 QString::fromLatin1(
"dummykonnector"),
00128
"Dummy Konnector",
00129
"agenda",
00130
false );
00131 }
00132
00133 void DummyKonnector::download(
const QString& )
00134 {
00135 error( StdError::downloadNotSupported() );
00136 }
00137
00138 KSync::ConfigWidget *
DummyKonnector::configWidget(
const KSync::Kapabilities&,
QWidget*,
00139
const char* )
00140 {
00141
return 0;
00142 }
00143
00144
KSync::ConfigWidget *
DummyKonnector::configWidget(
QWidget*,
const char* )
00145 {
00146
return 0;
00147 }
00148
00149 bool DummyKonnector::writeSyncees()
00150 {
00151 emit
synceesWritten(
this );
00152
return true;
00153 }
00154
00155
00156
#include "dummykonnector.moc"