kmail_plugin.h
1/*
2 This file is part of Kontact.
3 Copyright (c) 2003 Kontact Developer
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 As a special exception, permission is given to link this program
20 with any edition of TQt, and distribute the resulting executable,
21 without including the source code for TQt in the source distribution.
22*/
23
24#ifndef KMAIL_PLUGIN_H
25#define KMAIL_PLUGIN_H
26
27#include <tdelocale.h>
28#include <tdeparts/part.h>
29
30#include "kmailIface_stub.h"
31#include <plugin.h>
32#include <summary.h>
33#include <uniqueapphandler.h>
34
35class TQMimeSource;
36class TQDropEvent;
37
38class KMailUniqueAppHandler : public Kontact::UniqueAppHandler
39{
40public:
41 KMailUniqueAppHandler( Kontact::Plugin* plugin ) : Kontact::UniqueAppHandler( plugin ) {}
42 virtual void loadCommandLineOptions();
43 virtual int newInstance();
44};
45
46class KMailPlugin : public Kontact::Plugin
47{
48 TQ_OBJECT
49
50 public:
51 KMailPlugin( Kontact::Core *core, const char *name, const TQStringList& );
52 virtual ~KMailPlugin();
53
54 virtual bool isRunningStandalone();
55 virtual bool createDCOPInterface( const TQString& serviceType );
56 virtual Kontact::Summary *createSummaryWidget( TQWidget *parent );
57 virtual TQString tipFile() const;
58 int weight() const { return 200; }
59
60 virtual TQStringList invisibleToolbarActions() const;
61 virtual bool queryClose() const;
62
63 //override
64 void loadProfile( const TQString& profileDirectory );
65
66 //override
67 void saveToProfile( const TQString& profileDirectory );
68
69 protected:
70 virtual KParts::ReadOnlyPart* createPart();
71 void openComposer( const KURL& = KURL() );
72 void openComposer( const TQString& to );
73 bool canDecodeDrag( TQMimeSource * );
74 void processDropEvent( TQDropEvent * );
75
76
77 protected slots:
78 void slotNewMail();
79 void slotSyncFolders();
80
81 private:
82 KMailIface_stub *mStub;
83 Kontact::UniqueAppWatcher *mUniqueAppWatcher;
84};
85
86#endif
This class provides the interface to the Kontact core for the plugins.
Definition: core.h:42
Base class for all Plugins in Kontact.
Definition: plugin.h:59
virtual TQStringList invisibleToolbarActions() const
Returns a list of action name which shall be hidden in the main toolbar.
Definition: plugin.h:233
virtual bool isRunningStandalone()
Reimplement this method and return whether a standalone application is still running This is only req...
Definition: plugin.h:131
virtual bool createDCOPInterface(const TQString &)
Create the DCOP interface for the given serviceType, if this plugin provides it.
Definition: plugin.h:125
virtual bool canDecodeDrag(TQMimeSource *)
Return, if the plugin can handle the drag object of the given mime type.
Definition: plugin.h:238
virtual bool queryClose() const
Reimplement this method if you want to add checks before closing down the main kontact window.
Definition: plugin.h:191
virtual TQString tipFile() const
Reimplement this method and return the a path relative to "data" to the tips file.
Definition: plugin.cpp:157
virtual void processDropEvent(TQDropEvent *)
Process drop event.
Definition: plugin.h:243
virtual Summary * createSummaryWidget(TQWidget *)
Reimplement this method if you want to add a widget for your application to Kontact's summary page.
Definition: plugin.h:174
virtual int weight() const
Return the weight of the plugin.
Definition: plugin.h:208
virtual KParts::ReadOnlyPart * createPart()=0
Reimplement and return the part here.
Summary widget for display in the Summary View plugin.
Definition: summary.h:37
DCOP Object that has the name of the standalone application (e.g.
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,...