~aleteoryx/muditaos

muditaos/module-apps/application-call/widgets/StateIcons.cpp -rw-r--r-- 2.1 KiB
a405cad6Aleteoryx trim readme 6 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md

#include "CallAppStyle.hpp"
#include "StateIcons.hpp"

namespace gui
{
    namespace
    {
        constexpr auto crossImg      = "call_add";
        constexpr auto addContactStr = "app_call_contact";
        constexpr auto messageImg    = "call_message";
        constexpr auto sendSmstStr   = "app_call_message";
        constexpr auto muteImg       = "call_mute";
        constexpr auto mutedImg      = "call_mute_on";
        constexpr auto muteStr       = "app_call_mute";
        constexpr auto mutedStr      = "app_call_muted";
        constexpr auto speakerImg    = "call_speaker";
        constexpr auto speakerOnImg  = "call_speaker_on";
        constexpr auto speakerStr    = "app_call_speaker";
        constexpr auto speakerOnStr  = "app_call_speaker_on";

        const StateIcon<AddContactIconState>::IconMap contactIconMap = {
            {AddContactIconState::ADD_CONTACT, {crossImg, addContactStr}}};
        const StateIcon<SendSmsIconState>::IconMap smsIconMap = {
            {SendSmsIconState::SEND_SMS, {messageImg, sendSmstStr}}};
        const StateIcon<MicrophoneIconState>::IconMap microphoneIconMap = {
            {MicrophoneIconState::MUTE, {muteImg, muteStr}}, {MicrophoneIconState::MUTED, {mutedImg, mutedStr}}};
        const StateIcon<SpeakerIconState>::IconMap speakerIconMap = {
            {SpeakerIconState::SPEAKER, {speakerImg, speakerStr}},
            {SpeakerIconState::SPEAKERON, {speakerOnImg, speakerOnStr}}};
    } // namespace

    AddContactIcon::AddContactIcon(Item *parent) : StateIcon(parent, AddContactIconState::ADD_CONTACT, contactIconMap)
    {}

    SendSmsIcon::SendSmsIcon(Item *parent) : StateIcon(parent, SendSmsIconState::SEND_SMS, smsIconMap)
    {}

    MicrophoneIcon::MicrophoneIcon(Item *parent) : StateIcon(parent, MicrophoneIconState::MUTE, microphoneIconMap)
    {}

    SpeakerIcon::SpeakerIcon(Item *parent) : StateIcon(parent, SpeakerIconState::SPEAKER, speakerIconMap)
    {}

} // namespace gui