• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

knode

knode_part.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of KNode.
00003     Copyright (c) 2003      Laurent Montel  <montel@kde.org>,
00004     Based on the work of Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program 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
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #include "knode_part.h"
00026 #include "knglobals.h"
00027 #include "knmainwidget.h"
00028 #include "aboutdata.h"
00029 #include "kncollectionview.h"
00030 
00031 #include <kparts/genericfactory.h>
00032 #include <kparts/statusbarextension.h>
00033 #include <kiconloader.h>
00034 #include <kdebug.h>
00035 #include <kstatusbar.h>
00036 #include <ksqueezedtextlabel.h>
00037 
00038 #include <QVBoxLayout>
00039 
00040 
00041 K_PLUGIN_FACTORY(KNodeFactory, registerPlugin<KNodePart>();)
00042 K_EXPORT_PLUGIN(KNodeFactory(KNode::AboutData()))
00043 
00044 KNodePart::KNodePart( QWidget *parentWidget, QObject *parent, const QVariantList &)
00045   : KParts::ReadOnlyPart( parent ),
00046   mParentWidget( parentWidget )
00047 {
00048   kDebug(5003) <<"KNodePart()";
00049   kDebug(5003) <<"  InstanceName:" << KGlobal::mainComponent().componentName();
00050 
00051   setComponentData( KNodeFactory::componentData() );
00052 
00053   kDebug(5003) <<"KNodePart()...";
00054   kDebug(5003) <<"  InstanceName:" << KGlobal::mainComponent().componentName();
00055 
00056   KGlobal::locale()->insertCatalog("libkdepim");
00057   KGlobal::locale()->insertCatalog("libkpgp");
00058 #ifdef __GNUC__
00059 #warning Port me!
00060 #endif
00061 //   kapp->dcopClient()->suspend(); // Don't handle DCOP requests yet
00062   KIconLoader::global()->addAppDir("knode");
00063   KIconLoader::global()->addAppDir("kdepim");
00064   knGlobals.setComponentData( KNodeFactory::componentData() );
00065 
00066   // create a canvas to insert our widget
00067   QWidget *canvas = new QWidget(parentWidget);
00068   canvas->setFocusPolicy( Qt::ClickFocus );
00069   setWidget(canvas);
00070 
00071   mainWidget = new KNMainWidget( this, canvas );
00072   QVBoxLayout *topLayout = new QVBoxLayout(canvas);
00073   topLayout->addWidget(mainWidget);
00074   mainWidget->setFocusPolicy( Qt::ClickFocus );
00075 
00076 #ifdef __GNUC__
00077 #warning Port me!
00078 #endif
00079 //   kapp->dcopClient()->resume(); // Ok. We are ready for DCOP requests.
00080 
00081   KParts::StatusBarExtension* statusBar = new KParts::StatusBarExtension(this);
00082   statusBar->addStatusBarItem(mainWidget->statusBarLabelFilter(), 10, false);
00083   statusBar->addStatusBarItem(mainWidget->statusBarLabelGroup(), 15, false);
00084 
00085   setXMLFile( "knodeui.rc" );
00086 }
00087 
00088 KNodePart::~KNodePart()
00089 {
00090   mainWidget->prepareShutdown();
00091 }
00092 
00093 KAboutData *KNodePart::createAboutData()
00094 {
00095   return new KNode::AboutData();
00096 }
00097 
00098 bool KNodePart::openFile()
00099 {
00100   kDebug(5003) <<"KNodePart:openFile()";
00101 
00102   mainWidget->show();
00103   return true;
00104 }
00105 
00106 void KNodePart::guiActivateEvent(KParts::GUIActivateEvent *e)
00107 {
00108   kDebug(5003) <<"KNodePart::guiActivateEvent";
00109   KParts::ReadOnlyPart::guiActivateEvent(e);
00110 }
00111 
00112 
00113 QWidget* KNodePart::parentWidget() const
00114 {
00115   return mParentWidget;
00116 }
00117 
00118 
00119 
00120 #include "knode_part.moc"
00121 

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal