knotes_plugin.cpp
00001
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 typedef KGenericFactory< KNotesPlugin, Kontact::Core > KNotesPluginFactory;
00035 K_EXPORT_COMPONENT_FACTORY( libkontact_knotesplugin,
00036 KNotesPluginFactory( "kontact_knotesplugin" ) )
00037
00038 KNotesPlugin::KNotesPlugin( Kontact::Core *core, const char *,
00039 const QStringList &)
00040 : Kontact::Plugin( core, core, "knotes" ), mAboutData( 0 )
00041 {
00042 setInstance( KNotesPluginFactory::instance() );
00043
00044 insertNewAction( new KAction( i18n( "New Note" ), BarIcon( "knotes" ), 0,
00045 this, SLOT( slotNewNote() ), actionCollection(),
00046 "new_note" ) );
00047 }
00048
00049 KNotesPlugin::~KNotesPlugin()
00050 {
00051 }
00052
00053 KParts::Part* KNotesPlugin::createPart()
00054 {
00055 return new KNotesPart( this, "notes" );
00056 }
00057
00058 Kontact::Summary *KNotesPlugin::createSummaryWidget( QWidget *parentWidget )
00059 {
00060 return new SummaryWidget( parentWidget );
00061 }
00062
00063 void KNotesPlugin::slotNewNote()
00064 {
00065 if ( part() )
00066 static_cast<KNotesPart*>( part() )->newNote();
00067 }
00068
00069 const KAboutData *KNotesPlugin::aboutData()
00070 {
00071 if ( !mAboutData ) {
00072 mAboutData = new KAboutData( "knotes", I18N_NOOP( "Notes Management" ),
00073 "0.1",
00074 I18N_NOOP( "Notes Management" ),
00075 KAboutData::License_GPL_V2,
00076 "(c) 2003 The Kontact developers" );
00077 mAboutData->addAuthor( "Tobias Koenig", "", "tokoe@kde.org" );
00078 }
00079
00080 return mAboutData;
00081 }
00082
00083 #include "knotes_plugin.moc"
This file is part of the documentation for kontact Library Version 3.2.2.