~aleteoryx/muditaos

ref: 6bbef804c0605b90a3aff579376e9ea940733238 muditaos/module-apps/UiCommonActions.hpp -rw-r--r-- 3.6 KiB
6bbef804 — Michał Kamoń [EGD-4284] missing include added (#956) 5 years 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// 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 "Application.hpp"

#include <OptionWindow.hpp>
#include <PhoneNumber.hpp>
#include <service-db/api/DBServiceAPI.hpp>

namespace app
{
    enum class CallOperation
    {
        ExecuteCall,
        PrepareCall
    };

    /// @brief requests selected call operation
    ///
    /// @param app - requesting application
    /// @param CallOperation - selected call operation.
    ///
    /// @parem contact - contact record on which the operation is requested
    ///
    /// @return true if succeed
    auto call(Application *app, const ContactRecord &contact) -> bool;

    /// @brief requests selected call operation
    ///
    /// @param app - requesting application
    /// @param CallOperation - selected call operation.
    ///
    /// @param number - phone number (assigned to contact) on which the operation is requested
    ///
    /// @return true if succeed
    auto call(Application *app, const utils::PhoneNumber::View &number) -> bool;

    /// @brief prepares for a call (displays number to the user)
    ///
    /// @param app - requesting application
    /// @param number - phone number on which the operation is requested
    ///
    /// @return true if succeed
    auto prepareCall(Application *app, const std::string &number) -> bool;

    enum class SmsOperation
    {
        New,
        Template
    };

    /// @brief requests selected sms operation
    ///
    /// @param app - requesting application
    /// @param smsOperation - selected sms operation.
    ///
    /// @param number - phone number (assigned to contact) on which the operation is requested
    ///
    /// @param textData - text message which should be sent as sms
    ///
    /// @return true if succeed
    auto sms(Application *app,
             SmsOperation smsOperation,
             const utils::PhoneNumber::View &number,
             const UTF8 textData = "") -> bool;

    enum class ContactOperation
    {
        Add,
        Details,
        Edit
    };

    /// @brief requests selected contact operation
    ///
    /// @param app - requesting application
    /// @param contactOperation - selected contact operation.
    ///
    /// @parem contact - contact record on which the operation is requested
    ///
    /// @return true if succeed
    auto contact(Application *app, ContactOperation contactOperation, const ContactRecord &contact) -> bool;

    /// @brief requests selected contact operation
    ///
    /// @param app - requesting application
    /// @param contactOperation - selected contact operation.
    ///
    /// @parem number - phone number (assigned to contact) on which the operation is requested
    ///
    /// @return true if succeed
    auto contact(Application *app, ContactOperation contactOperation, const std::string &number) -> bool;

    /// @brief requests selected contact operation
    ///
    /// @param app - requesting application
    /// @param contactOperation - selected contact operation. @note ContactOperation::Add is no valid in this case
    ///
    /// @parem contactId - id of contact on which the operation is requested
    ///
    /// @return true if succeed
    auto contact(Application *app, ContactOperation contactOperation, uint32_t contactId) -> bool;

    /// @brief requests display special input window.
    /// @param app          Requesting application
    /// @param switchData   Application switch data.
    /// @return true if succeed.
    auto specialInput(Application *app, std::unique_ptr<gui::SwitchSpecialChar> &&switchData) -> bool;
} // namespace app