mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-28 16:01:50 -05:00
90 lines
2.2 KiB
C++
90 lines
2.2 KiB
C++
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <SwitchData.hpp>
|
|
#include <SMSTemplateRecord.hpp>
|
|
#include <ContactRecord.hpp>
|
|
#include <ThreadRecord.hpp>
|
|
#include <Database/Database.hpp>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
class SMSThreadData : public gui::SwitchData
|
|
{
|
|
public:
|
|
std::shared_ptr<ThreadRecord> thread;
|
|
std::optional<UTF8> threadName;
|
|
|
|
SMSThreadData(std::shared_ptr<ThreadRecord> _thread, std::optional<UTF8> _threadName = std::nullopt)
|
|
: thread(std::move(_thread)), threadName{std::move(_threadName)}
|
|
{}
|
|
};
|
|
|
|
class SMSRequest : public gui::SwitchData
|
|
{
|
|
protected:
|
|
utils::PhoneNumber::View phoneNumber;
|
|
|
|
public:
|
|
SMSRequest() = delete;
|
|
SMSRequest(const utils::PhoneNumber::View &phoneNumber) : phoneNumber(phoneNumber)
|
|
{}
|
|
~SMSRequest() override = default;
|
|
|
|
[[nodiscard]] auto getPhoneNumber() const -> const utils::PhoneNumber::View &
|
|
{
|
|
return phoneNumber;
|
|
};
|
|
};
|
|
|
|
class SMSSendRequest : public SMSRequest
|
|
{
|
|
public:
|
|
SMSSendRequest(const utils::PhoneNumber::View &phoneNumber, UTF8 textData)
|
|
: SMSRequest(phoneNumber), textData(std::move(textData))
|
|
{}
|
|
~SMSSendRequest() override = default;
|
|
UTF8 textData;
|
|
};
|
|
|
|
class SMSSendTemplateRequest : public SMSRequest
|
|
{
|
|
public:
|
|
SMSSendTemplateRequest(const utils::PhoneNumber::View &phoneNumber) : SMSRequest(phoneNumber)
|
|
{}
|
|
~SMSSendTemplateRequest() override = default;
|
|
};
|
|
|
|
class SMSTemplateSent : public gui::SwitchData
|
|
{};
|
|
|
|
class SMSTextData : public gui::SwitchData
|
|
{
|
|
public:
|
|
enum class Concatenate : bool
|
|
{
|
|
True,
|
|
False
|
|
};
|
|
|
|
SMSTextData(UTF8 text, Concatenate concatenate = Concatenate::False)
|
|
: text(std::move(text)), concatenate(concatenate)
|
|
{}
|
|
~SMSTextData() override = default;
|
|
UTF8 text;
|
|
Concatenate concatenate = Concatenate::False;
|
|
};
|
|
|
|
class SMSTemplateRequest : public gui::SwitchData
|
|
{
|
|
public:
|
|
SMSTemplateRequest(std::string requestingWindow) : requestingWindow(std::move(requestingWindow))
|
|
{}
|
|
~SMSTemplateRequest() override = default;
|
|
|
|
std::string requestingWindow;
|
|
};
|