27#include <dcopclient.h>
29#include <tdeaboutdata.h>
31#include <tdeapplication.h>
32#include <tdecmdlineargs.h>
34#include <kgenericfactory.h>
35#include <kiconloader.h>
36#include <tdemessagebox.h>
37#include <tdeparts/componentfactory.h>
42#include <akregator_options.h>
43#include <akregator_part.h>
44#include "akregator_plugin.h"
47typedef KGenericFactory<Akregator::AkregatorPlugin, Kontact::Core > PluginFactory;
48K_EXPORT_COMPONENT_FACTORY( libkontact_akregator,
49 PluginFactory(
"kontact_akregator" ) )
51AkregatorPlugin::AkregatorPlugin( Kontact::Core *core, const
char *, const TQStringList& )
52 : Kontact::Plugin( core, core, "akregator" ), m_stub(0)
54 setInstance( PluginFactory::instance() );
56 insertNewAction(
new TDEAction( i18n(
"New Feed..." ),
"bookmark_add", CTRL+SHIFT+Key_F,
this, TQ_SLOT( addFeed() ), actionCollection(),
"feed_new" ) );
62AkregatorPlugin::~AkregatorPlugin()
66bool AkregatorPlugin::isRunningStandalone()
68 return m_uniqueAppWatcher->isRunningStandalone();
71TQStringList AkregatorPlugin::invisibleToolbarActions()
const
73 return TQStringList(
"file_new_contact" );
77Akregator::AkregatorPartIface_stub *AkregatorPlugin::interface()
88MyBasePart* AkregatorPlugin::createPart()
90 MyBasePart* p = loadPart();
92 connect(p, TQ_SIGNAL(showPart()),
this, TQ_SLOT(showPart()));
93 m_stub =
new Akregator::AkregatorPartIface_stub( dcopClient(),
"akregator",
95 m_stub->openStandardFeedList();
100void AkregatorPlugin::showPart()
102 core()->selectPlugin(
this);
105void AkregatorPlugin::addFeed()
107 interface()->addFeed();
110TQStringList AkregatorPlugin::configModules()
const
112 TQStringList modules;
113 modules <<
"PIM/akregator.desktop";
117void AkregatorPlugin::readProperties( TDEConfig *config )
120 Akregator::Part *myPart =
static_cast<Akregator::Part*
>( part() );
121 myPart->readProperties( config );
125void AkregatorPlugin::saveProperties( TDEConfig *config )
128 Akregator::Part *myPart =
static_cast<Akregator::Part*
>( part() );
129 myPart->saveProperties( config );
133void UniqueAppHandler::loadCommandLineOptions()
135 TDECmdLineArgs::addCmdLineOptions( akregator_options );
138int UniqueAppHandler::newInstance()
140 kdDebug(5602) << k_funcinfo << endl;
142 (void)plugin()->part();
143 DCOPRef akr(
"akregator",
"AkregatorIface" );
155#include "akregator_plugin.moc"
Used by UniqueAppWatcher below, to create the above UniqueAppHandler object when necessary.
virtual int newInstance()
We can't use k_dcop and dcopidl here, because the data passed to newInstance can't be expressed in te...
If the standalone application is running by itself, we need to watch for when the user closes it,...