27 #include <dcopclient.h>
29 #include <kaboutdata.h>
31 #include <kapplication.h>
32 #include <kcmdlineargs.h>
34 #include <kgenericfactory.h>
35 #include <kiconloader.h>
36 #include <kmessagebox.h>
37 #include <kparts/componentfactory.h>
42 #include <akregator_options.h>
43 #include <akregator_part.h>
44 #include "akregator_plugin.h"
47 typedef KGenericFactory<Akregator::Plugin, Kontact::Core > PluginFactory;
48 K_EXPORT_COMPONENT_FACTORY( libkontact_akregator,
49 PluginFactory(
"kontact_akregator" ) )
51 Plugin::Plugin( Kontact::Core *core, const
char *, const TQStringList& )
52 : Kontact::Plugin( core, TQT_TQOBJECT(core), "akregator" ), m_stub(0)
55 setInstance( PluginFactory::instance() );
57 insertNewAction(
new KAction( i18n(
"New Feed..." ),
"bookmark_add", CTRL+SHIFT+Key_F,
this, TQT_SLOT( addFeed() ), actionCollection(),
"feed_new" ) );
67 bool Plugin::isRunningStandalone()
69 return m_uniqueAppWatcher->isRunningStandalone();
72 TQStringList Plugin::invisibleToolbarActions()
const
74 return TQStringList(
"file_new_contact" );
78 Akregator::AkregatorPartIface_stub *Plugin::interface()
89 MyBasePart* Plugin::createPart()
91 MyBasePart* p = loadPart();
93 connect(p, TQT_SIGNAL(showPart()),
this, TQT_SLOT(showPart()));
94 m_stub =
new Akregator::AkregatorPartIface_stub( dcopClient(),
"akregator",
96 m_stub->openStandardFeedList();
101 void Plugin::showPart()
103 core()->selectPlugin(
this);
106 void Plugin::addFeed()
108 interface()->addFeed();
111 TQStringList Plugin::configModules()
const
113 TQStringList modules;
114 modules <<
"PIM/akregator.desktop";
118 void Plugin::readProperties( KConfig *config )
121 Akregator::Part *myPart =
static_cast<Akregator::Part*
>( part() );
122 myPart->readProperties( config );
126 void Plugin::saveProperties( KConfig *config )
129 Akregator::Part *myPart =
static_cast<Akregator::Part*
>( part() );
130 myPart->saveProperties( config );
134 void UniqueAppHandler::loadCommandLineOptions()
136 KCmdLineArgs::addCmdLineOptions( akregator_options );
139 int UniqueAppHandler::newInstance()
141 kdDebug(5602) << k_funcinfo << endl;
143 (void)plugin()->part();
144 DCOPRef akr(
"akregator",
"AkregatorIface" );
156 #include "akregator_plugin.moc"