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

kontact

kmobiletools_plugin.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002   Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
00003   Copyright (C) 2007 Marco Gulino <marco@kmobiletools.org>
00004   This program is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or
00007   (at your option) any later version.
00008 
00009   This program is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012   GNU General Public License for more details.
00013 
00014   You should have received a copy of the GNU General Public License
00015   along with this program; if not, write to the
00016   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017   Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #include "kmobiletools_plugin.h"
00021 
00022 #include <maininterface.h>
00023 #include <kontactinterfaces/core.h>
00024 
00025 #include <kaboutdata.h>
00026 #include <kaction.h>
00027 #include <kactioncollection.h>
00028 #include <kapplication.h>
00029 #include <kgenericfactory.h>
00030 #include <kparts/componentfactory.h>
00031 
00032 EXPORT_KONTACT_PLUGIN( KMobileToolsPlugin, kmobiletools )
00033 
00034 KMobileToolsPlugin::KMobileToolsPlugin( Kontact::Core *core, const QVariantList & )
00035   : Kontact::Plugin( core, core, "KMobileTools" ), partLoaded( false )
00036 {
00037   setComponentData( KontactPluginFactory::componentData() );
00038   KAction *newaction = new KAction( KIcon( "newsms" ), i18n( "New SMS..." ), this );
00039   actionCollection()->addAction( "newsms", newaction );
00040   newaction->setShortcut( QKeySequence( Qt::CTRL+Qt::SHIFT + Qt::Key_S ) );
00041   connect( newaction, SIGNAL(triggered(bool)),SLOT(slotNewSMS()) );
00042   insertNewAction( newaction );
00043   setExecutableName( "kmobiletools_bin" );
00044 }
00045 
00046 KMobileToolsPlugin::~KMobileToolsPlugin()
00047 {
00048 }
00049 
00050 bool KMobileToolsPlugin::isRunningStandalone()
00051 {
00052 //     return ( (!partLoaded) && kapp->dcopClient()->isApplicationRegistered("kmobiletools") );
00053 #ifdef __GNUC__
00054 #warning FIXME!!!
00055 #endif
00056   return false;
00057 }
00058 
00059 KParts::ReadOnlyPart *KMobileToolsPlugin::createPart()
00060 {
00061   KParts::ReadOnlyPart *m_part = loadPart();
00062   partLoaded=(bool)m_part;
00063 #ifdef __GNUC__
00064 #warning "look at if interface is ok";
00065 #endif
00066   m_interface = new OrgKdeKmobiletoolsMainInterface( "org.kde.kmobiletools",
00067                                                      "/KMobitools", QDBusConnection::sessionBus() );
00068   return m_part;
00069 }
00070 
00071 void KMobileToolsPlugin::slotNewSMS()
00072 {
00073   (void) part(); // ensure part is loaded
00074   Q_ASSERT( m_interface );
00075   m_interface->newSMS();
00076 }
00077 
00078 #include "kmobiletools_plugin.moc"

kontact

Skip menu "kontact"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

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
  • 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