Commit 0971610c authored by Laurent Montel's avatar Laurent Montel 😁

Add initial/beforeconverting data

parent b7992237
......@@ -119,6 +119,8 @@ set(messagecomposer_plugineditorconverttext_SRCS
plugineditorconverttext/plugineditorconverttext.cpp
plugineditorconverttext/plugineditorconverttextmanager.cpp
plugineditorconverttext/plugineditorconverttextinterface.cpp
plugineditorconverttext/plugineditorconverterinitialdata.cpp
plugineditorconverttext/plugineditorconverterbeforeconvertingdata.cpp
)
set(messagecomposer_widgets_SRCS
......@@ -242,6 +244,8 @@ ecm_generate_headers(MessageComposer_Camelplugineditorconverttext_HEADERS
PluginEditorConvertText
PluginEditorConvertTextManager
PluginEditorConvertTextInterface
PluginEditorConverterInitialData
PluginEditorConverterBeforeConvertingData
REQUIRED_HEADERS MessageComposer_plugineditorconverttext_HEADERS
PREFIX MessageComposer
RELATIVE plugineditorconverttext
......
/*
Copyright (C) 2018 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 "plugineditorconverterbeforeconvertingdata.h"
using namespace MessageComposer;
PluginEditorConverterBeforeConvertingData::PluginEditorConverterBeforeConvertingData()
{
}
bool PluginEditorConverterBeforeConvertingData::newMessage() const
{
return mNewMessage;
}
void PluginEditorConverterBeforeConvertingData::setNewMessage(bool newMessage)
{
mNewMessage = newMessage;
}
/*
Copyright (C) 2018 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 PLUGINEDITORCONVERTERBEFORECONVERTINGDATA_H
#define PLUGINEDITORCONVERTERBEFORECONVERTINGDATA_H
#include "messagecomposer_export.h"
namespace MessageComposer {
class MESSAGECOMPOSER_EXPORT PluginEditorConverterBeforeConvertingData
{
public:
PluginEditorConverterBeforeConvertingData();
bool newMessage() const;
void setNewMessage(bool newMessage);
private:
bool mNewMessage = true;
};
}
#endif // PLUGINEDITORCONVERTERBEFORECONVERTINGDATA_H
/*
Copyright (C) 2018 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 "plugineditorconverterinitialdata.h"
using namespace MessageComposer;
PluginEditorConverterInitialData::PluginEditorConverterInitialData()
{
}
/*
Copyright (C) 2018 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 PLUGINEDITORCONVERTERINITIALDATA_H
#define PLUGINEDITORCONVERTERINITIALDATA_H
#include "messagecomposer_export.h"
namespace MessageComposer {
class MESSAGECOMPOSER_EXPORT PluginEditorConverterInitialData
{
public:
PluginEditorConverterInitialData();
};
}
#endif // PLUGINEDITORCONVERTERINITIALDATA_H
......@@ -18,6 +18,8 @@
*/
#include "plugineditorconverttextinterface.h"
#include "plugineditorconverterinitialdata.h"
#include "plugineditorconverterbeforeconvertingdata.h"
#include <KActionCollection>
......@@ -36,6 +38,8 @@ public:
QWidget *mParentWidget = nullptr;
KPIMTextEdit::RichTextComposer *mEditor = nullptr;
KMime::Message::Ptr mMewMsg;
PluginEditorConverterInitialData mInitialData;
PluginEditorConverterBeforeConvertingData mBeforeConvertingData;
};
PluginEditorConvertTextInterface::PluginEditorConvertTextInterface(QObject *parent)
......@@ -89,6 +93,26 @@ KMime::Message::Ptr PluginEditorConvertTextInterface::message() const
return d->mMewMsg;
}
void PluginEditorConvertTextInterface::setInitialData(const PluginEditorConverterInitialData &data)
{
d->mInitialData = data;
}
PluginEditorConverterInitialData PluginEditorConvertTextInterface::initialData() const
{
return d->mInitialData;
}
void PluginEditorConvertTextInterface::setBeforeConvertingData(const PluginEditorConverterBeforeConvertingData &data)
{
d->mBeforeConvertingData = data;
}
PluginEditorConverterBeforeConvertingData PluginEditorConvertTextInterface::beforeConvertingData() const
{
return d->mBeforeConvertingData;
}
KPIMTextEdit::RichTextComposer *PluginEditorConvertTextInterface::richTextEditor() const
{
return d->mEditor;
......
......@@ -25,6 +25,7 @@
#include <MessageComposer/PluginActionType>
#include <KMime/Message>
namespace KPIMTextEdit {
class RichTextComposer;
}
......@@ -32,6 +33,8 @@ class KActionCollection;
namespace MessageComposer {
class TextPart;
class PluginEditorConvertTextInterfacePrivate;
class PluginEditorConverterInitialData;
class PluginEditorConverterBeforeConvertingData;
class MESSAGECOMPOSER_EXPORT PluginEditorConvertTextInterface : public QObject
{
Q_OBJECT
......@@ -57,6 +60,12 @@ public:
virtual void setMessage(const KMime::Message::Ptr &);
KMime::Message::Ptr message() const;
void setInitialData(const PluginEditorConverterInitialData &data);
PluginEditorConverterInitialData initialData() const;
void setBeforeConvertingData(const PluginEditorConverterBeforeConvertingData &data);
PluginEditorConverterBeforeConvertingData beforeConvertingData() const;
public Q_SLOTS:
virtual void reloadConfig();
......
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