kitchensync

multisynk_part.cpp

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #include <qlayout.h>
00023 
00024 #include <kaction.h>
00025 #include <kapplication.h>
00026 #include <kdebug.h>
00027 #include <kiconloader.h>
00028 #include <kinstance.h>
00029 #include <klocale.h>
00030 #include <kparts/genericfactory.h>
00031 #include <kstatusbar.h>
00032 
00033 #include "mainwidget.h"
00034 
00035 #include "multisynk_part.h"
00036 
00037 typedef KParts::GenericFactory< MultiSynkPart > MultiSynkFactory;
00038 K_EXPORT_COMPONENT_FACTORY( libmultisynkpart, MultiSynkFactory )
00039 
00040 MultiSynkPart::MultiSynkPart( QWidget *parentWidget, const char *widgetName,
00041                               QObject *parent, const char *name,
00042                               const QStringList & )
00043   : KParts::ReadOnlyPart( parent, name )
00044 {
00045   setInstance( MultiSynkFactory::instance() );
00046 
00047   // create a canvas to insert our widget
00048   MainWidget *wdg = new MainWidget( this, parentWidget, widgetName );
00049   setWidget( wdg );
00050 
00051   KGlobal::iconLoader()->addAppDir( "multisynk" );
00052 
00053   setXMLFile( "multisynk_part.rc" );
00054 }
00055 
00056 MultiSynkPart::~MultiSynkPart()
00057 {
00058   closeURL();
00059 }
00060 
00061 KAboutData *MultiSynkPart::createAboutData()
00062 {
00063   return MainWidget::aboutData();
00064 }
00065 
00066 void MultiSynkPart::exit()
00067 {
00068   delete this;
00069 }
00070 
00071 bool MultiSynkPart::openURL( const KURL &url )
00072 {
00073   emit setWindowCaption( url.prettyURL() );
00074 
00075   return true;
00076 }
00077 
00078 bool MultiSynkPart::openFile()
00079 {
00080   return true;
00081 }
00082 
00083 void MultiSynkPart::guiActivateEvent( KParts::GUIActivateEvent *e )
00084 {
00085   KParts::ReadOnlyPart::guiActivateEvent( e );
00086 }
00087 
00088 #include "multisynk_part.moc"
00089 
KDE Home | KDE Accessibility Home | Description of Access Keys