File indexing completed on 2025-01-19 04:51:20
0001 /* 0002 This file is part of the KDE project 0003 0004 SPDX-FileCopyrightText: 2002 Daniel Molkentin <molkentin@kde.org> 0005 SPDX-FileCopyrightText: 2004 Michael Brade <brade@kde.org> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #pragma once 0011 0012 #include <KAboutData> 0013 #include <KontactInterface/Plugin> 0014 #include <KontactInterface/UniqueAppHandler> 0015 0016 class KNotesUniqueAppHandler : public KontactInterface::UniqueAppHandler 0017 { 0018 Q_OBJECT 0019 public: 0020 explicit KNotesUniqueAppHandler(KontactInterface::Plugin *plugin) 0021 : KontactInterface::UniqueAppHandler(plugin) 0022 { 0023 } 0024 0025 void loadCommandLineOptions(QCommandLineParser *parser) override; 0026 int activate(const QStringList &args, const QString &workingDir) override; 0027 }; 0028 0029 class KNotesPlugin : public KontactInterface::Plugin 0030 { 0031 Q_OBJECT 0032 public: 0033 KNotesPlugin(KontactInterface::Core *core, const KPluginMetaData &, const QVariantList &); 0034 ~KNotesPlugin() override; 0035 0036 KontactInterface::Summary *createSummaryWidget(QWidget *parentWidget) override; 0037 0038 bool isRunningStandalone() const override; 0039 0040 int weight() const override 0041 { 0042 return 600; 0043 } 0044 0045 const KAboutData aboutData() override; 0046 0047 bool canDecodeMimeData(const QMimeData *data) const override; 0048 void processDropEvent(QDropEvent *) override; 0049 void shortcutChanged() override; 0050 0051 protected: 0052 KParts::Part *createPart() override; 0053 0054 private Q_SLOTS: 0055 void slotNewNote(); 0056 0057 private: 0058 KontactInterface::UniqueAppWatcher *mUniqueAppWatcher = nullptr; 0059 };