kontact Library API Documentation

knotes_plugin.cpp

00001 /*
00002        This file is part of Kontact
00003        Copyright (c) 2002 Daniel Molkentin <molkentin@kde.org>
00004 
00005        This library is free software; you can redistribute it and/or
00006        modify it under the terms of the GNU Library General Public
00007        License as published by the Free Software Foundation; either
00008        version 2 of the License, or (at your option) any later version.
00009 
00010        This library is distributed in the hope that it will be useful,
00011        but WITHOUT ANY WARRANTY; without even the implied warranty of
00012        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013        Library General Public License for more details.
00014 
00015        You should have received a copy of the GNU Library General Public License
00016        along with this library; see the file COPYING.LIB.  If not, write to
00017        the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018        Boston, MA 02111-1307, USA.
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"
KDE Logo
This file is part of the documentation for kontact Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:39:00 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003