27#include <tdeapplication.h>
30#include <kgenericfactory.h>
31#include <kiconloader.h>
32#include <tdemessagebox.h>
33#include <dcopclient.h>
37#include "journalplugin.h"
38#include "korg_uniqueapp.h"
41typedef KGenericFactory< JournalPlugin, Kontact::Core > JournalPluginFactory;
42K_EXPORT_COMPONENT_FACTORY( libkontact_journalplugin,
43 JournalPluginFactory(
"kontact_journalplugin" ) )
45JournalPlugin::JournalPlugin( Kontact::Core *core, const
char *, const TQStringList& )
46 : Kontact::Plugin( core, core,
"korganizer" ),
49 setInstance( JournalPluginFactory::instance() );
50 instance()->iconLoader()->addAppDir(
"tdepim");
52 insertNewAction(
new TDEAction( i18n(
"New Journal..." ),
"newjournal",
53 CTRL+SHIFT+Key_J,
this, TQ_SLOT( slotNewJournal() ), actionCollection(),
55 insertSyncAction(
new TDEAction( i18n(
"Synchronize Journal" ),
"reload",
56 0,
this, TQ_SLOT( slotSyncJournal() ), actionCollection(),
64JournalPlugin::~JournalPlugin()
70 KParts::ReadOnlyPart *
part = loadPart();
76 mIface =
new KCalendarIface_stub(
dcopClient(),
"kontact",
"CalendarIface" );
83 interface()->showJournalView();
88 TQStringList invisible;
89 invisible +=
"new_event";
90 invisible +=
"new_todo";
91 invisible +=
"new_journal";
93 invisible +=
"view_day";
94 invisible +=
"view_list";
95 invisible +=
"view_workweek";
96 invisible +=
"view_week";
97 invisible +=
"view_nextx";
98 invisible +=
"view_month";
99 invisible +=
"view_todo";
103KCalendarIface_stub *JournalPlugin::interface()
112void JournalPlugin::slotNewJournal()
114 interface()->openJournalEditor(
"" );
117void JournalPlugin::slotSyncJournal()
119 DCOPRef ref(
"kmail",
"KMailICalIface" );
120 ref.send(
"triggerSync", TQString(
"Journal") );
123bool JournalPlugin::createDCOPInterface(
const TQString& serviceType )
125 kdDebug(5602) << k_funcinfo << serviceType << endl;
126 if ( serviceType ==
"DCOP/Organizer" || serviceType ==
"DCOP/Calendar" ) {
136 return mUniqueAppWatcher->isRunningStandalone();
139#include "journalplugin.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 void select()
This function is called when the plugin is selected by the user before the widget of the KPart belong...
virtual KParts::ReadOnlyPart * createPart()=0
Reimplement and return the part here.
Used by UniqueAppWatcher below, to create the above UniqueAppHandler object when necessary.
If the standalone application is running by itself, we need to watch for when the user closes it,...