Files
MuditaOS/module-apps/application-call/widgets/Icons.hpp
Alek-Mudita 0b7d24710a Egd 2548 fix layout of ongoing call window (#246)
* [EGD-2548] added AddContactIcon

* [EGD-2548] added send message Icon - still need to use it in Call Window

* [EGD-2548] SendSmsIcon used in callwindow

* [EGD-2548] rewritten Icon class to be template based
Created all missing Icons

* [EGD-2548] integranio of new icons in callwindow and some fixes

* [EGD-2548] code clean up and tune up constants

* [EGD-2548] clang formatter and fix speaker icons

* [EGD-2548] revert of USE_DAEFAULT_BAUDRATE

* [EGD-2648] destruktor fix
2020-03-20 12:55:51 +01:00

100 lines
3.6 KiB
C++

#pragma once
#include "Icon.hpp"
#include "i18/i18.hpp"
#include "application-call/data/CallAppStyle.hpp"
namespace gui
{
enum class AddContactIconState
{
ADD_CONTACT
};
class AddContactIcon : public Icon<AddContactIconState>
{
protected:
static const inline std::string crossImg = "cross";
static const inline std::string addContactStr = "app_call_contact";
static const inline Icon::IconMap iconMap = {{AddContactIconState::ADD_CONTACT, {crossImg, addContactStr}}};
public:
AddContactIcon() = delete;
AddContactIcon(Item *parent, const uint32_t &x, const uint32_t &y)
: Icon(parent, x, y, callAppStyle::icon::x_margin, AddContactIconState::ADD_CONTACT, iconMap)
{}
~AddContactIcon() override = default;
};
enum class SendSmsIconState
{
SEND_SMS
};
class SendSmsIcon : public Icon<SendSmsIconState>
{
protected:
static const inline std::string messageImg = "mail";
static const inline std::string sendSmstStr = "app_call_message";
static const inline Icon::IconMap iconMap = {{SendSmsIconState::SEND_SMS, {messageImg, sendSmstStr}}};
public:
SendSmsIcon() = delete;
SendSmsIcon(Item *parent, const uint32_t &x, const uint32_t &y)
: Icon(parent, x, y, callAppStyle::icon::x_margin, SendSmsIconState::SEND_SMS, iconMap)
{}
~SendSmsIcon() override = default;
};
enum class MicrophoneIconState
{
MUTE,
MUTED
};
class MicrophoneIcon : public Icon<MicrophoneIconState>
{
protected:
static const inline std::string muteImg = "microphone_on";
static const inline std::string mutedImg = "microphone_off";
static const inline std::string muteStr = "app_call_mute";
static const inline std::string mutedStr = "app_call_muted";
static const inline Icon::IconMap iconMap = {{MicrophoneIconState::MUTE, {muteImg, muteStr}},
{MicrophoneIconState::MUTED, {mutedImg, mutedStr}}};
public:
MicrophoneIcon() = delete;
MicrophoneIcon(Item *parent, const uint32_t &x, const uint32_t &y)
: Icon(parent, x, y, callAppStyle::icon::x_margin, MicrophoneIconState::MUTE, iconMap)
{}
~MicrophoneIcon() override = default;
};
enum class SpeakerIconState
{
SPEAKER,
SPEAKERON,
// BLUETOOTH
};
class SpeakerIcon : public Icon<SpeakerIconState>
{
protected:
static const inline std::string speakerImg = "speaker_off";
static const inline std::string speakerOnImg = "speaker_on";
// static const inline std::string bluetoothImg = "app_call_bluetooth";
static const inline std::string speakerStr = "app_call_speaker";
static const inline std::string speakerOnStr = "app_call_speaker_on";
// static const inline std::string bluetoothStr = "app_call_bluetooth";
static const inline Icon::IconMap iconMap = {
{SpeakerIconState::SPEAKER, {speakerImg, speakerStr}},
{SpeakerIconState::SPEAKERON, {speakerOnImg, speakerOnStr}},
//{SpeakerIconState::BLUETOOTH, {bluetoothImg, bluetoothStr}}
};
public:
SpeakerIcon() = delete;
SpeakerIcon(Item *parent, const uint32_t &x, const uint32_t &y)
: Icon(parent, x, y, callAppStyle::icon::x_margin, SpeakerIconState::SPEAKER, iconMap)
{}
~SpeakerIcon() override = default;
};
} // namespace gui