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