Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit f2d8da1c authored by Laurent Montel's avatar Laurent Montel 😁

Improve API

parent 0971610c
......@@ -33,3 +33,13 @@ void PluginEditorConverterBeforeConvertingData::setNewMessage(bool newMessage)
{
mNewMessage = newMessage;
}
KMime::Message::Ptr PluginEditorConverterBeforeConvertingData::message() const
{
return mMessage;
}
void PluginEditorConverterBeforeConvertingData::setMessage(const KMime::Message::Ptr &message)
{
mMessage = message;
}
......@@ -21,6 +21,7 @@
#define PLUGINEDITORCONVERTERBEFORECONVERTINGDATA_H
#include "messagecomposer_export.h"
#include <KMime/Message>
namespace MessageComposer {
class MESSAGECOMPOSER_EXPORT PluginEditorConverterBeforeConvertingData
{
......@@ -30,7 +31,11 @@ public:
bool newMessage() const;
void setNewMessage(bool newMessage);
KMime::Message::Ptr message() const;
void setMessage(const KMime::Message::Ptr &message);
private:
KMime::Message::Ptr mMessage;
bool mNewMessage = true;
};
}
......
......@@ -25,3 +25,23 @@ PluginEditorConverterInitialData::PluginEditorConverterInitialData()
{
}
bool PluginEditorConverterInitialData::newMessage() const
{
return mNewMessage;
}
void PluginEditorConverterInitialData::setNewMessage(bool newMessage)
{
mNewMessage = newMessage;
}
KMime::Message::Ptr PluginEditorConverterInitialData::mewMsg() const
{
return mMewMsg;
}
void PluginEditorConverterInitialData::setMewMsg(const KMime::Message::Ptr &mewMsg)
{
mMewMsg = mewMsg;
}
......@@ -21,11 +21,22 @@
#define PLUGINEDITORCONVERTERINITIALDATA_H
#include "messagecomposer_export.h"
#include <KMime/Message>
namespace MessageComposer {
class MESSAGECOMPOSER_EXPORT PluginEditorConverterInitialData
{
public:
PluginEditorConverterInitialData();
bool newMessage() const;
void setNewMessage(bool newMessage);
KMime::Message::Ptr mewMsg() const;
void setMewMsg(const KMime::Message::Ptr &mewMsg);
private:
KMime::Message::Ptr mMewMsg;
bool mNewMessage = true;
};
}
#endif // PLUGINEDITORCONVERTERINITIALDATA_H
......@@ -37,7 +37,6 @@ public:
QWidget *mParentWidget = nullptr;
KPIMTextEdit::RichTextComposer *mEditor = nullptr;
KMime::Message::Ptr mMewMsg;
PluginEditorConverterInitialData mInitialData;
PluginEditorConverterBeforeConvertingData mBeforeConvertingData;
};
......@@ -83,16 +82,6 @@ void PluginEditorConvertTextInterface::createAction(KActionCollection *ac)
Q_UNUSED(ac);
}
void PluginEditorConvertTextInterface::setMessage(const KMime::Message::Ptr &msg)
{
d->mMewMsg = msg;
}
KMime::Message::Ptr PluginEditorConvertTextInterface::message() const
{
return d->mMewMsg;
}
void PluginEditorConvertTextInterface::setInitialData(const PluginEditorConverterInitialData &data)
{
d->mInitialData = data;
......
......@@ -57,13 +57,10 @@ public:
virtual void createAction(KActionCollection *ac);
virtual void setMessage(const KMime::Message::Ptr &);
KMime::Message::Ptr message() const;
void setInitialData(const PluginEditorConverterInitialData &data);
virtual void setInitialData(const PluginEditorConverterInitialData &data);
PluginEditorConverterInitialData initialData() const;
void setBeforeConvertingData(const PluginEditorConverterBeforeConvertingData &data);
virtual void setBeforeConvertingData(const PluginEditorConverterBeforeConvertingData &data);
PluginEditorConverterBeforeConvertingData beforeConvertingData() const;
public Q_SLOTS:
......
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