Clazy fix++
[kdepim.git] / kmail / kontactplugin / kmail_plugin.h
blob9a7b20d056a8234575f20211b3e42c751d98fb2e
1 /*
2 This file is part of Kontact.
4 Copyright (c) 2003-2013 Kontact Developer <kde-pim@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution.
25 #ifndef KMAIL_PLUGIN_H
26 #define KMAIL_PLUGIN_H
28 #include <KontactInterface/Plugin>
29 #include <KontactInterface/UniqueAppHandler>
31 #include <QUrl>
32 class OrgKdeKmailKmailInterface;
34 namespace KontactInterface
36 class UniqueAppWatcher;
39 class KMailUniqueAppHandler : public KontactInterface::UniqueAppHandler
41 Q_OBJECT
42 public:
43 explicit KMailUniqueAppHandler(KontactInterface::Plugin *plugin)
44 : KontactInterface::UniqueAppHandler(plugin) {}
45 void loadCommandLineOptions(QCommandLineParser *parser) Q_DECL_OVERRIDE;
46 int activate(const QStringList &args, const QString &workingDir) Q_DECL_OVERRIDE;
49 class KMailPlugin : public KontactInterface::Plugin
51 Q_OBJECT
53 public:
54 KMailPlugin(KontactInterface::Core *core, const QVariantList &);
55 ~KMailPlugin();
57 bool isRunningStandalone() const Q_DECL_OVERRIDE;
58 bool createDBUSInterface(const QString &serviceType) Q_DECL_OVERRIDE;
59 KontactInterface::Summary *createSummaryWidget(QWidget *parent) Q_DECL_OVERRIDE;
60 int weight() const Q_DECL_OVERRIDE
62 return 200;
65 QStringList invisibleToolbarActions() const Q_DECL_OVERRIDE;
66 bool queryClose() const Q_DECL_OVERRIDE;
68 void shortcutChanged() Q_DECL_OVERRIDE;
70 protected:
71 KParts::ReadOnlyPart *createPart() Q_DECL_OVERRIDE;
72 void openComposer(const QUrl &attach = QUrl());
73 void openComposer(const QString &to);
74 bool canDecodeMimeData(const QMimeData *) const Q_DECL_OVERRIDE;
75 void processDropEvent(QDropEvent *) Q_DECL_OVERRIDE;
77 protected Q_SLOTS:
78 void slotNewMail();
79 void slotSyncFolders();
81 private:
82 OrgKdeKmailKmailInterface *m_instance;
83 KontactInterface::UniqueAppWatcher *mUniqueAppWatcher;
86 #endif