25#include "knode_plugin.h"
29#include <tdeapplication.h>
30#include <tdeparts/componentfactory.h>
31#include <kgenericfactory.h>
32#include <tdeapplication.h>
34#include <kiconloader.h>
37#include <dcopclient.h>
42typedef KGenericFactory<KNodePlugin, Kontact::Core> KNodePluginFactory;
43K_EXPORT_COMPONENT_FACTORY( libkontact_knodeplugin,
44 KNodePluginFactory(
"kontact_knodeplugin" ) )
47KNodePlugin::KNodePlugin( Kontact::Core *core, const
char *, const TQStringList& )
48 : Kontact::Plugin( core, core,
"knode" ), mStub(0)
50 setInstance( KNodePluginFactory::instance() );
52 insertNewAction(
new TDEAction( i18n(
"New Article..." ),
"mail-message-new", CTRL+SHIFT+Key_A,
53 this, TQ_SLOT( slotPostArticle() ), actionCollection(),
"post_article" ) );
59KNodePlugin::~KNodePlugin()
63bool KNodePlugin::createDCOPInterface(
const TQString& )
70 return mUniqueAppWatcher->isRunningStandalone();
75 return TQStringList(
"article_postNew" );
78void KNodePlugin::slotPostArticle()
88 KParts::ReadOnlyPart *
part = loadPart();
89 if ( !
part )
return 0;
91 mStub =
new KNodeIface_stub(
dcopClient(),
"knode",
"KNodeIface" );
97#include "../../../knode/knode_options.h"
100 TDECmdLineArgs::addCmdLineOptions( knode_options );
106 (void)plugin()->part();
107 DCOPRef knode(
"knode",
"KNodeIface" );
108 DCOPReply reply = knode.call(
"handleCommandLine" );
110 if ( reply.isValid() ) {
111 bool handled = reply;
112 kdDebug(5602) << k_funcinfo <<
"handled=" << handled << endl;
123#include "knode_plugin.moc"
KParts::ReadOnlyPart * part()
You can use this method if you need to access the current part.
DCOPClient * dcopClient() const
Retrieve the current DCOP Client for the plugin.
virtual TQStringList invisibleToolbarActions() const
Returns a list of action name which shall be hidden in the main toolbar.
virtual bool isRunningStandalone()
Reimplement this method and return whether a standalone application is still running This is only req...
virtual KParts::ReadOnlyPart * createPart()=0
Reimplement and return the part here.
Used by UniqueAppWatcher below, to create the above UniqueAppHandler object when necessary.
virtual void loadCommandLineOptions()=0
This must be reimplemented so that app-specific command line options can be parsed.
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,...