summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-01-31 21:44:52 +0100
committerLaurent Montel <[email protected]>2018-01-31 21:44:52 +0100
commit1def5b92433fac4c4b1b2478053d16b3834a1600 (patch)
treef92a89e07c48b73e3ac6a5e29e52bbf169b6e2ce
parent638772af958e05b74687f709244eb1760233003b (diff)
Start to implement "add template command" in composer
-rw-r--r--kmail/editorplugins/CMakeLists.txt1
-rw-r--r--kmail/editorplugins/inserttemplatecommand/CMakeLists.txt0
-rw-r--r--kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.cpp43
-rw-r--r--kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.h38
-rw-r--r--kmail/editorplugins/inserttemplatecommand/kmail_inserttemplatecommandeditorplugin.json13
5 files changed, 95 insertions, 0 deletions
diff --git a/kmail/editorplugins/CMakeLists.txt b/kmail/editorplugins/CMakeLists.txt
index aab0eb4..39c6d94 100644
--- a/kmail/editorplugins/CMakeLists.txt
+++ b/kmail/editorplugins/CMakeLists.txt
@@ -6,3 +6,4 @@ add_subdirectory(nonbreakingspace)
add_subdirectory(autocorrection)
add_subdirectory(insertemail)
add_subdirectory(insertshorturl)
+add_subdirectory(inserttemplatecommand)
diff --git a/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt b/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/kmail/editorplugins/inserttemplatecommand/CMakeLists.txt
diff --git a/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.cpp b/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.cpp
new file mode 100644
index 0000000..e3d476c
--- /dev/null
+++ b/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.cpp
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2018 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "inserttemplatecommandplugineditor.h"
+#include "inserttemplatecommandplugineditorinterface.h"
+#include <kpluginfactory.h>
+
+K_PLUGIN_FACTORY_WITH_JSON(InsertTemplateCommandPluginEditorFactory, "kmail_inserttemplatecommandeditorplugin.json", registerPlugin<InsertTemplateCommandPluginEditor>();
+ )
+
+InsertTemplateCommandPluginEditor::InsertTemplateCommandPluginEditor(QObject *parent, const QList<QVariant> &)
+ : MessageComposer::PluginEditor(parent)
+{
+}
+
+InsertTemplateCommandPluginEditor::~InsertTemplateCommandPluginEditor()
+{
+}
+
+MessageComposer::PluginEditorInterface *InsertTemplateCommandPluginEditor::createInterface(KActionCollection *ac, QObject *parent)
+{
+ InsertTemplateCommandPluginEditorInterface *interface = new InsertTemplateCommandPluginEditorInterface(parent);
+ interface->createAction(ac);
+ return interface;
+}
+
+#include "inserttemplatecommandplugineditor.moc"
diff --git a/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.h b/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.h
new file mode 100644
index 0000000..4eca35f
--- /dev/null
+++ b/kmail/editorplugins/inserttemplatecommand/inserttemplatecommandplugineditor.h
@@ -0,0 +1,38 @@
+/*
+ Copyright (C) 2018 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef INSERTTEMPLATECOMMANDPLUGINEDITOR_H
+#define INSERTTEMPLATECOMMANDPLUGINEDITOR_H
+
+#include <messagecomposer/plugineditor.h>
+
+#include <messagecomposer/plugineditorinterface.h>
+#include <QVariant>
+
+class InsertTemplateCommandPluginEditor : public MessageComposer::PluginEditor
+{
+ Q_OBJECT
+public:
+ explicit InsertTemplateCommandPluginEditor(QObject *parent = nullptr, const QList<QVariant> & = QList<QVariant>());
+ ~InsertTemplateCommandPluginEditor();
+
+ MessageComposer::PluginEditorInterface *createInterface(KActionCollection *ac, QObject *parent = nullptr) override;
+};
+
+#endif
diff --git a/kmail/editorplugins/inserttemplatecommand/kmail_inserttemplatecommandeditorplugin.json b/kmail/editorplugins/inserttemplatecommand/kmail_inserttemplatecommandeditorplugin.json
new file mode 100644
index 0000000..dd17e32
--- /dev/null
+++ b/kmail/editorplugins/inserttemplatecommand/kmail_inserttemplatecommandeditorplugin.json
@@ -0,0 +1,13 @@
+{
+ "KPlugin": {
+ "Description": "This plugin allows you to insert a templace command in composer.",
+ "EnabledByDefault": "true",
+ "Id": "kmailinserttemplatecommand",
+ "Name": "Insert Template Command",
+ "ServiceTypes": [
+ "KMailEditor/Plugin"
+ ],
+ "Version": "1.0"
+ },
+ "X-KDE-KMailEditor-Order": "2"
+}