00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <dcopref.h>
00022 #include <tdeaboutdata.h>
00023 #include <tdeaction.h>
00024 #include <kdebug.h>
00025 #include <kgenericfactory.h>
00026 #include <kiconloader.h>
00027 #include <kstatusbar.h>
00028
00029 #include "core.h"
00030 #include "knotes_part.h"
00031 #include "summarywidget.h"
00032
00033 #include "knotes_plugin.h"
00034
00035
00036 typedef KGenericFactory< KNotesPlugin, Kontact::Core > KNotesPluginFactory;
00037 K_EXPORT_COMPONENT_FACTORY( libkontact_knotesplugin,
00038 KNotesPluginFactory( "kontact_knotesplugin" ) )
00039
00040
00041 KNotesPlugin::KNotesPlugin( Kontact::Core *core, const char *, const TQStringList & )
00042 : Kontact::Plugin( core, TQT_TQOBJECT(core), "knotes" ),
00043 mAboutData( 0 )
00044 {
00045 setInstance( KNotesPluginFactory::instance() );
00046
00047 insertNewAction( new TDEAction( i18n( "New Note..." ), "knotes", CTRL+SHIFT+Key_N,
00048 this, TQT_SLOT( slotNewNote() ), actionCollection(), "new_note" ) );
00049 insertSyncAction( new TDEAction( i18n( "Synchronize Notes" ), "reload", 0,
00050 this, TQT_SLOT( slotSyncNotes() ), actionCollection(), "knotes_sync" ) );
00051 }
00052
00053 KNotesPlugin::~KNotesPlugin()
00054 {
00055 }
00056
00057 KParts::ReadOnlyPart* KNotesPlugin::createPart()
00058 {
00059 return new KNotesPart( this, "notes" );
00060 }
00061
00062 Kontact::Summary *KNotesPlugin::createSummaryWidget( TQWidget *parentWidget )
00063 {
00064 return new KNotesSummaryWidget( this, parentWidget );
00065 }
00066
00067 const TDEAboutData *KNotesPlugin::aboutData()
00068 {
00069 if ( !mAboutData ) {
00070 mAboutData = new TDEAboutData( "knotes", I18N_NOOP( "Notes Management" ),
00071 "0.5", I18N_NOOP( "Notes Management" ),
00072 TDEAboutData::License_GPL_V2,
00073 "(c) 2003-2004 The Kontact developers" );
00074 mAboutData->addAuthor( "Michael Brade", "Current Maintainer", "brade@kde.org" );
00075 mAboutData->addAuthor( "Tobias Koenig", "", "tokoe@kde.org" );
00076 }
00077
00078 return mAboutData;
00079 }
00080
00081
00082
00083
00084 void KNotesPlugin::slotNewNote()
00085 {
00086 if ( part() )
00087 static_cast<KNotesPart *>( part() )->newNote();
00088 }
00089
00090 void KNotesPlugin::slotSyncNotes()
00091 {
00092 DCOPRef ref( "kmail", "KMailICalIface" );
00093 ref.send( "triggerSync", TQString("Note") );
00094 }
00095
00096 #include "knotes_plugin.moc"
00097