mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
rename class to CMailMessage
This commit is contained in:
@ -107,7 +107,7 @@ HEADERS += \
|
|||||||
$$PWD/src/ctabundockevent.h \
|
$$PWD/src/ctabundockevent.h \
|
||||||
$$PWD/src/ccefeventsgate.h \
|
$$PWD/src/ccefeventsgate.h \
|
||||||
$$PWD/src/ceditortools.h \
|
$$PWD/src/ceditortools.h \
|
||||||
$$PWD/src/cemlhandler.h \
|
$$PWD/src/cmailmessage.h \
|
||||||
$$PWD/src/cwindowsqueue.h \
|
$$PWD/src/cwindowsqueue.h \
|
||||||
$$PWD/src/ceventdriver.h \
|
$$PWD/src/ceventdriver.h \
|
||||||
$$PWD/src/cappeventfilter.h \
|
$$PWD/src/cappeventfilter.h \
|
||||||
@ -149,7 +149,7 @@ SOURCES += \
|
|||||||
$$PWD/src/ctabundockevent.cpp \
|
$$PWD/src/ctabundockevent.cpp \
|
||||||
$$PWD/src/ccefeventsgate.cpp \
|
$$PWD/src/ccefeventsgate.cpp \
|
||||||
$$PWD/src/ceditortools.cpp \
|
$$PWD/src/ceditortools.cpp \
|
||||||
$$PWD/src/cemlhandler.cpp \
|
$$PWD/src/cmailmessage.cpp \
|
||||||
$$PWD/src/ceventdriver.cpp \
|
$$PWD/src/ceventdriver.cpp \
|
||||||
$$PWD/src/cappeventfilter.cpp \
|
$$PWD/src/cappeventfilter.cpp \
|
||||||
$$PWD/src/iconfactory.cpp \
|
$$PWD/src/iconfactory.cpp \
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cemlhandler.h"
|
#include "cmailmessage.h"
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -83,12 +83,12 @@ static bool writeFile(const std::string &filePath, const std::string &data)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CEmlHandler::CEmlHandlerPrivate
|
class CMailMessage::CMailMessagePrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CEmlHandlerPrivate()
|
CMailMessagePrivate()
|
||||||
{}
|
{}
|
||||||
~CEmlHandlerPrivate()
|
~CMailMessagePrivate()
|
||||||
{
|
{
|
||||||
while (!eml_paths.empty()) {
|
while (!eml_paths.empty()) {
|
||||||
std::remove(eml_paths.top().c_str());
|
std::remove(eml_paths.top().c_str());
|
||||||
@ -99,22 +99,22 @@ public:
|
|||||||
std::stack<std::string> eml_paths;
|
std::stack<std::string> eml_paths;
|
||||||
};
|
};
|
||||||
|
|
||||||
CEmlHandler::CEmlHandler() :
|
CMailMessage::CMailMessage() :
|
||||||
pimpl(new CEmlHandlerPrivate)
|
pimpl(new CMailMessagePrivate)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
CEmlHandler::~CEmlHandler()
|
CMailMessage::~CMailMessage()
|
||||||
{
|
{
|
||||||
delete pimpl, pimpl = nullptr;
|
delete pimpl, pimpl = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
CEmlHandler &CEmlHandler::instance()
|
CMailMessage &CMailMessage::instance()
|
||||||
{
|
{
|
||||||
static CEmlHandler inst;
|
static CMailMessage inst;
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEmlHandler::openEML(const std::string &from, const std::string &to, const std::string &subject, const std::string &msg)
|
void CMailMessage::openEML(const std::string &from, const std::string &to, const std::string &subject, const std::string &msg)
|
||||||
{
|
{
|
||||||
std::ostringstream data;
|
std::ostringstream data;
|
||||||
data << "From: " << from << "\n"
|
data << "From: " << from << "\n"
|
||||||
@ -145,7 +145,7 @@ void CEmlHandler::openEML(const std::string &from, const std::string &to, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bool CEmlHandler::sendMapiMail(std::string to, std::string name, std::string subject, std::string msg)
|
bool CMailMessage::sendMapiMail(std::string to, std::string name, std::string subject, std::string msg)
|
||||||
{
|
{
|
||||||
if (HMODULE lib = LoadLibrary(L"mapi32.dll")) {
|
if (HMODULE lib = LoadLibrary(L"mapi32.dll")) {
|
||||||
ULONG (WINAPI *_MAPISendMail)(LHANDLE, ULONG_PTR, MapiMessage*, FLAGS, ULONG);
|
ULONG (WINAPI *_MAPISendMail)(LHANDLE, ULONG_PTR, MapiMessage*, FLAGS, ULONG);
|
||||||
@ -30,18 +30,18 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CEMLHANDLER_H
|
#ifndef CMAILMESSAGE_H
|
||||||
#define CEMLHANDLER_H
|
#define CMAILMESSAGE_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
class CEmlHandler
|
class CMailMessage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CEmlHandler(const CEmlHandler&) = delete;
|
CMailMessage(const CMailMessage&) = delete;
|
||||||
CEmlHandler& operator=(const CEmlHandler&) = delete;
|
CMailMessage& operator=(const CMailMessage&) = delete;
|
||||||
static CEmlHandler& instance();
|
static CMailMessage& instance();
|
||||||
|
|
||||||
void openEML(const std::string &from, const std::string &to, const std::string &subject, const std::string &msg);
|
void openEML(const std::string &from, const std::string &to, const std::string &subject, const std::string &msg);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -49,11 +49,11 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CEmlHandler();
|
CMailMessage();
|
||||||
~CEmlHandler();
|
~CMailMessage();
|
||||||
|
|
||||||
class CEmlHandlerPrivate;
|
class CMailMessagePrivate;
|
||||||
CEmlHandlerPrivate *pimpl = nullptr;
|
CMailMessagePrivate *pimpl = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CEMLHANDLER_H
|
#endif // CMAILMESSAGE_H
|
||||||
Reference in New Issue
Block a user