Commit 2e285564 authored by Laurent Montel's avatar Laurent Montel 😁

Add plugin

parent 8ecdbbb1
...@@ -109,6 +109,8 @@ set(messagecomposer_plugineditorcheckbeforesend_SRCS ...@@ -109,6 +109,8 @@ set(messagecomposer_plugineditorcheckbeforesend_SRCS
set(messagecomposer_plugineditorinit_SRCS set(messagecomposer_plugineditorinit_SRCS
plugineditorinit/plugineditorinitconfigurewidget.cpp plugineditorinit/plugineditorinitconfigurewidget.cpp
plugineditorinit/plugineditorinit.cpp
plugineditorinit/plugineditorinitmanager.cpp
) )
...@@ -211,6 +213,8 @@ ecm_generate_headers(MessageComposer_Camelplugineditor_HEADERS ...@@ -211,6 +213,8 @@ ecm_generate_headers(MessageComposer_Camelplugineditor_HEADERS
ecm_generate_headers(MessageComposer_Camelplugineditorinit_HEADERS ecm_generate_headers(MessageComposer_Camelplugineditorinit_HEADERS
HEADER_NAMES HEADER_NAMES
PluginEditorInitConfigureWidget PluginEditorInitConfigureWidget
PluginEditorInit
PluginEditorInitManager
REQUIRED_HEADERS MessageComposer_plugineditorinit_HEADERS REQUIRED_HEADERS MessageComposer_plugineditorinit_HEADERS
PREFIX MessageComposer PREFIX MessageComposer
RELATIVE plugineditorinit RELATIVE plugineditorinit
......
/*
Copyright (C) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "plugineditorinit.h"
using namespace MessageComposer;
class MessageComposer::PluginEditorInitPrivate
{
public:
PluginEditorInitPrivate()
: mIsEnabled(false)
{
}
bool mIsEnabled;
};
PluginEditorInit::PluginEditorInit(QObject *parent)
: QObject(parent),
d(new MessageComposer::PluginEditorInitPrivate)
{
}
PluginEditorInit::~PluginEditorInit()
{
delete d;
}
bool PluginEditorInit::hasConfigureDialog() const
{
return false;
}
void PluginEditorInit::showConfigureDialog(QWidget *parent)
{
Q_UNUSED(parent);
}
void PluginEditorInit::emitConfigChanged()
{
Q_EMIT configChanged();
}
QString PluginEditorInit::description() const
{
return {};
}
void PluginEditorInit::setIsEnabled(bool enabled)
{
d->mIsEnabled = enabled;
}
bool PluginEditorInit::isEnabled() const
{
return d->mIsEnabled;
}
/*
Copyright (C) 2017 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef PLUGINEDITORINIT_H
#define PLUGINEDITORINIT_H
#include <QObject>
#include "messagecomposer_export.h"
namespace MessageComposer
{
class PluginEditorInitPrivate;
class PluginEditorInitInterface;
class MESSAGECOMPOSER_EXPORT PluginEditorInit : public QObject
{
Q_OBJECT
public:
explicit PluginEditorInit(QObject *parent = nullptr);
~PluginEditorInit();
virtual PluginEditorInitInterface *createInterface(QObject *parent) = 0;
virtual bool hasConfigureDialog() const;
virtual void showConfigureDialog(QWidget *parent = nullptr);
void emitConfigChanged();
virtual QString description() const;
void setIsEnabled(bool enabled);
bool isEnabled() const;
Q_SIGNALS:
void configChanged();
private:
PluginEditorInitPrivate *const d;
};
}
#endif // PLUGINEDITORINIT_H
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#ifndef PLUGINEDITORCHECKBEFORESENDMANAGER_H #ifndef PLUGINEDITORINITMANAGER_H
#define PLUGINEDITORCHECKBEFORESENDMANAGER_H #define PLUGINEDITORINITMANAGER_H
#include <QObject> #include <QObject>
#include "messagecomposer_export.h" #include "messagecomposer_export.h"
...@@ -46,4 +46,4 @@ private: ...@@ -46,4 +46,4 @@ private:
PluginEditorInitManagerPrivate *const d; PluginEditorInitManagerPrivate *const d;
}; };
} }
#endif // PLUGINEDITORCHECKBEFORESENDMANAGER_H #endif // PLUGINEDITORINITMANAGER_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment